From 2e332839c0830cad3c853c404a9be7efa8ccc249 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Tue, 21 Jul 2009 18:00:41 -0700 Subject: Add clear and playlistinfo methods. --- mpdlib.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'mpdlib.rb') diff --git a/mpdlib.rb b/mpdlib.rb index 7d4d33d..70eb016 100644 --- a/mpdlib.rb +++ b/mpdlib.rb @@ -97,4 +97,18 @@ class MPD def delete songpos return send_request 'delete ' + songpos.to_s end + + def clear + return send_request 'clear' + end + + # Not yet complete. + def playlistinfo + playlist = send_request 'playlistinfo' + playlist = playlist.split(/(?!\n)(?=file:)/).map do |song| + generate_hash song + end + + return playlist + end end -- cgit v1.2.3-70-g09d2