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

Tracklist selections (tracks) action. More...

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

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

Public Types

enum class  Type {
  Copy , CopyInside , Create , Delete ,
  Edit , Move , MoveInside , Pin ,
  Unpin
}
enum class  EditType {
  Solo , SoloLane , Mute , MuteLane ,
  Listen , Enable , Fold , Volume ,
  Pan , DirectOut , Rename , RenameLane ,
  Color , Comment , Icon , MidiFaderMode
}
using Position = zrythm::dsp::Position
using Color = zrythm::utils::Color
using PortType = zrythm::dsp::PortType
using PluginConfiguration = zrythm::plugins::PluginConfiguration
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

 TracklistSelectionsAction (Type type, std::optional< TrackSpan > tls_before_var, std::optional< TrackSpan > tls_after_var, const PortConnectionsManager *port_connections_mgr, std::optional< TrackPtrVariant > track_var, Track::Type track_type, const PluginConfiguration *pl_setting, const FileDescriptor *file_descr, int track_pos, int lane_pos, const Position *pos, int num_tracks, EditType edit_type, int ival_after, const Color *color_new, float val_before, float val_after, const utils::Utf8String *new_txt, bool already_edited)
 Creates a new TracklistSelectionsAction.
 TracklistSelectionsAction (Track::Type track_type, const PluginConfiguration *pl_setting, const FileDescriptor *file_descr, int track_pos, const Position *pos, int num_tracks, int disable_track_pos)
 Constructor for a Create action.
QString to_string () const final
 Stringizes the action to be used in Undo/Redo buttons.
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.
void get_plugins (std::vector< zrythm::plugins::Plugin * > &plugins) override
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 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 tracklist_selections_action_type_ {}
 Type of action.
int track_pos_ = 0
 Position to make the tracks at.
int lane_pos_ = 0
 Lane position, if editing lane.
Position pos_
 Position to add the audio region to, if applicable.
bool have_pos_ = false
Track::Type track_type_ {}
 Track type.
bool is_empty_ = false
 Flag to know if we are making an empty track.
std::unique_ptr< PluginConfiguration > pl_setting_
 PluginConfiguration, if making an instrument or bus track from a plugin.
fs::path file_basename_
 The basename of the file, if any.
utils::Utf8String base64_midi_
 If this is an action to create a MIDI track from a MIDI file, this is the base64 representation so that the file does not need to be stored in the project.
std::optional< dsp::FileAudioSourceUuidReference > pool_id_
 If this is an action to create an Audio track from an audio file, this is the pool ID of the audio file.
std::vector< std::optional< Track::Uuid > > out_track_uuids_
 Direct out tracks of the original tracks.
int num_fold_change_tracks_ {}
 Number of tracks under folder affected.
EditType edit_type_ {}
std::vector< int > track_positions_before_
 Track positions.
std::vector< int > track_positions_after_
int num_tracks_ = 0
 Number of tracks.
std::optional< std::vector< TrackPtrVariant > > tls_before_
 Clone of the TracklistSelections, if applicable.
std::optional< std::vector< TrackPtrVariant > > tls_after_
 Clone of the TracklistSelections, if applicable.
std::optional< std::vector< TrackPtrVariant > > foldable_tls_before_
 Foldable tracks before the change, used when undoing to set the correct sizes.
std::vector< int > ival_before_
 Int value.
int ival_after_ = 0
std::vector< Color > colors_before_
Color new_color_
utils::Utf8String new_txt_
bool already_edited_ = false
 Skip do if true.
float val_before_ = 0.f
 Float values.
float val_after_ = 0.f
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 (TracklistSelectionsAction &obj, const TracklistSelectionsAction &other, utils::ObjectCloneType clone_type)

Detailed Description

Tracklist selections (tracks) action.

Definition at line 21 of file tracklist_selections_action.h.

Member Typedef Documentation

◆ Color

using zrythm::gui::actions::TracklistSelectionsAction::Color = zrythm::utils::Color

Definition at line 75 of file tracklist_selections_action.h.

◆ PluginConfiguration

using zrythm::gui::actions::TracklistSelectionsAction::PluginConfiguration = zrythm::plugins::PluginConfiguration

Definition at line 77 of file tracklist_selections_action.h.

◆ PortType

using zrythm::gui::actions::TracklistSelectionsAction::PortType = zrythm::dsp::PortType

Definition at line 76 of file tracklist_selections_action.h.

