Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
AutomationTracklist Class Referencefinal

Each track has an automation tracklist with automation tracks to be generated at runtime, and filled in with automation points/curves when loading projects. More...

#include <src/gui/dsp/automation_tracklist.h>

Inheritance diagram for AutomationTracklist:
Collaboration diagram for AutomationTracklist:

Public Types

enum  Roles { AutomationTrackPtrRole = Qt::UserRole + 1 }
 

Public Member Functions

 AutomationTracklist (PortRegistry &port_registry, ArrangerObjectRegistry &object_registry, AutomatableTrack &track, QObject *parent=nullptr)
 
QHash< int, QByteArray > roleNames () const override
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 
Q_INVOKABLE void showNextAvailableAutomationTrack (AutomationTrack *current_automation_track)
 
Q_INVOKABLE void hideAutomationTrack (AutomationTrack *current_automation_track)
 
void init_after_cloning (const AutomationTracklist &other, ObjectCloneType clone_type) override
 Initializes the cloned object.
 
void init_loaded ()
 Inits a loaded AutomationTracklist.
 
TrackPtrVariant get_track () const
 
AutomationTrackadd_automation_track (AutomationTrack &at)
 Adds the given automation track.
 
void print_ats () const
 Prints info about all the automation tracks.
 
void update_positions (bool from_ticks, bool bpm_change)
 Updates the frames of each position in each child of the automation tracklist recursively.
 
AutomationTrackget_prev_visible_at (const AutomationTrack &at) const
 
AutomationTrackget_next_visible_at (const AutomationTrack &at) const
 
void set_at_visible (AutomationTrack &at, bool visible)
 
AutomationTrackget_automation_track_at (size_t index)
 
auto & get_automation_tracks_in_record_mode ()
 
auto & get_automation_tracks_in_record_mode () const
 
AutomationTrackget_visible_at_after_delta (const AutomationTrack &at, int delta) const
 Returns the AutomationTrack after delta visible AutomationTrack's.
 
int get_visible_at_diff (const AutomationTrack &src, const AutomationTrack &dest) const
 
AutomationTrackremove_at (AutomationTrack &at, bool free, bool fire_events)
 Removes the AutomationTrack from the AutomationTracklist, optionally freeing it.
 
void remove_channel_ats (gui::Channel *ch)
 Removes the AutomationTrack's associated with this channel from the AutomationTracklist in the corresponding Track.
 
AutomationTrackget_at_from_port (const ControlPort &port) const
 Returns the AutomationTrack corresponding to the given Port.
 
AutomationTrackget_automation_track_by_port_id (dsp::PortIdentifier::PortUuid id) const
 Returns the AutomationTrack corresponding to the given Port.
 
void unselect_all ()
 Unselects all arranger objects.
 
void clear_objects ()
 Removes all objects recursively.
 
void set_at_index (AutomationTrack &at, int index, bool push_down)
 Sets the index of the AutomationTrack and swaps it with the AutomationTrack at that index or pushes the other AutomationTrack's down.
 
AutomationTrackget_plugin_at (plugins::PluginSlot slot, int port_index, const utils::Utf8String &symbol)
 Gets the automation track matching the given arguments.
 
AutomationTrackget_first_invisible_at () const
 Used when the add button is added and a new automation track is requested to be shown.
 
void append_objects (std::vector< ArrangerObject * > objects) const
 
int get_num_visible () const
 Returns the number of visible AutomationTrack's.
 
bool validate () const
 Verifies the identifiers on a live automation tracklist (in the project, not a clone).
 
int get_num_regions () const
 Counts the total number of regions in the automation tracklist.
 
void print_regions () const
 
auto & get_visible_automation_tracks ()
 
auto & get_visible_automation_tracks () const
 
auto & get_automation_tracks ()
 
auto & get_automation_tracks () const
 
ControlPortget_port (dsp::PortIdentifier::PortUuid id) const
 
void set_caches (CacheType types)
 
- Public Member Functions inherited from ICloneable< AutomationTracklist >
std::unique_ptr< AutomationTracklistclone_unique (ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) const
 
std::shared_ptr< AutomationTracklistclone_shared (ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) const
 
AutomationTracklistclone_raw_ptr (ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) const
 
AutomationTracklistclone_qobject (QObject *parent, ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) const
 
QScopedPointer< AutomationTracklistclone_unique_qobject (QObject *parent, ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) const
 

Friends

void to_json (nlohmann::json &j, const AutomationTracklist &ats)
 
void from_json (const nlohmann::json &j, AutomationTracklist &ats)
 

Additional Inherited Members

- Data Fields inherited from ICloneable< AutomationTracklist >
friend Derived
 

