Class: Deftones::Source::Players::VolumeProxy
- Inherits:
-
Object
- Object
- Deftones::Source::Players::VolumeProxy
- Defined in:
- lib/deftones/source/players.rb
Instance Attribute Summary collapse
-
#players ⇒ Object
readonly
Returns the value of attribute players.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #exponential_ramp_to(target_value, duration = nil) ⇒ Object (also: #exponentialRampTo)
-
#initialize(players, value: 0.0) ⇒ VolumeProxy
constructor
A new instance of VolumeProxy.
- #linear_ramp_to(target_value, duration = nil) ⇒ Object (also: #linearRampTo)
- #ramp_to(target_value, duration = nil) ⇒ Object
- #set_value_at_time(target_value, time) ⇒ Object (also: #setValueAtTime)
Constructor Details
#initialize(players, value: 0.0) ⇒ VolumeProxy
Returns a new instance of VolumeProxy.
12 13 14 15 |
# File 'lib/deftones/source/players.rb', line 12 def initialize(players, value: 0.0) @players = players @value = value.to_f end |
Instance Attribute Details
#players ⇒ Object (readonly)
Returns the value of attribute players.
9 10 11 |
# File 'lib/deftones/source/players.rb', line 9 def players @players end |
#value ⇒ Object
Returns the value of attribute value.
10 11 12 |
# File 'lib/deftones/source/players.rb', line 10 def value @value end |
Instance Method Details
#exponential_ramp_to(target_value, duration = nil) ⇒ Object Also known as: exponentialRampTo
38 39 40 |
# File 'lib/deftones/source/players.rb', line 38 def exponential_ramp_to(target_value, duration = nil) ramp_to(target_value, duration) end |
#linear_ramp_to(target_value, duration = nil) ⇒ Object Also known as: linearRampTo
34 35 36 |
# File 'lib/deftones/source/players.rb', line 34 def linear_ramp_to(target_value, duration = nil) ramp_to(target_value, duration) end |
#ramp_to(target_value, duration = nil) ⇒ Object
22 23 24 25 26 |
# File 'lib/deftones/source/players.rb', line 22 def ramp_to(target_value, duration = nil) @value = target_value.to_f players.each { |player| player.volume.ramp_to(@value, duration) } self end |
#set_value_at_time(target_value, time) ⇒ Object Also known as: setValueAtTime
28 29 30 31 32 |
# File 'lib/deftones/source/players.rb', line 28 def set_value_at_time(target_value, time) @value = target_value.to_f players.each { |player| player.volume.set_value_at_time(@value, time) } self end |