◆ Position

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

Definition at line 74 of file tracklist_selections_action.h.

Member Enumeration Documentation

◆ EditType

Enumerator
DirectOut 

Direct out change.

Rename 

Rename track.

RenameLane 

Rename lane.

Definition at line 46 of file tracklist_selections_action.h.

◆ Type

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

Definition at line 33 of file tracklist_selections_action.h.

Constructor & Destructor Documentation

◆ TracklistSelectionsAction() [1/2]

zrythm::gui::actions::TracklistSelectionsAction::TracklistSelectionsAction ( Type type,
std::optional< TrackSpan > tls_before_var,
std::optional< TrackSpan > tls_after_var,
const PortConnectionsManager * port_connections_mgr,
std::optional< TrackPtrVariant > track_var,
Track::Type track_type,
const PluginConfiguration * pl_setting,
const FileDescriptor * file_descr,
int track_pos,
int lane_pos,
const Position * pos,
int num_tracks,
EditType edit_type,
int ival_after,
const Color * color_new,
float val_before,
float val_after,
const utils::Utf8String * new_txt,
bool already_edited )

Creates a new TracklistSelectionsAction.

Parameters
tls_beforeTracklist selections to act upon.
port_connections_mgrPort connections manager at the start of the action.
posPosition to make the tracks at.
pl_settingPlugin setting, if any.
trackTrack, if single-track action. Used if tls_before and tls_after are NULL.
Exceptions
ZrythmExceptionon error.

◆ TracklistSelectionsAction() [2/2]

zrythm::gui::actions::TracklistSelectionsAction::TracklistSelectionsAction ( Track::Type track_type,
const PluginConfiguration * pl_setting,
const FileDescriptor * file_descr,
int track_pos,
const Position * pos,
int num_tracks,
int disable_track_pos )
inline

Constructor for a Create action.

Definition at line 119 of file tracklist_selections_action.h.

Member Function Documentation

◆ get_plugins()

void zrythm::gui::actions::TracklistSelectionsAction::get_plugins ( std::vector< zrythm::plugins::Plugin * > & plugins)
inlineoverride

Definition at line 183 of file tracklist_selections_action.h.

◆ needs_pause()

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

Returns whether the action requires pausing the engine.

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

Definition at line 168 of file tracklist_selections_action.h.

◆ needs_transport_total_bar_update()

bool zrythm::gui::actions::TracklistSelectionsAction::needs_transport_total_bar_update ( bool perform) const
inlineoverridevirtual

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.

Definition at line 152 of file tracklist_selections_action.h.

◆ to_string()

QString zrythm::gui::actions::TracklistSelectionsAction::to_string ( ) const
finalvirtual

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

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

Field Documentation

◆ already_edited_

bool zrythm::gui::actions::TracklistSelectionsAction::already_edited_ = false

Skip do if true.

Definition at line 371 of file tracklist_selections_action.h.

◆ base64_midi_

utils::Utf8String zrythm::gui::actions::TracklistSelectionsAction::base64_midi_

If this is an action to create a MIDI track from a MIDI file, this is the base64 representation so that the file does not need to be stored in the project.

Note
For audio files, TracklistSelectionsAction.pool_id_ is used.

Definition at line 302 of file tracklist_selections_action.h.

◆ colors_before_

std::vector<Color> zrythm::gui::actions::TracklistSelectionsAction::colors_before_

Definition at line 365 of file tracklist_selections_action.h.

◆ edit_type_

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

Definition at line 324 of file tracklist_selections_action.h.

◆ file_basename_

fs::path zrythm::gui::actions::TracklistSelectionsAction::file_basename_

The basename of the file, if any.

This will be used as the track name.

Definition at line 291 of file tracklist_selections_action.h.

◆ foldable_tls_before_

std::optional<std::vector<TrackPtrVariant> > zrythm::gui::actions::TracklistSelectionsAction::foldable_tls_before_

Foldable tracks before the change, used when undoing to set the correct sizes.

Definition at line 351 of file tracklist_selections_action.h.

◆ have_pos_

bool zrythm::gui::actions::TracklistSelectionsAction::have_pos_ = false

Definition at line 271 of file tracklist_selections_action.h.

◆ is_empty_

bool zrythm::gui::actions::TracklistSelectionsAction::is_empty_ = false

Flag to know if we are making an empty track.

Definition at line 277 of file tracklist_selections_action.h.

