Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::structure::tracks::AutomationTrack Class Referencefinal
Inheritance diagram for zrythm::structure::tracks::AutomationTrack:
Collaboration diagram for zrythm::structure::tracks::AutomationTrack:

Public Member Functions

 AutomationTrack (dsp::FileAudioSourceRegistry &file_audio_source_registry, ArrangerObjectRegistry &obj_registry, TrackGetter track_getter, dsp::ProcessorParameterUuidReference param_id)
 Creates an automation track for the given parameter.
dsp::ProcessorParameterparameter () const
double getHeight () const
void setHeight (double height)
Q_SIGNAL void heightChanged (double height)
int getAutomationMode () const
void setAutomationMode (int automation_mode)
Q_SIGNAL void automationModeChanged (int automation_mode)
int getRecordMode () const
void setRecordMode (int record_mode)
Q_SIGNAL void recordModeChanged (int record_mode)
void init_loaded ()
void set_automation_mode (AutomationMode mode, bool fire_events)
void swap_record_mode ()
AutomationTracklistget_automation_tracklist () const
bool should_read_automation () const
 Returns whether the automation in the automation track should be read.
bool should_be_recording (bool record_aps) const
 Returns if the automation track should currently be recording data.
void set_index (int index)
 Sets the index of the AutomationTrack in the AutomationTracklist.
TrackPtrVariant get_track () const
AutomationPointget_ap_around (double position_ticks, double delta_ticks, bool before_only, bool use_snapshots)
 Returns an automation point found within +/- delta_ticks from the position, or NULL.
AutomationPointget_ap_before_pos (signed_frame_t pos, bool ends_after, bool use_snapshots) const
 Returns the automation point before the Position on the timeline.
AutomationRegionget_region_before_pos (signed_frame_t pos, bool ends_after, bool use_snapshots) const
 Returns the Region that starts before given Position, if any.
std::optional< float > get_normalized_val_at_pos (signed_frame_t pos, bool ends_after, bool use_snapshots) const
 Returns the normalized parameter value at the given position.
int get_y_px_from_normalized_val (float normalized_val) const
 Returns the y pixels from the value based on the allocation of the automation track.
void set_caches (CacheType types)
bool contains_automation () const
std::string get_field_name_for_serialization (const AutomationRegion *) const override
Public Member Functions inherited from zrythm::structure::arrangement::ArrangerObjectOwner< arrangement::AutomationRegion >
 ArrangerObjectOwner (ArrangerObjectRegistry &registry, dsp::FileAudioSourceRegistry &file_audio_source_registry, QObject &derived)
auto & get_children_vector ()
auto get_children_view () const
void add_ticks_to_children (double ticks)
ArrangerObjectListModelget_model () const
ArrangerObjectUuidReference remove_object (this SelfT &self, const ArrangerObject::Uuid &id)
void insert_object (this SelfT &self, const ArrangerObjectUuidReference &obj_ref, int idx)
void add_object (this SelfT &self, const ArrangerObjectUuidReference &obj_ref)
void clear_objects ()
virtual std::string get_field_name_for_serialization (const ChildT *) const=0
 Get the children field name to be used during serialization/deserialization.

Static Public Member Functions

static int get_y_px_from_height_and_normalized_val (const float height, const float normalized_val)

Data Fields

ArrangerObjectRegistryobject_registry_
TrackGetter track_getter_
int index_ = 0
 Index in parent AutomationTracklist.
dsp::ProcessorParameterUuidReference port_id_
 Identifier of the Port this AutomationTrack is for (owned pointer).
bool created_ = false
 Whether it has been created by the user yet or not.
bool visible_ = false
 Whether visible or not.
int y_ = 0
 Y local to track.
double height_ = AUTOMATION_TRACK_DEFAULT_HEIGHT
 Position of multipane handle.
float last_recorded_value_ = 0.f
 Last value recorded in this automation track.
AutomationMode automation_mode_ = AutomationMode::Read
 Automation mode.
AutomationRecordMode record_mode_ = (AutomationRecordMode) 0
 Automation record mode, when automation_mode_ is set to record.
bool recording_started_ = false
 To be set to true when recording starts (when the first change is received) and false when recording ends.
AutomationRegionrecording_region_ = nullptr
 Region currently recording to.
bool recording_start_sent_ = false
 This is a flag to let the recording manager know that a START signal was already sent for recording.
bool recording_paused_ = false
 This must only be set by the RecordingManager when temporarily pausing recording, eg when looping or leaving the punch range.

