Method: MPD::Plugins::Queue#move
- Defined in:
- lib/ruby-mpd/plugins/queue.rb
#move(from, to) ⇒ Boolean
Move the song at from to to in the queue.
-
Since 0.14,
tocan be a negative number, which is the offset of the song from the currently playing (or to-be-played) song. So -1 would mean the song would be moved to be the next song in the queue. Moving a song to -queue.length will move it to the song before the current song on the queue; so this will work for repeating playlists, too. -
Since 0.15,
fromcan be a range of songs to move.
66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/ruby-mpd/plugins/queue.rb', line 66 def move(from, to) if from.is_a?(Hash) if from[:id] send_command :moveid, from[:id], to else raise ArgumentError, 'Only :id key is allowed!' end else send_command :move, from, to end end |