◆ ival_after_

int zrythm::gui::actions::TracklistSelectionsAction::ival_after_ = 0

Definition at line 361 of file tracklist_selections_action.h.

◆ ival_before_

std::vector<int> zrythm::gui::actions::TracklistSelectionsAction::ival_before_

Int value.

Also used for bool.

Definition at line 360 of file tracklist_selections_action.h.

◆ lane_pos_

int zrythm::gui::actions::TracklistSelectionsAction::lane_pos_ = 0

Lane position, if editing lane.

Definition at line 265 of file tracklist_selections_action.h.

◆ new_color_

Color zrythm::gui::actions::TracklistSelectionsAction::new_color_

Definition at line 366 of file tracklist_selections_action.h.

◆ new_txt_

utils::Utf8String zrythm::gui::actions::TracklistSelectionsAction::new_txt_

Definition at line 368 of file tracklist_selections_action.h.

◆ num_fold_change_tracks_

int zrythm::gui::actions::TracklistSelectionsAction::num_fold_change_tracks_ {}

Number of tracks under folder affected.

Counter to be filled while doing to be used when undoing.

Definition at line 322 of file tracklist_selections_action.h.

◆ num_tracks_

int zrythm::gui::actions::TracklistSelectionsAction::num_tracks_ = 0

Number of tracks.

This counter is used in various cases.

Definition at line 339 of file tracklist_selections_action.h.

◆ out_track_uuids_

std::vector<std::optional<Track::Uuid> > zrythm::gui::actions::TracklistSelectionsAction::out_track_uuids_

Direct out tracks of the original tracks.

Definition at line 315 of file tracklist_selections_action.h.

◆ pl_setting_

std::unique_ptr<PluginConfiguration> zrythm::gui::actions::TracklistSelectionsAction::pl_setting_

PluginConfiguration, if making an instrument or bus track from a plugin.

If this is empty and the track type is instrument, it is assumed that it's an empty track.

Definition at line 284 of file tracklist_selections_action.h.

◆ pool_id_

std::optional<dsp::FileAudioSourceUuidReference> zrythm::gui::actions::TracklistSelectionsAction::pool_id_

If this is an action to create an Audio track from an audio file, this is the pool ID of the audio file.

If this is not -1, this means that an audio file exists in the pool.

Definition at line 310 of file tracklist_selections_action.h.

◆ pos_

Position zrythm::gui::actions::TracklistSelectionsAction::pos_

Position to add the audio region to, if applicable.

Definition at line 269 of file tracklist_selections_action.h.

◆ tls_after_

std::optional<std::vector<TrackPtrVariant> > zrythm::gui::actions::TracklistSelectionsAction::tls_after_

Clone of the TracklistSelections, if applicable.

Definition at line 345 of file tracklist_selections_action.h.

◆ tls_before_

std::optional<std::vector<TrackPtrVariant> > zrythm::gui::actions::TracklistSelectionsAction::tls_before_

Clone of the TracklistSelections, if applicable.

Definition at line 342 of file tracklist_selections_action.h.

◆ track_pos_

int zrythm::gui::actions::TracklistSelectionsAction::track_pos_ = 0

Position to make the tracks at.

Used when undoing too.

Definition at line 262 of file tracklist_selections_action.h.

◆ track_positions_after_

std::vector<int> zrythm::gui::actions::TracklistSelectionsAction::track_positions_after_

Definition at line 332 of file tracklist_selections_action.h.

◆ track_positions_before_

std::vector<int> zrythm::gui::actions::TracklistSelectionsAction::track_positions_before_

Track positions.

Used for actions where full selection clones are not needed.

Definition at line 331 of file tracklist_selections_action.h.

◆ track_type_

Track::Type zrythm::gui::actions::TracklistSelectionsAction::track_type_ {}

Track type.

Definition at line 274 of file tracklist_selections_action.h.

◆ tracklist_selections_action_type_

Type zrythm::gui::actions::TracklistSelectionsAction::tracklist_selections_action_type_ {}

Type of action.

Definition at line 257 of file tracklist_selections_action.h.

◆ val_after_

float zrythm::gui::actions::TracklistSelectionsAction::val_after_ = 0.f

Definition at line 375 of file tracklist_selections_action.h.

◆ val_before_

float zrythm::gui::actions::TracklistSelectionsAction::val_before_ = 0.f

Float values.

Definition at line 374 of file tracklist_selections_action.h.


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