summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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.