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

An action that performs changes to the arranger selections. More...

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

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

Data Structures

class  RecordAction
class  MoveOrDuplicateAction
class  MoveOrDuplicateTimelineAction
class  MoveOrDuplicateMidiAction
class  MoveOrDuplicateChordAction
class  MoveOrDuplicateAutomationAction
class  MoveMidiAction
class  MoveChordAction
class  LinkAction
class  AutomationFillAction
class  SplitAction
class  MergeAction
class  ResizeAction
class  QuantizeAction

Public Types

enum class  Type {
  AutomationFill , Create , Delete , Duplicate ,
  Edit , Link , Merge , Move ,
  Quantize , Record , Resize , Split
}
enum class  ResizeType {
  L , R , LLoop , RLoop ,
  LFade , RFade , LStretch , RStretch
}
 Type used when the action is a RESIZE action. More...
enum class  EditType {
  Name , Position , Primitive , Scale ,
  Fades , Mute , EditorFunction
}
 Type used when the action is an EDIT action. More...
using Position = zrythm::dsp::Position
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

ArrangerObjectRegistry & get_arranger_object_registry () const
bool needs_transport_total_bar_update (bool perform) const override
 Returns whether the total transport bars need to be recalculated.
bool needs_pause () const override
 Returns whether the action requires pausing the engine.
QString to_string () const final
 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 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_ {}
 Action type.
std::optional< std::vector< ArrangerObjectPtrVariant > > sel_
 A clone of the ArrangerSelections before the change.
std::optional< std::vector< ArrangerObjectPtrVariant > > sel_after_
 A clone of the ArrangerSelections after the change (used in the EDIT action and quantize).
EditType edit_type_ {}
 Type of edit action, if an Edit action.
double ticks_ {}
 Ticks diff.
int delta_tracks_ {}
 Tracks moved.
int delta_lanes_ {}
 Lanes moved.
int delta_chords_ = 0
 Chords moved (up/down in the Chord editor).
int delta_pitch_ = 0
 Delta of MidiNote pitch.
int delta_vel_ = 0
 Delta of MidiNote velocity.
double delta_normalized_amount_ = 0.0
 Difference in a normalized amount, such as automation point normalized value.
std::optional< std::pair< Position, Position > > selected_positions_in_audio_editor_
std::optional< ArrangerObject::Uuidclip_editor_region_id_
 Clip editor region ID (for non-timeline actions).
std::optional< dsp::PortUuid > target_port_
 Target port (used to find corresponding automation track when moving/copying automation regions to another automation track/another track).
utils::Utf8String str_
 String, when changing a string.
Position pos_
 Position, when changing a Position.
std::vector< ArrangerObject::Uuidr1_
 Used when splitting - these are the split BoundedObject's.
std::vector< ArrangerObject::Uuidr2_
bool first_run_ = false
 Number of split objects.
std::unique_ptr< gui::old_dsp::QuantizeOptionsopts_ {}
 QuantizeOptions clone, if quantizing.
std::optional< ArrangerObjectPtrVariant > region_before_
 Used for automation autofill action.
std::optional< ArrangerObjectPtrVariant > region_after_
ResizeType resize_type_ = (ResizeType) 0
 Used by the resize action.
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_

Protected Member Functions

 ArrangerSelectionsAction (ArrangerObjectSpan before_sel, Type type)
 Generic constructor to be used by others.
void set_before_selections (ArrangerObjectSpan src_var)
 Sets sel_ to a clone of src.
void set_after_selections (ArrangerObjectSpan src_var)
 Sets sel_after_ to a clone of src.

Friends

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

Detailed Description

An action that performs changes to the arranger selections.

This class represents an undoable action that can be performed on the arranger selections, such as creating, deleting, moving, or resizing selected objects.

The action has a Type enum that specifies the type of action being performed, such as Create, Delete, Move, or Resize. For Resize actions, there is a ResizeType enum that specifies the type of resize operation. For Edit actions, there is an EditType enum that specifies the type of edit operation, such as changing the name or position of the selected objects.

Definition at line 29 of file arranger_selections_action.h.

Member Typedef Documentation

◆ Position

using zrythm::gui::actions::ArrangerSelectionsAction::Position = zrythm::dsp::Position

Definition at line 115 of file arranger_selections_action.h.

Member Enumeration Documentation

◆ EditType

Type used when the action is an EDIT action.

Enumerator
Name 

Edit the name of objects in the selection.

Position 

Edit a Position of objects in the selection.

This will just set all of the positions on the object.

Primitive 

Edit a primitive (int, etc) member of objects in the selection.

This will simply set all relevant primitive values in an ArrangerObject when doing/undoing.

Scale 

For editing the MusicalScale inside ScaleObjects.

Fades 

Editing fade positions or curve options.

Mute 

Change mute status.

EditorFunction 

For ramping MidiNote velocities or AutomationPoint values.

(this is handled by EDIT_PRIMITIVE) MIDI function.

Definition at line 78 of file arranger_selections_action.h.

◆ ResizeType

Type used when the action is a RESIZE action.

Definition at line 63 of file arranger_selections_action.h.

◆ Type

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

Definition at line 44 of file arranger_selections_action.h.

Constructor & Destructor Documentation

◆ ArrangerSelectionsAction()

zrythm::gui::actions::ArrangerSelectionsAction::ArrangerSelectionsAction ( ArrangerObjectSpan before_sel,
Type type )
inlineprotected

Generic constructor to be used by others.

Internally calls set_before_selections().

Parameters
before_selSelections before the change.

Definition at line 162 of file arranger_selections_action.h.

Member Function Documentation

◆ needs_pause()

bool zrythm::gui::actions::ArrangerSelectionsAction::needs_pause ( ) const
inlineoverridevirtual

Returns whether the action requires pausing the engine.

Reimplemented from zrythm::gui::actions::UndoableAction.

Definition at line 146 of file arranger_selections_action.h.

◆ needs_transport_total_bar_update()

bool zrythm::gui::actions::ArrangerSelectionsAction::needs_transport_total_bar_update ( bool perform) const
overridevirtual

Returns whether the total transport bars need to be recalculated.

Note
Some actions already handle this logic so return false here to avoid unnecessary calculations.

Reimplemented from zrythm::gui::actions::UndoableAction.

◆ set_after_selections()

void zrythm::gui::actions::ArrangerSelectionsAction::set_after_selections ( ArrangerObjectSpan src_var)
protected

Sets sel_after_ to a clone of src.

Parameters
src

◆ set_before_selections()

void zrythm::gui::actions::ArrangerSelectionsAction::set_before_selections ( ArrangerObjectSpan src_var)
protected

Sets sel_ to a clone of src.

Parameters
src

◆ to_string()

QString zrythm::gui::actions::ArrangerSelectionsAction::to_string ( ) const
nodiscardfinalvirtual

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

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

Field Documentation

◆ clip_editor_region_id_

std::optional<ArrangerObject::Uuid> zrythm::gui::actions::ArrangerSelectionsAction::clip_editor_region_id_

Clip editor region ID (for non-timeline actions).

Definition at line 264 of file arranger_selections_action.h.

◆ delta_chords_

int zrythm::gui::actions::ArrangerSelectionsAction::delta_chords_ = 0

Chords moved (up/down in the Chord editor).

Definition at line 249 of file arranger_selections_action.h.

◆ delta_lanes_

int zrythm::gui::actions::ArrangerSelectionsAction::delta_lanes_ {}

Lanes moved.

Definition at line 247 of file arranger_selections_action.h.

◆ delta_normalized_amount_

double zrythm::gui::actions::ArrangerSelectionsAction::delta_normalized_amount_ = 0.0

Difference in a normalized amount, such as automation point normalized value.

Definition at line 258 of file arranger_selections_action.h.

◆ delta_pitch_

int zrythm::gui::actions::ArrangerSelectionsAction::delta_pitch_ = 0

Delta of MidiNote pitch.

