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

Action for chord pad changes. More...

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

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

Public Types

enum class  Type { Single , All }
 Type of chord action. More...
using ChordDescriptor = dsp::ChordDescriptor
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

 ChordAction (QObject *parent=nullptr)
 ChordAction (const std::vector< ChordDescriptor > &chords_before, const std::vector< ChordDescriptor > &chords_after, QObject *parent=nullptr)
 Creates a new action for changing all chords.
 ChordAction (const ChordDescriptor &chord, int chord_idx, QObject *parent=nullptr)
 Creates a new action for changing a single chord.
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, 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

Type type_ = (Type) 0
ChordDescriptor chord_before_
ChordDescriptor chord_after_
int chord_idx_ = 0
std::vector< ChordDescriptor > chords_before_
 Chords before the change.
std::vector< ChordDescriptor > chords_after_
 Chords after the change.
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.
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 (ChordAction &obj, const ChordAction &other, utils::ObjectCloneType clone_type)

Detailed Description

Action for chord pad changes.

Definition at line 15 of file chord_action.h.

Member Typedef Documentation

◆ ChordDescriptor

using zrythm::gui::actions::ChordAction::ChordDescriptor = dsp::ChordDescriptor

Definition at line 22 of file chord_action.h.

Member Enumeration Documentation

◆ Type

Type of chord action.

Enumerator
Single 

Change single chord.

All 

Change all chords.

Definition at line 27 of file chord_action.h.

Constructor & Destructor Documentation

◆ ChordAction() [1/2]

zrythm::gui::actions::ChordAction::ChordAction ( const std::vector< ChordDescriptor > & chords_before,
const std::vector< ChordDescriptor > & chords_after,
QObject * parent = nullptr )

Creates a new action for changing all chords.

Parameters
chords_beforeChords before the action.
chords_afterChords after the action.

◆ ChordAction() [2/2]

zrythm::gui::actions::ChordAction::ChordAction ( const ChordDescriptor & chord,
int chord_idx,
QObject * parent = nullptr )

Creates a new action for changing a single chord.

Parameters
chordChord after the change.
chord_idxIndex of the chord to change.

Member Function Documentation

◆ to_string()

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

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

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

Field Documentation

◆ chord_after_

ChordDescriptor zrythm::gui::actions::ChordAction::chord_after_

Definition at line 80 of file chord_action.h.

◆ chord_before_

ChordDescriptor zrythm::gui::actions::ChordAction::chord_before_

Definition at line 79 of file chord_action.h.

◆ chord_idx_

int zrythm::gui::actions::ChordAction::chord_idx_ = 0

Definition at line 81 of file chord_action.h.

◆ chords_after_

std::vector<ChordDescriptor> zrythm::gui::actions::ChordAction::chords_after_

Chords after the change.

Definition at line 87 of file chord_action.h.

◆ chords_before_

std::vector<ChordDescriptor> zrythm::gui::actions::ChordAction::chords_before_

Chords before the change.

Definition at line 84 of file chord_action.h.

◆ type_

Type zrythm::gui::actions::ChordAction::type_ = (Type) 0

Definition at line 77 of file chord_action.h.


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