summaryrefslogtreecommitdiff
path: root/mpdlib.rb
diff options
context:
space:
mode:
Diffstat (limited to 'mpdlib.rb')
-rw-r--r--mpdlib.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/mpdlib.rb b/mpdlib.rb
index bd25637..4519787 100644
--- a/mpdlib.rb
+++ b/mpdlib.rb
@@ -48,4 +48,28 @@ class MPD
return hash
end
+
+ def status
+ response = send_request('status')
+ hash = Hash.new
+
+ response.split("\n").each do |line|
+ field, value = line.split(': ')
+ hash[field] = value
+ end
+
+ return hash
+ end
+
+ def stats
+ response = send_request('stats')
+ hash = Hash.new
+
+ response.split("\n").each do |line|
+ field, value = line.split(': ')
+ hash[field] = value
+ end
+
+ return hash
+ end
end