Class: Beeps::Processor
- Inherits:
-
Object
- Object
- Beeps::Processor
- Includes:
- Xot::Hookable, Xot::Setter
- Defined in:
- lib/beeps/processor.rb
Class Method Summary collapse
-
.get_signals(processor, seconds: 1, nchannels: 1, sample_rate: 0) ⇒ Object
def <<(processors) self.add_input(*processors) self end.
Instance Method Summary collapse
- #>>(processor) ⇒ Object
- #add_input(*inputs) ⇒ Object
-
#initialize(*inputs, **options, &block) ⇒ Processor
constructor
A new instance of Processor.
Constructor Details
#initialize(*inputs, **options, &block) ⇒ Processor
Returns a new instance of Processor.
17 18 19 20 21 22 |
# File 'lib/beeps/processor.rb', line 17 def initialize(*inputs, **, &block) super() add_input(*inputs) set unless .empty? Xot::BlockUtil.instance_eval_or_block_call self, &block if block end |
Class Method Details
.get_signals(processor, seconds: 1, nchannels: 1, sample_rate: 0) ⇒ Object
def <<(processors)
self.add_input(*processors)
self
end
41 42 43 |
# File 'lib/beeps/processor.rb', line 41 def self.get_signals(processor, seconds: 1, nchannels: 1, sample_rate: 0) get_signals! processor, seconds, nchannels, sample_rate end |
Instance Method Details
#>>(processor) ⇒ Object
31 32 33 34 |
# File 'lib/beeps/processor.rb', line 31 def >>(processor) processor.add_input self processor end |
#add_input(*inputs) ⇒ Object
26 27 28 29 |
# File 'lib/beeps/processor.rb', line 26 def add_input(*inputs) last = inputs.flatten.compact.last self.input = last if last end |