module MPD::Plugins::PlaybackOptions

Commands related to setting various aspects and modes of playback.

Public Instance Methods

consume=(toggle) click to toggle source

Enable/disable consume mode. @since MPD 0.16 When consume is activated, each song played is removed from playlist after playing. @macro returnraise

# File lib/ruby-mpd/plugins/playback_options.rb, line 11
def consume=(toggle)
  send_command :consume, toggle
end
crossfade=(seconds) click to toggle source

Set the crossfade between songs in seconds. @macro returnraise

# File lib/ruby-mpd/plugins/playback_options.rb, line 17
def crossfade=(seconds)
  send_command :crossfade, seconds
end
mixrampdb=(decibels) click to toggle source

Sets the threshold at which songs will be overlapped. Like crossfading but doesn’t fade the track volume, just overlaps. The songs need to have MixRamp tags added by an external tool. 0dB is the normalized maximum volume so use negative values, I prefer -17dB. In the absence of mixramp tags crossfading will be used. See sourceforge.net/projects/mixramp @param [Float] decibels Maximum volume level in decibels. @macro returnraise

# File lib/ruby-mpd/plugins/playback_options.rb, line 28
def mixrampdb=(decibels)
  send_command :mixrampdb, decibels
end
mixrampdelay=(seconds) click to toggle source

Additional time subtracted from the overlap calculated by mixrampdb. A value of “nan” or Float::NAN disables MixRamp overlapping and falls back to crossfading. @macro returnraise

# File lib/ruby-mpd/plugins/playback_options.rb, line 36
def mixrampdelay=(seconds)
  send_command :mixrampdelay, seconds
end
random=(toggle) click to toggle source

Enable/disable random playback. @macro returnraise

# File lib/ruby-mpd/plugins/playback_options.rb, line 42
def random=(toggle)
  send_command :random, toggle
end
repeat=(toggle) click to toggle source

Enable/disable repeat mode. @macro returnraise

# File lib/ruby-mpd/plugins/playback_options.rb, line 48
def repeat=(toggle)
  send_command :repeat, toggle
end
replay_gain_mode=(mode) click to toggle source

Sets the replay gain mode. One of :off, :track, :album, :auto. @since MPD 0.16 Changing the mode during playback may take several seconds, because the new settings does not affect the buffered data.

This command triggers the options idle event. @macro returnraise

# File lib/ruby-mpd/plugins/playback_options.rb, line 75
def replay_gain_mode=(mode)
  send_command :replay_gain_mode, mode
end
replay_gain_status() click to toggle source

Prints replay gain options. Currently, only the variable :replay_gain_mode is returned. @since MPD 0.16

# File lib/ruby-mpd/plugins/playback_options.rb, line 82
def replay_gain_status
  send_command :replay_gain_status
end
single=(toggle) click to toggle source

Enable/disable single mode. @since MPD 0.15 When single is activated, playback is stopped after current song, or song is repeated if the ‘repeat’ mode is enabled. @macro returnraise

# File lib/ruby-mpd/plugins/playback_options.rb, line 64
def single=(toggle)
  send_command :single, toggle
end
volume=(vol) click to toggle source

Sets the volume level. (Maps to MPD’s setvol) @param [Integer] vol Volume level between 0 and 100. @return [Integer] The new volume level.

# File lib/ruby-mpd/plugins/playback_options.rb, line 55
def volume=(vol)
  send_command :setvol, vol
end