From 435377c3c5d10724ffd7d1e6f1341107a3c27276 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Tue, 21 Jul 2009 16:30:07 -0700 Subject: Add play, pause and stop methods. --- mpdlib.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'mpdlib.rb') 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 -- cgit v1.2.3-70-g09d2