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

Public Types

enum class  Type { InsertSilence , Remove }
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

 RangeAction (QObject *parent=nullptr)
 RangeAction (Type type, signed_frame_t start_pos, signed_frame_t end_pos, QObject *parent=nullptr)
QString to_string () const override
 Stringizes the action to be used in Undo/Redo buttons.
double get_range_size_in_ticks () const
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

signed_frame_t start_pos_ {}
 Range positions in frames.
signed_frame_t end_pos_ {}
Type type_ = Type::InsertSilence
 Action type.
std::vector< ArrangerObject::Uuidaffected_objects_before_
 Selections before the action, starting from objects intersecting with the start position and ending in infinity.
std::vector< ArrangerObject::Uuidobjects_removed_
 Objects removed from the project while performing the action.
std::vector< ArrangerObject::Uuidobjects_added_
 Objects added to the project while performing the action.
std::vector< ArrangerObject::Uuidobjects_moved_
 Objects moved (not added/removed) during the action.
std::unique_ptr< Transport > transport_
 Selections after the action.
bool first_run_ = false
 Whether this is the first run.
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 (RangeAction &obj, const RangeAction &other, utils::ObjectCloneType clone_type)

Detailed Description

Definition at line 13 of file range_action.h.

Member Enumeration Documentation

◆ Type

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

Definition at line 24 of file range_action.h.

Member Function Documentation

◆ get_range_size_in_ticks()

double zrythm::gui::actions::RangeAction::get_range_size_in_ticks ( ) const
inline

Definition at line 40 of file range_action.h.

◆ to_string()

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

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

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

Field Documentation

◆ affected_objects_before_

std::vector<ArrangerObject::Uuid> zrythm::gui::actions::RangeAction::affected_objects_before_

Selections before the action, starting from objects intersecting with the start position and ending in infinity.

Definition at line 69 of file range_action.h.

◆ end_pos_

signed_frame_t zrythm::gui::actions::RangeAction::end_pos_ {}

Definition at line 62 of file range_action.h.

◆ first_run_

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

Whether this is the first run.

Definition at line 103 of file range_action.h.

◆ objects_added_

std::vector<ArrangerObject::Uuid> zrythm::gui::actions::RangeAction::objects_added_

Objects added to the project while performing the action.

These objects will be removed on undo.

Definition at line 85 of file range_action.h.

◆ objects_moved_

std::vector<ArrangerObject::Uuid> zrythm::gui::actions::RangeAction::objects_moved_

Objects moved (not added/removed) during the action.

This is a subset of affected_objects_before_.

These objects will be moved back to their original positions on undo.

Definition at line 94 of file range_action.h.

◆ objects_removed_

std::vector<ArrangerObject::Uuid> zrythm::gui::actions::RangeAction::objects_removed_

Objects removed from the project while performing the action.

This is a subset of affected_objects_before_.

These objects will be added back to the project on undo.

Definition at line 78 of file range_action.h.

◆ start_pos_

signed_frame_t zrythm::gui::actions::RangeAction::start_pos_ {}

Range positions in frames.

Definition at line 61 of file range_action.h.

◆ transport_

std::unique_ptr<Transport> zrythm::gui::actions::RangeAction::transport_

Selections after the action.

A copy of the transport at the start of the action.

Definition at line 100 of file range_action.h.

◆ type_

Type zrythm::gui::actions::RangeAction::type_ = Type::InsertSilence

Action type.

Definition at line 65 of file range_action.h.


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