Class: Deftones::Component::Channel
Class Attribute Summary collapse
Instance Attribute Summary collapse
#context
Instance Method Summary
collapse
-
#bus(name) ⇒ Object
private
-
#dispose ⇒ Object
-
#initialize(pan: 0.0, volume: 0.0, solo: false, muted: false, mute: nil, context: Deftones.context) ⇒ Channel
constructor
A new instance of Channel.
-
#mute ⇒ Object
-
#mute=(value) ⇒ Object
-
#mute? ⇒ Boolean
-
#muted ⇒ Object
(also: #muted?)
-
#muted=(value) ⇒ Object
-
#pan ⇒ Object
-
#pan=(value) ⇒ Object
-
#receive(name) ⇒ Object
-
#render(num_frames, start_frame = 0, cache = {}) ⇒ Object
-
#render_block(num_frames, start_frame = 0, cache = {}) ⇒ Object
-
#send(name, volume = 0.0) ⇒ Object
-
#solo=(value) ⇒ Object
-
#solo? ⇒ Boolean
(also: #solo)
-
#volume ⇒ Object
-
#volume=(value) ⇒ Object
#>>, #attach_destination, #attach_source, #block_time, #chain, #channel_count, #channel_count_mode, #channel_interpretation, #connect, #connected?, #default_input_channels, #default_output_channels, #destination_for_connection, #detach_all_destinations, #detach_destination, #detach_source, #disconnect, #disposed?, #fan, #get, #immediate, #input_for_index, #inputs, #mix_source_blocks, #multichannel_process?, #name, #normalize_connection_index, #normalize_output_block, #now, #number_of_inputs, #number_of_outputs, #output_for_connection, #output_for_index, #outputs, #process, #raise_connection_index_error!, #reaches_node?, #sample_time, #set, #to_destination, #to_frequency, #to_master, #to_midi, #to_output, #to_s, #to_seconds, #to_ticks, #uses_legacy_render_for_block?, #validate_connectable!, #validate_connection_index!
Constructor Details
#initialize(pan: 0.0, volume: 0.0, solo: false, muted: false, mute: nil, context: Deftones.context) ⇒ Channel
Returns a new instance of Channel.
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/deftones/component/channel.rb', line 14
def initialize(pan: 0.0, volume: 0.0, solo: false, muted: false, mute: nil, context: Deftones.context)
super(context: context)
muted = mute unless mute.nil?
@pan_vol = PanVol.new(pan: pan, volume: volume, context: context)
@solo = Solo.new(solo: solo, muted: muted, context: context)
@input = @pan_vol.input
@output = @solo
@sends = []
@pan_vol.output >> @solo
end
|
Class Attribute Details
.buses ⇒ Object
Returns the value of attribute buses.
9
10
11
|
# File 'lib/deftones/component/channel.rb', line 9
def buses
@buses
end
|
Instance Attribute Details
Returns the value of attribute input.
12
13
14
|
# File 'lib/deftones/component/channel.rb', line 12
def input
@input
end
|
#output ⇒ Object
Returns the value of attribute output.
12
13
14
|
# File 'lib/deftones/component/channel.rb', line 12
def output
@output
end
|
#pan_vol ⇒ Object
Also known as:
panVol
Returns the value of attribute pan_vol.
12
13
14
|
# File 'lib/deftones/component/channel.rb', line 12
def pan_vol
@pan_vol
end
|
Instance Method Details
#bus(name) ⇒ Object
103
104
105
106
|
# File 'lib/deftones/component/channel.rb', line 103
def bus(name)
registry = self.class.buses[context.object_id]
registry[name.to_sym] ||= Core::Gain.new(gain: 1.0, context: context)
end
|
#dispose ⇒ Object
89
90
91
92
93
94
95
|
# File 'lib/deftones/component/channel.rb', line 89
def dispose
@sends.each(&:dispose)
@sends.clear
@pan_vol.dispose
@solo.dispose
super
end
|
#mute ⇒ Object
49
50
51
|
# File 'lib/deftones/component/channel.rb', line 49
def mute
@solo.mute
end
|
#mute=(value) ⇒ Object
53
54
55
|
# File 'lib/deftones/component/channel.rb', line 53
def mute=(value)
@solo.mute = value
end
|
#mute? ⇒ Boolean
57
58
59
|
# File 'lib/deftones/component/channel.rb', line 57
def mute?
@solo.mute?
end
|
#muted ⇒ Object
Also known as:
muted?
61
62
63
|
# File 'lib/deftones/component/channel.rb', line 61
def muted
mute
end
|
#muted=(value) ⇒ Object
65
66
67
|
# File 'lib/deftones/component/channel.rb', line 65
def muted=(value)
self.mute = value
end
|
#pan ⇒ Object
33
34
35
|
# File 'lib/deftones/component/channel.rb', line 33
def pan
@pan_vol.panner.pan
end
|
#pan=(value) ⇒ Object
37
38
39
|
# File 'lib/deftones/component/channel.rb', line 37
def pan=(value)
@pan_vol.panner.pan = value
end
|
#receive(name) ⇒ Object
84
85
86
87
|
# File 'lib/deftones/component/channel.rb', line 84
def receive(name)
bus(name) >> @input
self
end
|
#render(num_frames, start_frame = 0, cache = {}) ⇒ Object
25
26
27
|
# File 'lib/deftones/component/channel.rb', line 25
def render(num_frames, start_frame = 0, cache = {})
@output.render(num_frames, start_frame, cache)
end
|
#render_block(num_frames, start_frame = 0, cache = {}) ⇒ Object
29
30
31
|
# File 'lib/deftones/component/channel.rb', line 29
def render_block(num_frames, start_frame = 0, cache = {})
@output.send(:render_block, num_frames, start_frame, cache)
end
|
#send(name, volume = 0.0) ⇒ Object
77
78
79
80
81
82
|
# File 'lib/deftones/component/channel.rb', line 77
def send(name, volume = 0.0)
send_gain = Core::Gain.new(gain: Deftones.db_to_gain(volume), context: context)
@output >> send_gain >> bus(name)
@sends << send_gain
send_gain
end
|
#solo=(value) ⇒ Object
73
74
75
|
# File 'lib/deftones/component/channel.rb', line 73
def solo=(value)
@solo.solo = value
end
|
#solo? ⇒ Boolean
Also known as:
solo
69
70
71
|
# File 'lib/deftones/component/channel.rb', line 69
def solo?
@solo.solo?
end
|
#volume ⇒ Object
41
42
43
|
# File 'lib/deftones/component/channel.rb', line 41
def volume
@pan_vol.volume.volume
end
|
#volume=(value) ⇒ Object
45
46
47
|
# File 'lib/deftones/component/channel.rb', line 45
def volume=(value)
@pan_vol.volume.volume = value
end
|