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

All MIDI mappings in Zrythm. More...

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

Inheritance diagram for MidiMappings:
Collaboration diagram for MidiMappings:

Public Member Functions

void init_loaded ()
 
void bind_at (std::array< midi_byte_t, 3 > buf, ExtPort *device_port, 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, ExtPort *dev_port, 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.
 
void init_after_cloning (const MidiMappings &other, ObjectCloneType clone_type) override
 Initializes the cloned object.
 
- Public Member Functions inherited from ICloneable< MidiMappings >
std::unique_ptr< MidiMappingsclone_unique (ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) const
 
std::shared_ptr< MidiMappingsclone_shared (ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) const
 
MidiMappingsclone_raw_ptr (ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) const
 
MidiMappingsclone_qobject (QObject *parent, ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) const
 
QScopedPointer< MidiMappingsclone_unique_qobject (QObject *parent, ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) const
 

Data Fields

std::vector< std::unique_ptr< MidiMapping > > mappings_
 
- Data Fields inherited from ICloneable< MidiMappings >
friend Derived
 

Friends

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 88 of file midi_mapping.h.

Member Function Documentation

◆ apply_from_cc_events()

void 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 MidiMappings::bind_at ( std::array< midi_byte_t, 3 > buf,
ExtPort * device_port,
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_portDevice port, if custom mapping.

◆ bind_device()

void MidiMappings::bind_device ( std::array< midi_byte_t, 3 > buf,
ExtPort * dev_port,
Port & dest_port,
bool fire_events )
inline

Definition at line 116 of file midi_mapping.h.

◆ bind_track()

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

Definition at line 128 of file midi_mapping.h.

◆ get_for_port()

int 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.

◆ init_after_cloning()

void MidiMappings::init_after_cloning ( const MidiMappings & other,
ObjectCloneType clone_type )
inlineoverridevirtual

Initializes the cloned object.

Note
Only final classes should implement this.
Exceptions
ZrythmExceptionIf the object could not be cloned.

Implements ICloneable< MidiMappings >.

Definition at line 162 of file midi_mapping.h.

◆ unbind()

void 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

◆ to_json

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

Definition at line 170 of file midi_mapping.h.

Field Documentation

◆ mappings_

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

Definition at line 177 of file midi_mapping.h.


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