Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
HardwareProcessor Class Referencefinal

Hardware processor. More...

#include <src/gui/dsp/hardware_processor.h>

Inheritance diagram for HardwareProcessor:
Collaboration diagram for HardwareProcessor:

Public Types

using PortFlow = zrythm::dsp::PortFlow
 

Public Member Functions

 HardwareProcessor (bool input, AudioEngine *engine)
 
void init_loaded (AudioEngine *engine)
 
bool is_in_active_project () const
 
void rescan_ext_ports ()
 Rescans the hardware ports and appends any missing ones.
 
ExtPortfind_ext_port (const utils::Utf8String &id)
 Finds an ext port from its ID (type + full name).
 
template<typename T = Port>
T * find_port (const utils::Utf8String &id)
 Finds a port from its ID (type + full name).
 
void setup ()
 Sets up the ports but does not start them.
 
void activate (bool activate)
 Starts or stops the ports.
 
void process (nframes_t nframes)
 Processes the data.
 
utils::Utf8String get_node_name () const override
 Returns a human friendly name of the node.
 
void init_after_cloning (const HardwareProcessor &other, ObjectCloneType clone_type) override
 To be used during serialization.
 
- Public Member Functions inherited from ICloneable< HardwareProcessor >
std::unique_ptr< HardwareProcessorclone_unique (ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) const
 
std::shared_ptr< HardwareProcessorclone_shared (ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) const
 
HardwareProcessorclone_raw_ptr (ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) const
 
HardwareProcessorclone_qobject (QObject *parent, ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) const
 
QScopedPointer< HardwareProcessorclone_unique_qobject (QObject *parent, ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) const
 
- Public Member Functions inherited from zrythm::dsp::graph::IProcessable
virtual nframes_t get_single_playback_latency () const
 Returns the latency of only the given processable, without adding the previous/next latencies.
 
virtual void process_block (EngineProcessTimeInfo time_nfo)
 
virtual void clear_external_buffer (nframes_t block_length)
 
virtual bool needs_external_buffer_clear_on_early_return () const
 

Data Fields

bool is_input_ = false
 Whether this is the processor at the start of the graph (input) or at the end (output).
 
std::vector< utils::Utf8Stringselected_midi_ports_
 Ports selected by the user in the preferences to enable.
 
std::vector< utils::Utf8Stringselected_audio_ports_
 
std::vector< std::unique_ptr< ExtPort > > ext_audio_ports_
 All known external ports.
 
std::vector< std::unique_ptr< ExtPort > > ext_midi_ports_
 
std::vector< std::unique_ptr< AudioPort > > audio_ports_
 Ports to be used by Zrythm, corresponding to the external ports.
 
std::vector< std::unique_ptr< MidiPort > > midi_ports_
 
bool setup_ = false
 Whether set up already.
 
bool activated_ = false
 Whether currently active.
 
quint64 rescan_timeout_id_ = 0
 
AudioEngineengine_ = nullptr
 Pointer to owner engine, if any.
 
- Data Fields inherited from ICloneable< HardwareProcessor >
friend Derived
 

Friends

void to_json (nlohmann::json &j, const HardwareProcessor &p)
 
void from_json (const nlohmann::json &j, HardwareProcessor &p)
 

Detailed Description

Hardware processor.

Definition at line 23 of file hardware_processor.h.

Member Typedef Documentation

◆ PortFlow

using HardwareProcessor::PortFlow = zrythm::dsp::PortFlow

Definition at line 28 of file hardware_processor.h.

Member Function Documentation

◆ activate()

void HardwareProcessor::activate ( bool activate)

Starts or stops the ports.

Parameters
activateTrue to activate, false to deactivate

◆ find_ext_port()

ExtPort * HardwareProcessor::find_ext_port ( const utils::Utf8String & id)

Finds an ext port from its ID (type + full name).

See also
ExtPort.get_id()

◆ get_node_name()

utils::Utf8String HardwareProcessor::get_node_name ( ) const
overridevirtual

Returns a human friendly name of the node.

Implements zrythm::dsp::graph::IProcessable.

◆ init_after_cloning()

void HardwareProcessor::init_after_cloning ( const HardwareProcessor & other,
ObjectCloneType clone_type )
overridevirtual

To be used during serialization.

Implements ICloneable< HardwareProcessor >.

◆ rescan_ext_ports()

void HardwareProcessor::rescan_ext_ports ( )

Rescans the hardware ports and appends any missing ones.

Note
This was a GSource callback.

Friends And Related Symbol Documentation

◆ to_json

void to_json ( nlohmann::json & j,
const HardwareProcessor & p )
friend

Definition at line 93 of file hardware_processor.h.

Field Documentation

◆ activated_

bool HardwareProcessor::activated_ = false

Whether currently active.

Definition at line 142 of file hardware_processor.h.

◆ audio_ports_

std::vector<std::unique_ptr<AudioPort> > HardwareProcessor::audio_ports_

Ports to be used by Zrythm, corresponding to the external ports.

Definition at line 135 of file hardware_processor.h.

◆ engine_

AudioEngine* HardwareProcessor::engine_ = nullptr

Pointer to owner engine, if any.

Definition at line 147 of file hardware_processor.h.

◆ ext_audio_ports_

std::vector<std::unique_ptr<ExtPort> > HardwareProcessor::ext_audio_ports_

All known external ports.

Definition at line 129 of file hardware_processor.h.

◆ ext_midi_ports_

std::vector<std::unique_ptr<ExtPort> > HardwareProcessor::ext_midi_ports_

Definition at line 130 of file hardware_processor.h.

◆ is_input_

bool HardwareProcessor::is_input_ = false

Whether this is the processor at the start of the graph (input) or at the end (output).

Definition at line 114 of file hardware_processor.h.

◆ midi_ports_

std::vector<std::unique_ptr<MidiPort> > HardwareProcessor::midi_ports_

Definition at line 136 of file hardware_processor.h.

◆ rescan_timeout_id_

quint64 HardwareProcessor::rescan_timeout_id_ = 0

Definition at line 144 of file hardware_processor.h.

◆ selected_audio_ports_

std::vector<utils::Utf8String> HardwareProcessor::selected_audio_ports_

Definition at line 124 of file hardware_processor.h.

◆ selected_midi_ports_

std::vector<utils::Utf8String> HardwareProcessor::selected_midi_ports_

Ports selected by the user in the preferences to enable.

To be cached at startup (need restart for changes to take effect).

This is only for inputs.

Definition at line 123 of file hardware_processor.h.

◆ setup_

bool HardwareProcessor::setup_ = false

Whether set up already.

Definition at line 139 of file hardware_processor.h.


The documentation for this class was generated from the following file: