Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::structure::tracks::AutomationTracklist Class Reference

A container that manages a list of automation tracks. More...

#include <src/structure/tracks/automation_tracklist.h>

Inheritance diagram for zrythm::structure::tracks::AutomationTracklist:
Collaboration diagram for zrythm::structure::tracks::AutomationTracklist:

Public Types

enum  Roles { AutomationTrackHolderRole = Qt::UserRole + 1 , AutomationTrackRole }

Public Member Functions

 AutomationTracklist (AutomationTrackHolder::Dependencies dependencies, 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)
bool automationVisible () const
void setAutomationVisible (bool visible)
Q_SIGNAL void automationVisibleChanged (bool visible)
AutomationTrackadd_automation_track (utils::QObjectUniquePtr< AutomationTrack > &&at)
 Adds the given automation track.
AutomationTrackadd_automation_track (utils::QObjectUniquePtr< AutomationTrackHolder > &&ath)
AutomationTrackautomation_track_at (size_t index) const
AutomationTrackget_visible_automation_track_after_delta (const AutomationTrack &at, int delta) const
 Returns the AutomationTrack after delta visible AutomationTrack's.
int get_visible_automation_track_count_between (const AutomationTrack &src, const AutomationTrack &dest) const
utils::QObjectUniquePtr< AutomationTrackHolderremove_automation_track (AutomationTrack &at)
 Removes the AutomationTrack from the AutomationTracklist, optionally freeing it.
void clear_arranger_objects ()
 Removes all arranger objects recursively.
void set_automation_track_index (AutomationTrack &at, int index, bool push_down)
 Swaps at with the automation track at index or pushes the other automation tracks down.
AutomationTrackHolderget_first_invisible_automation_track_holder () const
 Used when the add button is added and a new automation track is requested to be shown.
auto & automation_track_holders () const
auto automation_tracks () const
AutomationTrackget_previous_visible_automation_track (const AutomationTrack &at) const
AutomationTrackget_next_visible_automation_track (const AutomationTrack &at) const

Static Public Member Functions

static int get_y_px_from_normalized_val (const double automation_track_height, const float normalized_val)
 Returns the y pixels from the value based on the allocation of the automation track.

Properties

QML_ELEMENT bool automationVisible

Friends

void init_from (AutomationTracklist &obj, const AutomationTracklist &other, utils::ObjectCloneType clone_type)
void to_json (nlohmann::json &j, const AutomationTracklist &ats)
void from_json (const nlohmann::json &j, AutomationTracklist &ats)

Detailed Description

A container that manages a list of automation tracks.

Definition at line 129 of file automation_tracklist.h.

Member Enumeration Documentation

◆ Roles

enum zrythm::structure::tracks::AutomationTracklist::Roles

Definition at line 144 of file automation_tracklist.h.

Member Function Documentation

◆ automation_track_at()

AutomationTrack * zrythm::structure::tracks::AutomationTracklist::automation_track_at ( size_t index) const
inline

Definition at line 183 of file automation_tracklist.h.

◆ automation_track_holders()

auto & zrythm::structure::tracks::AutomationTracklist::automation_track_holders ( ) const
inline

Definition at line 254 of file automation_tracklist.h.

◆ automation_tracks()

auto zrythm::structure::tracks::AutomationTracklist::automation_tracks ( ) const
inline

Definition at line 256 of file automation_tracklist.h.

◆ automationVisible()

bool zrythm::structure::tracks::AutomationTracklist::automationVisible ( ) const
inline

Definition at line 163 of file automation_tracklist.h.

◆ get_first_invisible_automation_track_holder()

AutomationTrackHolder * zrythm::structure::tracks::AutomationTracklist::get_first_invisible_automation_track_holder ( ) 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.

Returns
The holder or nullptr.

◆ get_visible_automation_track_after_delta()

AutomationTrack * zrythm::structure::tracks::AutomationTracklist::get_visible_automation_track_after_delta ( const AutomationTrack & at,
int delta ) const

Returns the AutomationTrack after delta visible AutomationTrack's.

Negative delta searches backwards.

◆ get_y_px_from_normalized_val()

int zrythm::structure::tracks::AutomationTracklist::get_y_px_from_normalized_val ( const double automation_track_height,
const float normalized_val )
inlinestatic

Returns the y pixels from the value based on the allocation of the automation track.

Definition at line 220 of file automation_tracklist.h.

◆ remove_automation_track()

utils::QObjectUniquePtr< AutomationTrackHolder > zrythm::structure::tracks::AutomationTracklist::remove_automation_track ( AutomationTrack & at)

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_automation_track_index()

void zrythm::structure::tracks::AutomationTracklist::set_automation_track_index ( AutomationTrack & at,
int index,
bool push_down )

Swaps at with the automation track at index or pushes the other automation tracks down.

A special case is when index == 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.

◆ to_json

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

Definition at line 272 of file automation_tracklist.h.

Property Documentation

◆ automationVisible

QML_ELEMENT bool zrythm::structure::tracks::AutomationTracklist::automationVisible
readwrite

Definition at line 133 of file automation_tracklist.h.


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