Vital
Loading...
Searching...
No Matches
value_switch.h
Go to the documentation of this file.
1
6#pragma once
7
8#include "value.h"
9
10namespace vital {
11
28 class ValueSwitch : public cr::Value {
29 public:
34 enum {
38 };
39
45
50 virtual Processor* clone() const override { return new ValueSwitch(*this); }
51
57 virtual void process(int num_samples) override { }
58
63 virtual void set(poly_float value) override;
64
69 void addProcessor(Processor* processor) { processors_.push_back(processor); }
70
75 virtual void setOversampleAmount(int oversample) override;
76
77 private:
82 void setBuffer(int source);
83
88 void setSource(int source);
89
91 std::vector<Processor*> processors_;
92
93 JUCE_LEAK_DETECTOR(ValueSwitch)
94 };
95} // namespace vital
Base class for all signal-processing units in Vital.
Definition processor.h:212
force_inline mono_float value() const
Returns the current mono_float value of the first lane.
Definition value.h:60
A specialized Value processor that selects one of multiple input sources to pass through,...
Definition value_switch.h:28
virtual Processor * clone() const override
Clones this ValueSwitch processor.
Definition value_switch.h:50
void addProcessor(Processor *processor)
Adds a processor to be enabled or disabled depending on the selected source.
Definition value_switch.h:69
ValueSwitch(mono_float value=0.0f)
Constructs a new ValueSwitch with an initial value.
Definition value_switch.cpp:11
virtual void process(int num_samples) override
Processes the value switch. In this case, processing is not sample-based, so this function does nothi...
Definition value_switch.h:57
@ kNumOutputs
Definition value_switch.h:37
@ kValue
The control value output (original from Value).
Definition value_switch.h:35
@ kSwitch
The selected input signal output.
Definition value_switch.h:36
virtual void setOversampleAmount(int oversample) override
Sets the oversampling amount for this ValueSwitch and all connected sources.
Definition value_switch.cpp:27
virtual void set(poly_float value) override
Sets the control value, selecting the corresponding input as the output.
Definition value_switch.cpp:21
A control-rate variant of the Value processor.
Definition value.h:82
Contains classes and functions used within the Vital synthesizer framework.
float mono_float
Definition common.h:33
Represents a vector of floating-point values using SIMD instructions.
Definition poly_values.h:600
Declares Value processors that output a constant value and can be dynamically set.