|
Vital
|
Holds and manages a buffer of samples (poly_float) for a Processor's output. More...
#include <processor.h>
Public Member Functions | |
| Output (int size=kMaxBufferSize, int max_oversample=1) | |
| Constructs an Output with a specified buffer size and oversampling factor. | |
| virtual | ~Output () |
| Virtual destructor. | |
| force_inline void | trigger (poly_mask mask, poly_float value, poly_int offset) |
| Sets trigger values (mask, trigger value, and offset). | |
| force_inline void | clearTrigger () |
| Clears the trigger mask, value, and offset. | |
| void | clearBuffer () |
| Zeros out the entire output buffer. | |
| force_inline bool | isControlRate () const |
| Checks whether this output runs at control rate (buffer_size == 1). | |
| void | ensureBufferSize (int new_max_buffer_size) |
Ensures the buffer is large enough to hold new_max_buffer_size samples. This will reallocate if necessary (unless already control rate). | |
Public Attributes | |
| poly_float * | buffer |
| Pointer to the output buffer. | |
| std::unique_ptr< poly_float[]> | owned_buffer |
| Owned memory for the output buffer. | |
| Processor * | owner |
| Owning processor. | |
| int | buffer_size |
| Current buffer size in samples. | |
| poly_mask | trigger_mask |
| Mask for triggered voices. | |
| poly_float | trigger_value |
| Trigger values for voices. | |
| poly_int | trigger_offset |
| Sample offset (per voice) for triggers. | |
Holds and manages a buffer of samples (poly_float) for a Processor's output.
This class also tracks trigger information such as trigger mask, value, and offset. It can run at audio or control rates, depending on buffer_size.
|
inline |
Constructs an Output with a specified buffer size and oversampling factor.
| size | The base number of samples in the buffer (e.g., kMaxBufferSize). |
| max_oversample | Maximum oversample factor to allocate for. |
|
inlinevirtual |
Virtual destructor.
|
inline |
Zeros out the entire output buffer.
|
inline |
Clears the trigger mask, value, and offset.
|
inline |
Ensures the buffer is large enough to hold new_max_buffer_size samples. This will reallocate if necessary (unless already control rate).
| new_max_buffer_size | The requested new buffer size. |
|
inline |
Checks whether this output runs at control rate (buffer_size == 1).
|
inline |
Sets trigger values (mask, trigger value, and offset).
| mask | The trigger mask that indicates which voices are triggering. |
| value | The trigger value for those triggered voices. |
| offset | The sample offset at which the trigger occurs. |
| poly_float* vital::Output::buffer |
Pointer to the output buffer.
| int vital::Output::buffer_size |
Current buffer size in samples.
| std::unique_ptr<poly_float[]> vital::Output::owned_buffer |
Owned memory for the output buffer.
| Processor* vital::Output::owner |
Owning processor.
| poly_mask vital::Output::trigger_mask |
Mask for triggered voices.
| poly_float vital::Output::trigger_value |
Trigger values for voices.