The top-level namespace, contains all things plugin-related.
template<marvin::FloatType SampleType>
void mostly_harmless::runBlockDispatch |
( |
marvin::containers::BufferView< SampleType > | buffer, |
|
|
mostly_harmless::events::InputEventContext | eventContext, |
|
|
std::function< void(const clap_event_header *event)> && | eventCallback, |
|
|
std::function< void(marvin::containers::BufferView< SampleType >)> && | blockCallback ) |
Splits an input buffer into chunks and dispatches them, allowing for block based processing.
As parameter and note events are sample accurate, and passed via a single queue, naively doing block based processing with the entire input buffer would mean only having one param / note update event per block. To get around this, this function handles chunking the audio between events, and calling some process function with that chunk. For example:
[this](const clap_event_header* event) -> void {
handleEvent(event);
},
[this](marvin::containers::BufferView<float> chunk) -> void {
m_processor.process(chunk);
}
);
}
void runBlockDispatch(marvin::containers::BufferView< SampleType > buffer, mostly_harmless::events::InputEventContext eventContext, std::function< void(const clap_event_header *event)> &&eventCallback, std::function< void(marvin::containers::BufferView< SampleType >)> &&blockCallback)
Splits an input buffer into chunks and dispatches them, allowing for block based processing.
Definition mostlyharmless_AudioHelpers.h:37
Trivially copyable wrapper around the clap-api provided clap_input_events queue, for easier iterating...
Definition mostlyharmless_InputEventContext.h:9
- Parameters
-
buffer | The entire buffer for this block |
eventCallback | The input event queue for this block. |
eventCallback | A callback to invoke on a new event. |
blockCallback | A callback to invoke on a new chunk. |