Class: Deftones::Component::Solo

Inherits:
Deftones::Core::AudioNode show all
Defined in:
lib/deftones/component/solo.rb

Class Attribute Summary collapse

Instance Attribute Summary collapse

Attributes inherited from Deftones::Core::AudioNode

#context, #input

Instance Method Summary collapse

Methods inherited from Deftones::Core::AudioNode

#>>, #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, #name, #normalize_connection_index, #normalize_output_block, #now, #number_of_inputs, #number_of_outputs, #output, #output_for_connection, #output_for_index, #outputs, #raise_connection_index_error!, #reaches_node?, #render, #render_block, #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(solo: false, muted: false, context: Deftones.context) ⇒ Solo

Returns a new instance of Solo.



14
15
16
17
18
19
# File 'lib/deftones/component/solo.rb', line 14

def initialize(solo: false, muted: false, context: Deftones.context)
  super(context: context)
  @solo = solo
  @muted = muted
  self.class.instances << self
end

Class Attribute Details

.instancesObject (readonly)

Returns the value of attribute instances.



9
10
11
# File 'lib/deftones/component/solo.rb', line 9

def instances
  @instances
end

Instance Attribute Details

#mutedObject

Returns the value of attribute muted.



12
13
14
# File 'lib/deftones/component/solo.rb', line 12

def muted
  @muted
end

Instance Method Details

#disposeObject



37
38
39
40
# File 'lib/deftones/component/solo.rb', line 37

def dispose
  self.class.instances.delete(self)
  super
end

#multichannel_process?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/deftones/component/solo.rb', line 42

def multichannel_process?
  true
end

#muteObject Also known as: mute?



29
30
31
# File 'lib/deftones/component/solo.rb', line 29

def mute
  @muted
end

#mute=(value) ⇒ Object



33
34
35
# File 'lib/deftones/component/solo.rb', line 33

def mute=(value)
  @muted = !!value
end

#process(input_block, num_frames, _start_frame, _cache) ⇒ Object



46
47
48
49
50
51
# File 'lib/deftones/component/solo.rb', line 46

def process(input_block, num_frames, _start_frame, _cache)
  return Core::AudioBlock.silent(num_frames, input_block.channels) if @muted
  return input_block.dup unless self.class.instances.any?(&:solo?)

  @solo ? input_block.dup : Core::AudioBlock.silent(num_frames, input_block.channels)
end

#solo=(value) ⇒ Object



25
26
27
# File 'lib/deftones/component/solo.rb', line 25

def solo=(value)
  @solo = !!value
end

#solo?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/deftones/component/solo.rb', line 21

def solo?
  @solo
end