summaryrefslogtreecommitdiff
path: root/mpdlib.rb
diff options
context:
space:
mode:
Diffstat (limited to 'mpdlib.rb')
-rw-r--r--mpdlib.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/mpdlib.rb b/mpdlib.rb
index c8266be..3b5a27f 100644
--- a/mpdlib.rb
+++ b/mpdlib.rb
@@ -36,4 +36,14 @@ class MPD
response << line
end
end
+
+ def currentsong
+ response = send_request('currentsong')
+ hash = Hash.new
+
+ response.split("\n").each do |line|
+ field, value = line.split(': ')
+ hash[field] = value
+ end
+ end
end