Properties

QML_ELEMENT double height
dsp::ProcessorParameterparameter
int automationMode
int recordMode

Friends

void init_from (AutomationTrack &obj, const AutomationTrack &other, utils::ObjectCloneType clone_type)
 Clones the AutomationTrack.
void to_json (nlohmann::json &j, const AutomationTrack &track)
void from_json (const nlohmann::json &j, AutomationTrack &track)

Additional Inherited Members

Public Types inherited from zrythm::structure::arrangement::ArrangerObjectOwner< arrangement::AutomationRegion >
using ArrangerObjectChildType
using ArrangerObjectListModel

Detailed Description

Definition at line 20 of file automation_track.h.

Member Function Documentation

◆ contains_automation()

bool zrythm::structure::tracks::AutomationTrack::contains_automation ( ) const
inline

Definition at line 223 of file automation_track.h.

◆ get_ap_around()

AutomationPoint * zrythm::structure::tracks::AutomationTrack::get_ap_around ( double position_ticks,
double delta_ticks,
bool before_only,
bool use_snapshots )

Returns an automation point found within +/- delta_ticks from the position, or NULL.

Parameters
before_onlyOnly check previous automation points.

◆ get_ap_before_pos()

AutomationPoint * zrythm::structure::tracks::AutomationTrack::get_ap_before_pos ( signed_frame_t pos,
bool ends_after,
bool use_snapshots ) const

Returns the automation point before the Position on the timeline.

Parameters
ends_afterWhether to only check in regions that also end after pos (ie, the region surrounds pos), otherwise check in the region that ends last.

◆ get_field_name_for_serialization()

std::string zrythm::structure::tracks::AutomationTrack::get_field_name_for_serialization ( const AutomationRegion * ) const
inlineoverride

Definition at line 226 of file automation_track.h.

◆ get_normalized_val_at_pos()

std::optional< float > zrythm::structure::tracks::AutomationTrack::get_normalized_val_at_pos ( signed_frame_t pos,
bool ends_after,
bool use_snapshots ) const

Returns the normalized parameter value at the given position.

If there is no automation point/curve during the position, it returns the current value of the parameter it is automating.

Parameters
ends_afterWhether to only check in regions that also end after pos (ie, the region surrounds pos), otherwise check in the region that ends last.
use_snapshotsWhether to get the value from the snapshotted (cached) regions. This should be set to true when called during dsp playback. TODO unimplemented
Returns
The normalized value, or std::nullopt if there is no automation point/curve at the position.

◆ get_region_before_pos()

AutomationRegion * zrythm::structure::tracks::AutomationTrack::get_region_before_pos ( signed_frame_t pos,
bool ends_after,
bool use_snapshots ) const

Returns the Region that starts before given Position, if any.

Parameters
ends_afterWhether to only check for regions that also end after pos (ie, the region surrounds pos), otherwise get the region that ends last.

◆ get_y_px_from_height_and_normalized_val()

int zrythm::structure::tracks::AutomationTrack::get_y_px_from_height_and_normalized_val ( const float height,
const float normalized_val )
inlinestatic

Definition at line 204 of file automation_track.h.

◆ get_y_px_from_normalized_val()

int zrythm::structure::tracks::AutomationTrack::get_y_px_from_normalized_val ( float normalized_val) const
inline

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

Definition at line 215 of file automation_track.h.

◆ getAutomationMode()

int zrythm::structure::tracks::AutomationTrack::getAutomationMode ( ) const
inline

Definition at line 86 of file automation_track.h.

◆ getHeight()

double zrythm::structure::tracks::AutomationTrack::getHeight ( ) const
inline

Definition at line 82 of file automation_track.h.

◆ getRecordMode()

int zrythm::structure::tracks::AutomationTrack::getRecordMode ( ) const
inline

Definition at line 93 of file automation_track.h.

◆ parameter()

dsp::ProcessorParameter * zrythm::structure::tracks::AutomationTrack::parameter ( ) const
inline

Definition at line 77 of file automation_track.h.

◆ should_be_recording()

bool zrythm::structure::tracks::AutomationTrack::should_be_recording ( bool record_aps) const

Returns if the automation track should currently be recording data.

Returns false if in touch mode after the release time has passed.

This function assumes that the transport will be rolling.