Definition at line 251 of file arranger_selections_action.h.

◆ delta_tracks_

int zrythm::gui::actions::ArrangerSelectionsAction::delta_tracks_ {}

Tracks moved.

Definition at line 245 of file arranger_selections_action.h.

◆ delta_vel_

int zrythm::gui::actions::ArrangerSelectionsAction::delta_vel_ = 0

Delta of MidiNote velocity.

Definition at line 253 of file arranger_selections_action.h.

◆ edit_type_

EditType zrythm::gui::actions::ArrangerSelectionsAction::edit_type_ {}

Type of edit action, if an Edit action.

Definition at line 240 of file arranger_selections_action.h.

◆ first_run_

bool zrythm::gui::actions::ArrangerSelectionsAction::first_run_ = false

Number of split objects.

If this is true, the first "do" call does nothing in some cases.

Can be ignored depending on the action.

Definition at line 289 of file arranger_selections_action.h.

◆ opts_

std::unique_ptr<gui::old_dsp::QuantizeOptions> zrythm::gui::actions::ArrangerSelectionsAction::opts_ {}

QuantizeOptions clone, if quantizing.

Definition at line 292 of file arranger_selections_action.h.

◆ pos_

Position zrythm::gui::actions::ArrangerSelectionsAction::pos_

Position, when changing a Position.

Definition at line 275 of file arranger_selections_action.h.

◆ r1_

std::vector<ArrangerObject::Uuid> zrythm::gui::actions::ArrangerSelectionsAction::r1_

Used when splitting - these are the split BoundedObject's.

Definition at line 278 of file arranger_selections_action.h.

◆ r2_

std::vector<ArrangerObject::Uuid> zrythm::gui::actions::ArrangerSelectionsAction::r2_

Definition at line 279 of file arranger_selections_action.h.

◆ region_after_

std::optional<ArrangerObjectPtrVariant> zrythm::gui::actions::ArrangerSelectionsAction::region_after_

Definition at line 298 of file arranger_selections_action.h.

◆ region_before_

std::optional<ArrangerObjectPtrVariant> zrythm::gui::actions::ArrangerSelectionsAction::region_before_

Used for automation autofill action.

These are assumed to be inherited from Region.

Definition at line 297 of file arranger_selections_action.h.

◆ resize_type_

ResizeType zrythm::gui::actions::ArrangerSelectionsAction::resize_type_ = (ResizeType) 0

Used by the resize action.

Definition at line 301 of file arranger_selections_action.h.

◆ sel_

std::optional<std::vector<ArrangerObjectPtrVariant> > zrythm::gui::actions::ArrangerSelectionsAction::sel_

A clone of the ArrangerSelections before the change.

Definition at line 231 of file arranger_selections_action.h.

◆ sel_after_

std::optional<std::vector<ArrangerObjectPtrVariant> > zrythm::gui::actions::ArrangerSelectionsAction::sel_after_

A clone of the ArrangerSelections after the change (used in the EDIT action and quantize).

Definition at line 237 of file arranger_selections_action.h.

◆ selected_positions_in_audio_editor_

std::optional<std::pair<Position, Position> > zrythm::gui::actions::ArrangerSelectionsAction::selected_positions_in_audio_editor_

Definition at line 261 of file arranger_selections_action.h.

◆ str_

utils::Utf8String zrythm::gui::actions::ArrangerSelectionsAction::str_

String, when changing a string.

Definition at line 272 of file arranger_selections_action.h.

◆ target_port_

std::optional<dsp::PortUuid> zrythm::gui::actions::ArrangerSelectionsAction::target_port_

Target port (used to find corresponding automation track when moving/copying automation regions to another automation track/another track).

Definition at line 269 of file arranger_selections_action.h.

◆ ticks_

double zrythm::gui::actions::ArrangerSelectionsAction::ticks_ {}

Ticks diff.

Definition at line 243 of file arranger_selections_action.h.

◆ type_

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

Action type.

Definition at line 228 of file arranger_selections_action.h.


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