summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2009-07-22 08:09:03 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2009-07-22 08:09:03 -0700
commita3399c86fe3f55a269f288ad13da5b248b5de7f9 (patch)
tree1f9174ded2418eff97bc1912ff3d980145181e8a
parentcbc2bf369e5dd49f474116085d2336aa0d094eab (diff)
downloadruby-libmpd-a3399c86fe3f55a269f288ad13da5b248b5de7f9.tar.gz
ruby-libmpd-a3399c86fe3f55a269f288ad13da5b248b5de7f9.tar.xz
Add methods for volume and playback options.
-rw-r--r--libmpd.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/libmpd.rb b/libmpd.rb
index b35801a..e6a6584 100644
--- a/libmpd.rb
+++ b/libmpd.rb
@@ -142,6 +142,38 @@ class MPD
return split_and_hash send_request 'search %s "%s"' % [type, what]
end
+ # Sets consume state. When consume is activated, each song played is
+ # removed from playlist.
+ def consume state
+ return send_request 'consume ' + state.to_s
+ end
+
+ # Sets crossfading between songs.
+ def crossfade seconds
+ return send_request 'crossfade ' + seconds.to_s
+ end
+
+ # Sets random state.
+ def random state
+ return send_request 'random ' + state.to_s
+ end
+
+ # Sets repeat state.
+ def repeat state
+ return send_request 'repeat ' + state.to_s
+ end
+
+ # Sets volume from a range of 0-100.
+ def setvol volume
+ return send_request 'setvol ' + volume.to_s
+ end
+
+ # Sets single state. When single is activated, playback is stopped after
+ # current song, or song is repeated if the 'repeat' mode is enabled.
+ def single state
+ return send_request 'single ' + state.to_s
+ end
+
private :generate_hash
private :get_response
private :split_and_hash