summaryrefslogtreecommitdiff
path: root/mpdlib.rb
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2009-07-21 18:00:41 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2009-07-21 18:00:41 -0700
commit2e332839c0830cad3c853c404a9be7efa8ccc249 (patch)
tree57d2f8dc580d457c05732f94409667a5da51e491 /mpdlib.rb
parentce643b5be296ec114e07152669fbd33240b57cc1 (diff)
downloadruby-libmpd-2e332839c0830cad3c853c404a9be7efa8ccc249.tar.gz
ruby-libmpd-2e332839c0830cad3c853c404a9be7efa8ccc249.tar.xz
Add clear and playlistinfo methods.
Diffstat (limited to 'mpdlib.rb')
-rw-r--r--mpdlib.rb14
1 files changed, 14 insertions, 0 deletions
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