|
Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
|
A base class for processors in the DSP graph. More...
#include <src/dsp/processor_base.h>


Data Structures | |
| struct | ParameterChangeTracker |
| Tracks parameter value changes across processing cycles. More... | |
| struct | ProcessorBaseDependencies |
Public Member Functions | |
| ProcessorBase (ProcessorBaseDependencies dependencies, utils::Utf8String name={ u8"ProcessorBase" }) | |
| void | set_name (const utils::Utf8String &name) |
| Set a custom name to be used in the DSP graph. | |
| void | add_input_port (const dsp::PortUuidReference &uuid) |
| void | add_output_port (const dsp::PortUuidReference &uuid) |
| void | add_parameter (const dsp::ProcessorParameterUuidReference &uuid) |
| auto & | get_input_ports () const |
| auto & | get_output_ports () const |
| auto & | get_parameters () const |
| const ParameterChangeTracker & | change_tracker () const noexcept |
| Returns the change tracker. | |
| utils::Utf8String | get_node_name () const final |
| Returns a human friendly name of the node. | |
| void | process_block (dsp::graph::EngineProcessTimeInfo time_nfo, const dsp::ITransport &transport, const dsp::TempoMap &tempo_map) noexcept final |
| Calls custom_process_block() internally after processing all the parameters. | |
| void | prepare_for_processing (const graph::GraphNode *node, units::sample_rate_t sample_rate, units::sample_u32_t max_block_length) final |
| Called to allocate resources required for processing. | |
| void | release_resources () final |
| Called to release resources allocated by prepare_for_processing(). | |
| Public Member Functions inherited from zrythm::dsp::graph::IProcessable | |
| virtual units::sample_u32_t | get_single_playback_latency () const |
| Returns the latency of only the given processable, without adding the previous/next latencies (zero latency by default). | |
Protected Member Functions | |
| virtual void | custom_process_block (dsp::graph::EngineProcessTimeInfo time_nfo, const dsp::ITransport &transport, const dsp::TempoMap &tempo_map) noexcept |
| Custom processor logic after processing all owned parameters. | |
| virtual void | custom_prepare_for_processing (const graph::GraphNode *node, units::sample_rate_t sample_rate, units::sample_u32_t max_block_length) |
| virtual void | custom_release_resources () |
| auto | dependencies () const |
Friends | |
| void | to_json (nlohmann::json &j, const ProcessorBase &p) |
| void | from_json (const nlohmann::json &j, ProcessorBase &p) |
A base class for processors in the DSP graph.
Definition at line 22 of file processor_base.h.
|
inlinenoexcept |
Returns the change tracker.
Only valid to call during custom_process_block() (while is_processing_ is true).
Definition at line 138 of file processor_base.h.
|
inlineprotectedvirtual |
Definition at line 181 of file processor_base.h.
|
protectedvirtualnoexcept |
Custom processor logic after processing all owned parameters.
By default, this does passthrough to same-type ports.
Reimplemented in zrythm::dsp::AudioSampleProcessor, zrythm::dsp::Fader, zrythm::dsp::Metronome, zrythm::dsp::MidiPanicProcessor, zrythm::dsp::ModulatorMacroProcessor, zrythm::plugins::Plugin, zrythm::structure::tracks::ChannelSend, and zrythm::structure::tracks::TrackProcessor.
|
inlineprotectedvirtual |
Definition at line 188 of file processor_base.h.
|
inlineprotected |
Definition at line 190 of file processor_base.h.
|
inline |
Definition at line 128 of file processor_base.h.
|
inlinefinalvirtual |
Returns a human friendly name of the node.
Implements zrythm::dsp::graph::IProcessable.
Definition at line 148 of file processor_base.h.
|
inline |
Definition at line 129 of file processor_base.h.
|
inline |
Definition at line 130 of file processor_base.h.
|
finalvirtual |
Called to allocate resources required for processing.
| node | The node in the processing graph. Null means we are processing outside of a graph context and must be handled gracefully. |
| sample_rate | |
| max_block_length |
Reimplemented from zrythm::dsp::graph::IProcessable.
|
finalvirtualnoexcept |
Calls custom_process_block() internally after processing all the parameters.
This is done this way to make sure all parameters are processed by the owning processor as intended and to avoid mistakes by leaving it up to processor implementations to do.
Reimplemented from zrythm::dsp::graph::IProcessable.
|
finalvirtual |
Called to release resources allocated by prepare_for_processing().
This may be called multiple times.
Reimplemented from zrythm::dsp::graph::IProcessable.