summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2009-07-21 16:30:07 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2009-07-21 16:30:07 -0700
commit435377c3c5d10724ffd7d1e6f1341107a3c27276 (patch)
tree8a75df3e2f78d19aa872b556e5c9c50255078794
parent4265dc8dd0e680d29ed97294b9e698c7675df4e8 (diff)
downloadruby-libmpd-435377c3c5d10724ffd7d1e6f1341107a3c27276.tar.gz
ruby-libmpd-435377c3c5d10724ffd7d1e6f1341107a3c27276.tar.xz
Add play, pause and stop methods.
-rw-r--r--mpdlib.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/mpdlib.rb b/mpdlib.rb
index b8e9818..8aaa90b 100644
--- a/mpdlib.rb
+++ b/mpdlib.rb
@@ -63,6 +63,21 @@ class MPD
return generate_hash send_request 'stats'
end
+ def play songpos=false
+ command = 'play'
+ command << ' ' + songpos.to_s if songpos
+
+ return send_request command
+ end
+
+ def pause pause
+ return send_request 'pause ' + pause.to_s
+ end
+
+ def stop
+ return send_request 'stop'
+ end
+
def next
return send_request 'next'
end