From a5b89802ef7614b214e92a1e6b03ebc17e3557b5 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Sat, 1 Aug 2009 13:10:30 -0700 Subject: Various cleanup. --- libmpd/playlist.rb | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'libmpd/playlist.rb') diff --git a/libmpd/playlist.rb b/libmpd/playlist.rb index 1b591c6..000f9c9 100644 --- a/libmpd/playlist.rb +++ b/libmpd/playlist.rb @@ -11,36 +11,35 @@ # Collection of methods related to the playlist. module MPDPlaylist - # Adds the specified file to the playlist. (Directories add recursively.) - def add uri - return send_request 'add "%s"' % uri + # Adds the specified file to the playlist. + # Directories add recursively. + def add(uri) + return send_request('add "%s"' % uri) end # Deletes a song from the playlist. - def delete songpos - return send_request 'delete ' + songpos.to_s + def delete(songpos) + return send_request('delete %s' % songpos) end # Clears the playlist. def clear - return send_request 'clear' + return send_request('clear') end # Returns an Array composed of Hashes containing information about the songs # in the playlist. - # - # Not yet complete. - def playlistinfo - return split_and_hash send_request 'playlistinfo' + def playlist + return split_and_hash(send_request('playlistinfo')) end # Swaps the positions of the given songs, specified by playlist positions. def swap first, second - return send_request 'swap %s %s' % [first, second] + return send_request('swap %s %s' % [first, second]) end # Swaps the positions of the given songs, specified by song ids. def swapid first, second - return send_request 'swapid %s %s' % [first, second] + return send_request('swapid %s %s' % [first, second]) end end -- cgit v1.2.3-70-g09d2