Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::gui::actions::MidiMappingAction Class Reference

MIDI mapping action. More...

#include <src/gui/backend/backend/legacy_actions/midi_mapping_action.h>

Inheritance diagram for zrythm::gui::actions::MidiMappingAction:
Collaboration diagram for zrythm::gui::actions::MidiMappingAction:

Public Types

enum class  Type { Bind , Unbind , Enable , Disable }
Public Types inherited from zrythm::gui::actions::UndoableAction
enum class  Type {
  TracklistSelections , ChannelSend , MixerSelections , ArrangerSelections ,
  MidiMapping , PortConnection , Port , Range ,
  Transport , Chord
}
 Type of UndoableAction. More...
using PortConnectionsManager = dsp::PortConnectionsManager

Public Member Functions

 MidiMappingAction (QObject *parent=nullptr)
 MidiMappingAction (int idx_to_enable_or_disable, bool enable)
 Create a new action for enabling/disabling a MIDI mapping.
 MidiMappingAction (int idx_to_unbind)
 Construct a new action for unbinding a MIDI mapping.
 MidiMappingAction (std::array< midi_byte_t, 3 > buf, std::optional< utils::Utf8String > device_id, const dsp::ProcessorParameter &dest_port)
 Construct a new action for binding a MIDI mapping.
QString to_string () const override
 Stringizes the action to be used in Undo/Redo buttons.
Public Member Functions inherited from zrythm::gui::actions::UndoableAction
 UndoableAction (Type type)
 UndoableAction (Type type, dsp::FramesPerTick frames_per_tick, units::sample_rate_t sample_rate)
void init_loaded (sample_rate_t engine_sample_rate)
 Non virtual function following the NVI pattern.
virtual bool needs_pause () const
 Returns whether the action requires pausing the engine.
virtual bool needs_transport_total_bar_update (bool perform) const
 Returns whether the total transport bars need to be recalculated.
virtual bool affects_audio_region_internal_positions () const
 Whether audio region loop/fade/etc.
virtual void get_plugins (std::vector< plugins::Plugin * > &plugins)
 Get the plugins referenced in this action.
auto get_frames_per_tick () const
auto get_ticks_per_frame () const
void set_num_actions (int num_actions)
 Sets the number of actions for this action.
void save_or_load_port_connections (bool performing)
 To be used by actions that save/load port connections.
void perform ()
 Performs the action.
void undo ()
 Undoes the action.

Data Fields

int idx_ = -1
 Index of mapping, if enable/disable.
Type type_ {}
 Action type.
std::optional< dsp::ProcessorParameter::Uuid > dest_port_id_
std::optional< utils::Utf8Stringdev_id_
std::array< midi_byte_t, 3 > buf_ {}
Data Fields inherited from zrythm::gui::actions::UndoableAction
Type undoable_action_type_ {}
 Undoable action type.
dsp::FramesPerTick frames_per_tick_
 A snapshot of AudioEngine.frames_per_tick when the action is executed.
units::sample_rate_t sample_rate_ = 0
 Sample rate of this action.
int num_actions_ = 1
 Number of actions to perform.
std::unique_ptr< dsp::PortConnectionsManagerport_connections_before_
 An (optional) clone of the port connections at the start of the action, used for reverting port connections when undoing.
std::unique_ptr< dsp::PortConnectionsManagerport_connections_after_

Friends

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

Detailed Description

MIDI mapping action.

Definition at line 17 of file midi_mapping_action.h.

Member Enumeration Documentation

◆ Type

enum class zrythm::gui::actions::MidiMappingAction::Type
strong

Definition at line 24 of file midi_mapping_action.h.

Constructor & Destructor Documentation

◆ MidiMappingAction() [1/2]

zrythm::gui::actions::MidiMappingAction::MidiMappingAction ( int idx_to_enable_or_disable,
bool enable )

Create a new action for enabling/disabling a MIDI mapping.

Parameters
enable

◆ MidiMappingAction() [2/2]

zrythm::gui::actions::MidiMappingAction::MidiMappingAction ( std::array< midi_byte_t, 3 > buf,
std::optional< utils::Utf8String > device_id,
const dsp::ProcessorParameter & dest_port )

Construct a new action for binding a MIDI mapping.

Parameters
buf
device_id
dest_port

Member Function Documentation

◆ to_string()

QString zrythm::gui::actions::MidiMappingAction::to_string ( ) const
overridevirtual

Stringizes the action to be used in Undo/Redo buttons.

Implements zrythm::gui::actions::UndoableAction.

Field Documentation

◆ buf_

std::array<midi_byte_t, 3> zrythm::gui::actions::MidiMappingAction::buf_ {}

Definition at line 84 of file midi_mapping_action.h.

◆ dest_port_id_

std::optional<dsp::ProcessorParameter::Uuid> zrythm::gui::actions::MidiMappingAction::dest_port_id_

Definition at line 80 of file midi_mapping_action.h.

◆ dev_id_

std::optional<utils::Utf8String> zrythm::gui::actions::MidiMappingAction::dev_id_

Definition at line 82 of file midi_mapping_action.h.

◆ idx_

int zrythm::gui::actions::MidiMappingAction::idx_ = -1

Index of mapping, if enable/disable.

Definition at line 75 of file midi_mapping_action.h.

◆ type_

Type zrythm::gui::actions::MidiMappingAction::type_ {}

Action type.

Definition at line 78 of file midi_mapping_action.h.


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