diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2009-07-22 08:09:03 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2009-07-22 08:09:03 -0700 |
commit | a3399c86fe3f55a269f288ad13da5b248b5de7f9 (patch) | |
tree | 1f9174ded2418eff97bc1912ff3d980145181e8a /libmpd.rb | |
parent | cbc2bf369e5dd49f474116085d2336aa0d094eab (diff) | |
download | ruby-libmpd-a3399c86fe3f55a269f288ad13da5b248b5de7f9.tar.gz ruby-libmpd-a3399c86fe3f55a269f288ad13da5b248b5de7f9.tar.xz |
Add methods for volume and playback options.
Diffstat (limited to 'libmpd.rb')
-rw-r--r-- | libmpd.rb | 32 |
1 files changed, 32 insertions, 0 deletions
@@ -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 |