Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::engine::session::MidiMappings Class Referencefinal

All MIDI mappings in Zrythm. More...

#include <src/engine/session/midi_mapping.h>

Public Member Functions

void init_loaded ()
 
void bind_at (std::array< midi_byte_t, 3 > buf, std::optional< utils::Utf8String > device_id, Port &dest_port, int idx, bool fire_events)
 Binds the CC represented by the given raw buffer (must be size 3) to the given Port.
 
void unbind (int idx, bool fire_events)
 Unbinds the given binding.
 
void bind_device (std::array< midi_byte_t, 3 > buf, std::optional< utils::Utf8String > device_id, Port &dest_port, bool fire_events)
 
void bind_track (std::array< midi_byte_t, 3 > buf, Port &dest_port, bool fire_events)
 
int get_mapping_index (const MidiMapping &mapping) const
 
void apply_from_cc_events (dsp::MidiEventVector &events)
 Applies the events to the appropriate mapping.
 
void apply (const midi_byte_t *buf)
 Applies the given buffer to the matching ports.
 
int get_for_port (const Port &dest_port, std::vector< MidiMapping * > *arr) const
 Get MIDI mappings for the given port.
 

Data Fields

std::vector< std::unique_ptr< MidiMapping > > mappings_
 

Friends

void init_from (MidiMappings &obj, const MidiMappings &other, utils::ObjectCloneType clone_type)
 
void to_json (nlohmann::json &j, const MidiMappings &mappings)
 
void from_json (const nlohmann::json &j, MidiMappings &mappings)
 

Detailed Description

All MIDI mappings in Zrythm.

Definition at line 87 of file midi_mapping.h.

Member Function Documentation

◆ apply_from_cc_events()

void zrythm::engine::session::MidiMappings::apply_from_cc_events ( dsp::MidiEventVector & events)

Applies the events to the appropriate mapping.

This is used only for TrackProcessor.cc_mappings.

Note
Must only be called while transport is recording.

◆ bind_at()

void zrythm::engine::session::MidiMappings::bind_at ( std::array< midi_byte_t, 3 > buf,
std::optional< utils::Utf8String > device_id,
Port & dest_port,
int idx,
bool fire_events )

Binds the CC represented by the given raw buffer (must be size 3) to the given Port.

Parameters
idxIndex to insert at.
bufThe buffer used for matching at [0] and [1].
device_idDevice ID, if custom mapping.

◆ bind_device()

void zrythm::engine::session::MidiMappings::bind_device ( std::array< midi_byte_t, 3 > buf,
std::optional< utils::Utf8String > device_id,
Port & dest_port,
bool fire_events )
inline

Definition at line 115 of file midi_mapping.h.

◆ bind_track()

void zrythm::engine::session::MidiMappings::bind_track ( std::array< midi_byte_t, 3 > buf,
Port & dest_port,
bool fire_events )
inline

Definition at line 127 of file midi_mapping.h.

◆ get_for_port()

int zrythm::engine::session::MidiMappings::get_for_port ( const Port & dest_port,
std::vector< MidiMapping * > * arr ) const

Get MIDI mappings for the given port.

Parameters
arrOptional array to fill with the mappings.
Returns
The number of results.

◆ unbind()

void zrythm::engine::session::MidiMappings::unbind ( int idx,
bool fire_events )

Unbinds the given binding.

Note
This must be called inside a port operation lock, such as inside an undoable action.

Friends And Related Symbol Documentation

◆ init_from

void init_from ( MidiMappings & obj,
const MidiMappings & other,
utils::ObjectCloneType clone_type )
friend

Definition at line 160 of file midi_mapping.h.

◆ to_json

void to_json ( nlohmann::json & j,
const MidiMappings & mappings )
friend

Definition at line 171 of file midi_mapping.h.

Field Documentation

◆ mappings_

std::vector<std::unique_ptr<MidiMapping> > zrythm::engine::session::MidiMappings::mappings_

Definition at line 178 of file midi_mapping.h.


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