Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
|
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::ProcessorParameter * | parameter () 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 () |
AutomationTracklist * | get_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 |
AutomationPoint * | 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. | |
AutomationPoint * | 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. | |
AutomationRegion * | 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. | |
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 ®istry, dsp::FileAudioSourceRegistry &file_audio_source_registry, QObject &derived) | |
auto & | get_children_vector () |
auto | get_children_view () const |
void | add_ticks_to_children (double ticks) |
ArrangerObjectListModel * | get_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 | |
ArrangerObjectRegistry & | object_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. | |
AutomationRegion * | recording_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::ProcessorParameter * | parameter |
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 |
Definition at line 20 of file automation_track.h.
|
inline |
Definition at line 223 of file automation_track.h.
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.
before_only | Only check previous automation points. |
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.
ends_after | Whether to only check in regions that also end after pos (ie, the region surrounds pos), otherwise check in the region that ends last. |
|
inlineoverride |
Definition at line 226 of file automation_track.h.
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.
ends_after | Whether to only check in regions that also end after pos (ie, the region surrounds pos), otherwise check in the region that ends last. |
use_snapshots | Whether to get the value from the snapshotted (cached) regions. This should be set to true when called during dsp playback. TODO unimplemented |
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.
ends_after | Whether to only check for regions that also end after pos (ie, the region surrounds pos), otherwise get the region that ends last. |
|
inlinestatic |
Definition at line 204 of file automation_track.h.
|
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.
|
inline |
Definition at line 86 of file automation_track.h.
|
inline |
Definition at line 82 of file automation_track.h.
|
inline |
Definition at line 93 of file automation_track.h.
|
inline |
Definition at line 77 of file automation_track.h.
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.
record_aps | If 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. |
|
inline |
Definition at line 103 of file automation_track.h.
|
friend |
Definition at line 250 of file automation_track.h.
|
friend |
Definition at line 239 of file automation_track.h.
AutomationMode zrythm::structure::tracks::AutomationTrack::automation_mode_ = AutomationMode::Read |
Automation mode.
Definition at line 294 of file automation_track.h.
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.
double zrythm::structure::tracks::AutomationTrack::height_ = AUTOMATION_TRACK_DEFAULT_HEIGHT |
Position of multipane handle.
Definition at line 288 of file automation_track.h.
int zrythm::structure::tracks::AutomationTrack::index_ = 0 |
Index in parent AutomationTracklist.
Definition at line 267 of file automation_track.h.
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.
ArrangerObjectRegistry& zrythm::structure::tracks::AutomationTrack::object_registry_ |
Definition at line 263 of file automation_track.h.
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.
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.
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.
AutomationRegion* zrythm::structure::tracks::AutomationTrack::recording_region_ = nullptr |
Region currently recording to.
Definition at line 304 of file automation_track.h.
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.
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.
TrackGetter zrythm::structure::tracks::AutomationTrack::track_getter_ |
Definition at line 264 of file automation_track.h.
bool zrythm::structure::tracks::AutomationTrack::visible_ = false |
Whether visible or not.
Being created is a precondition for this.
Definition at line 282 of file automation_track.h.
int zrythm::structure::tracks::AutomationTrack::y_ = 0 |
Y local to track.
Definition at line 285 of file automation_track.h.
|
readwrite |
Definition at line 28 of file automation_track.h.
|
readwrite |
Definition at line 26 of file automation_track.h.
|
read |
Definition at line 27 of file automation_track.h.
|
readwrite |
Definition at line 31 of file automation_track.h.