Detailed Description

Each track has an automation tracklist with automation tracks to be generated at runtime, and filled in with automation points/curves when loading projects.

Definition at line 31 of file automation_tracklist.h.

Member Enumeration Documentation

◆ Roles

enum AutomationTracklist::Roles

Definition at line 46 of file automation_tracklist.h.

Member Function Documentation

◆ add_automation_track()

AutomationTrack * AutomationTracklist::add_automation_track ( AutomationTrack & at)

Adds the given automation track.

This takes (QObject) ownership of the AutomationTrack.

◆ get_automation_track_at()

AutomationTrack * AutomationTracklist::get_automation_track_at ( size_t index)
inline

Definition at line 106 of file automation_tracklist.h.

◆ get_automation_tracks() [1/2]

auto & AutomationTracklist::get_automation_tracks ( )
inline

Definition at line 227 of file automation_tracklist.h.

◆ get_automation_tracks() [2/2]

auto & AutomationTracklist::get_automation_tracks ( ) const
inline

Definition at line 228 of file automation_tracklist.h.

◆ get_automation_tracks_in_record_mode() [1/2]

auto & AutomationTracklist::get_automation_tracks_in_record_mode ( )
inline

Definition at line 111 of file automation_tracklist.h.

◆ get_automation_tracks_in_record_mode() [2/2]

auto & AutomationTracklist::get_automation_tracks_in_record_mode ( ) const
inline

Definition at line 112 of file automation_tracklist.h.

◆ get_first_invisible_at()

AutomationTrack * AutomationTracklist::get_first_invisible_at ( ) const

Used when the add button is added and a new automation track is requested to be shown.

Marks the first invisible automation track as visible, or marks an uncreated one as created if all invisible ones are visible, and returns it.

◆ get_plugin_at()

AutomationTrack * AutomationTracklist::get_plugin_at ( plugins::PluginSlot slot,
int port_index,
const utils::Utf8String & symbol )

Gets the automation track matching the given arguments.

Currently only used in mixer selections action.

◆ get_visible_at_after_delta()

AutomationTrack * AutomationTracklist::get_visible_at_after_delta ( const AutomationTrack & at,
int delta ) const

Returns the AutomationTrack after delta visible AutomationTrack's.

Negative delta searches backwards.

This function searches tracks only in the same Tracklist as the given one (ie, pinned or not).

◆ get_visible_automation_tracks() [1/2]

auto & AutomationTracklist::get_visible_automation_tracks ( )
inline

Definition at line 224 of file automation_tracklist.h.

◆ get_visible_automation_tracks() [2/2]

auto & AutomationTracklist::get_visible_automation_tracks ( ) const
inline

Definition at line 225 of file automation_tracklist.h.

◆ init_after_cloning()

void AutomationTracklist::init_after_cloning ( const AutomationTracklist & other,
ObjectCloneType clone_type )
overridevirtual

Initializes the cloned object.

Note
Only final classes should implement this.
Exceptions
ZrythmExceptionIf the object could not be cloned.

Implements ICloneable< AutomationTracklist >.

◆ print_ats()

void AutomationTracklist::print_ats ( ) const

Prints info about all the automation tracks.

Used for debugging.

◆ remove_at()

AutomationTrack * AutomationTracklist::remove_at ( AutomationTrack & at,
bool free,
bool fire_events )

Removes the AutomationTrack from the AutomationTracklist, optionally freeing it.

Returns
The removed automation track (in case we want to move it). Can be ignored to let it get free'd when it goes out of scope.

◆ set_at_index()

void AutomationTracklist::set_at_index ( AutomationTrack & at,
int index,
bool push_down )

Sets the index of the AutomationTrack and swaps it with the AutomationTrack at that index or pushes the other AutomationTrack's down.

A special case is when index == ats_.size(). In this case, the given automation track is set last and all the other automation tracks are pushed upwards.

Parameters
push_downFalse to swap positions with the current AutomationTrack, or true to push down all the tracks below.

◆ update_positions()

void AutomationTracklist::update_positions ( bool from_ticks,
bool bpm_change )

Updates the frames of each position in each child of the automation tracklist recursively.

Parameters
from_ticksWhether to update the positions based on ticks (true) or frames (false).

◆ validate()

bool AutomationTracklist::validate ( ) const

Verifies the identifiers on a live automation tracklist (in the project, not a clone).

Returns
True if pass.

Friends And Related Symbol Documentation

◆ to_json

void to_json ( nlohmann::json & j,
const AutomationTracklist & ats )
friend

Definition at line 236 of file automation_tracklist.h.


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