summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2009-07-23 23:38:58 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2009-07-23 23:38:58 -0700
commit955c75a3d2b9d66175ee78a523500f4cc514bac8 (patch)
treefcfac497b4b69e16810394ee19f68b8263d7d8c0
parent34a8e8b5048ca530addc781bfb96721bd23e9704 (diff)
downloadruby-libmpd-955c75a3d2b9d66175ee78a523500f4cc514bac8.tar.gz
ruby-libmpd-955c75a3d2b9d66175ee78a523500f4cc514bac8.tar.xz
Rename setvol; new volume? and crossfade? methods.
-rw-r--r--libmpd/playbackoptions.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/libmpd/playbackoptions.rb b/libmpd/playbackoptions.rb
index ead7fab..fd83d9e 100644
--- a/libmpd/playbackoptions.rb
+++ b/libmpd/playbackoptions.rb
@@ -36,10 +36,20 @@ module MPDPlaybackOptions
end
# Sets volume from a range of 0-100.
- def setvol volume
+ def volume volume
return send_request 'setvol ' + volume.to_s
end
+ # Returns the current volume as an integer.
+ def volume?
+ return status[:volume].to_i
+ end
+
+ # Returns the current crossfade setting as an integer.
+ def crossfade?
+ return status[:xfade].to_i
+ end
+
# Sets single state.
# When single is activated, playback is stopped after the current song. If
# repeat is also activated, the current song is repeated.