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

Data Structures

struct  FrameRange
 Frame range to operate on (on both the port's buffers and the backend's buffers). More...
 

Public Types

using MidiEventFilter = std::function<bool (const dsp::MidiEvent &)>
 Function used to filter MIDI events.
 
using PortDesignationProvider = std::function<utils::Utf8String ()>
 

Public Member Functions

virtual void sum_audio_data (float *buf, FrameRange range)
 Sums the inputs coming in from the backend, before the port is processed.
 
virtual void sum_midi_data (dsp::MidiEvents &midi_events, FrameRange range, MidiEventFilter filter_func=[](const auto &) { return true;})
 
virtual void send_data (const float *buf, FrameRange range)
 Sends the port data to the backend, after the port is processed.
 
virtual void send_data (const dsp::MidiEvents &midi_events, FrameRange range)
 
virtual void expose (const dsp::PortIdentifier &id, PortDesignationProvider designation_provider)=0
 Exposes the port to the backend, if not already exposed.
 
virtual void unexpose ()=0
 Unexposes the port from the backend (if exposed).
 
virtual void clear_backend_buffer (dsp::PortType type, nframes_t nframes)=0
 
virtual bool is_exposed () const =0
 

Detailed Description

Definition at line 19 of file port_backend.h.

Member Typedef Documentation

◆ MidiEventFilter

using PortBackend::MidiEventFilter = std::function<bool (const dsp::MidiEvent &)>

Function used to filter MIDI events.

Definition at line 37 of file port_backend.h.

◆ PortDesignationProvider

using PortBackend::PortDesignationProvider = std::function<utils::Utf8String ()>

Definition at line 39 of file port_backend.h.

Member Function Documentation

◆ expose()

virtual void PortBackend::expose ( const dsp::PortIdentifier & id,
PortDesignationProvider designation_provider )
pure virtual

Exposes the port to the backend, if not already exposed.

If already exposed, updates any metadata if necessary.

◆ send_data() [1/2]

virtual void PortBackend::send_data ( const dsp::MidiEvents & midi_events,
FrameRange range )
inlinevirtual

Definition at line 65 of file port_backend.h.

◆ send_data() [2/2]

virtual void PortBackend::send_data ( const float * buf,
FrameRange range )
inlinevirtual

Sends the port data to the backend, after the port is processed.

Definition at line 64 of file port_backend.h.

◆ sum_audio_data()

virtual void PortBackend::sum_audio_data ( float * buf,
FrameRange range )
inlinevirtual

Sums the inputs coming in from the backend, before the port is processed.

Parameters
bufThe buffer to sum into.

Definition at line 46 of file port_backend.h.

◆ sum_midi_data()

virtual void PortBackend::sum_midi_data ( dsp::MidiEvents & midi_events,
FrameRange range,
MidiEventFilter filter_func = [] (const auto &) { return true; } )
inlinevirtual
Note
MIDI timings are assumed to be at the correct positions in the current cycle (ie, already added the start_frames in this cycle).

Definition at line 54 of file port_backend.h.


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