Parameters
record_apsIf set to true, this function will return whether we should be recording automation point data. If set to false, this function will return whether we should be recording a region (eg, if an automation point was already created before and we are still recording inside a region regardless of whether we should create/edit automation points or not.

◆ swap_record_mode()

void zrythm::structure::tracks::AutomationTrack::swap_record_mode ( )
inline

Definition at line 103 of file automation_track.h.

◆ from_json

void from_json ( const nlohmann::json & j,
AutomationTrack & track )
friend

Definition at line 250 of file automation_track.h.

◆ to_json

void to_json ( nlohmann::json & j,
const AutomationTrack & track )
friend

Definition at line 239 of file automation_track.h.

Field Documentation

◆ automation_mode_

AutomationMode zrythm::structure::tracks::AutomationTrack::automation_mode_ = AutomationMode::Read

Automation mode.

Definition at line 294 of file automation_track.h.

◆ created_

bool zrythm::structure::tracks::AutomationTrack::created_ = false

Whether it has been created by the user yet or not.

Definition at line 273 of file automation_track.h.

◆ height_

double zrythm::structure::tracks::AutomationTrack::height_ = AUTOMATION_TRACK_DEFAULT_HEIGHT

Position of multipane handle.

Definition at line 288 of file automation_track.h.

◆ index_

int zrythm::structure::tracks::AutomationTrack::index_ = 0

Index in parent AutomationTracklist.

Definition at line 267 of file automation_track.h.

◆ last_recorded_value_

float zrythm::structure::tracks::AutomationTrack::last_recorded_value_ = 0.f

Last value recorded in this automation track.

Definition at line 291 of file automation_track.h.

◆ object_registry_

ArrangerObjectRegistry& zrythm::structure::tracks::AutomationTrack::object_registry_

Definition at line 263 of file automation_track.h.

◆ port_id_

dsp::ProcessorParameterUuidReference zrythm::structure::tracks::AutomationTrack::port_id_

Identifier of the Port this AutomationTrack is for (owned pointer).

Definition at line 270 of file automation_track.h.

◆ record_mode_

AutomationRecordMode zrythm::structure::tracks::AutomationTrack::record_mode_ = (AutomationRecordMode) 0

Automation record mode, when automation_mode_ is set to record.

Definition at line 297 of file automation_track.h.

◆ recording_paused_

bool zrythm::structure::tracks::AutomationTrack::recording_paused_ = false

This must only be set by the RecordingManager when temporarily pausing recording, eg when looping or leaving the punch range.

See RECORDING_EVENT_TYPE_PAUSE_AUTOMATION_RECORDING.

Definition at line 322 of file automation_track.h.

◆ recording_region_

AutomationRegion* zrythm::structure::tracks::AutomationTrack::recording_region_ = nullptr

Region currently recording to.

Definition at line 304 of file automation_track.h.

◆ recording_start_sent_

bool zrythm::structure::tracks::AutomationTrack::recording_start_sent_ = false

This is a flag to let the recording manager know that a START signal was already sent for recording.

This is because AutomationTrack.recording_region takes a cycle or 2 to become non-NULL.

Definition at line 313 of file automation_track.h.

◆ recording_started_

bool zrythm::structure::tracks::AutomationTrack::recording_started_ = false

To be set to true when recording starts (when the first change is received) and false when recording ends.

Definition at line 301 of file automation_track.h.

◆ track_getter_

TrackGetter zrythm::structure::tracks::AutomationTrack::track_getter_

Definition at line 264 of file automation_track.h.

◆ visible_

bool zrythm::structure::tracks::AutomationTrack::visible_ = false

Whether visible or not.

Being created is a precondition for this.

Important
Must only be set with automation_tracklist_set_at_visible().

Definition at line 282 of file automation_track.h.

◆ y_

int zrythm::structure::tracks::AutomationTrack::y_ = 0

Y local to track.

Definition at line 285 of file automation_track.h.

Property Documentation

◆ automationMode

int zrythm::structure::tracks::AutomationTrack::automationMode
readwrite

Definition at line 28 of file automation_track.h.

◆ height

QML_ELEMENT double zrythm::structure::tracks::AutomationTrack::height
readwrite

Definition at line 26 of file automation_track.h.

◆ parameter

dsp::ProcessorParameter * zrythm::structure::tracks::AutomationTrack::parameter
read

Definition at line 27 of file automation_track.h.

◆ recordMode

int zrythm::structure::tracks::AutomationTrack::recordMode
readwrite

Definition at line 31 of file automation_track.h.


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