10#ifndef __AUDIO_AUTOMATION_TRACK_H__
11#define __AUDIO_AUTOMATION_TRACK_H__
13#include "zrythm-config.h"
32#define MAX_AUTOMATION_POINTS 1200
35#define AUTOMATION_RECORDING_TOUCH_REL_MS 800
37enum class AutomationMode
40 AUTOMATION_MODE_RECORD,
45enum class AutomationRecordMode
47 AUTOMATION_RECORD_MODE_TOUCH,
48 AUTOMATION_RECORD_MODE_LATCH,
49 NUM_AUTOMATION_RECORD_MODES,
70 int num_region_snapshots;
126 int num_top_right_buttons;
128 int num_top_left_buttons;
130 int num_bot_right_buttons;
136 int num_bot_left_buttons;
194automation_track_set_automation_mode (
199NONNULL static inline
void
202 self->
record_mode =
static_cast<AutomationRecordMode
> (
203 (
static_cast<int> (self->record_mode) + 1)
204 %
static_cast<int> (AutomationRecordMode::NUM_AUTOMATION_RECORD_MODES));
240 const gint64 cur_time,
241 const bool record_aps);
381 float normalized_val);
386automation_track_get_port (
Ports that transfer audio/midi/other signals to one another.
A region in the timeline.
NONNULL void automation_track_remove_region(AutomationTrack *self, Region *region)
Removes a region from the automation track.
NONNULL void automation_track_add_region(AutomationTrack *self, Region *region)
Adds an automation Region to the AutomationTrack.
NONNULL Region * automation_track_get_last_region(AutomationTrack *self)
Gets the last Region in the AutomationTrack.
AutomationTracklist * atl
Pointer to owner automation tracklist, if any.
NONNULL AutomationTrack * automation_track_clone(AutomationTrack *src)
Clones the AutomationTrack.
NONNULL float automation_track_get_val_at_pos(AutomationTrack *self, Position *pos, bool normalized, bool ends_after, bool use_snapshots)
Returns the actual parameter value at the given position.
bool created
Whether it has been created by the user yet or not.
bool recording_paused
This must only be set by the RecordingManager when temporarily pausing recording, eg when looping or ...
HOT AutomationTrack * automation_track_find_from_port(Port *port, Track *track, bool basic_search)
Finds the AutomationTrack associated with port.
NONNULL int automation_track_get_y_px_from_normalized_val(AutomationTrack *self, float normalized_val)
Returns the y pixels from the value based on the allocation of the automation track.
AutomationRecordMode record_mode
Automation record mode, when AutomationTrack::automation_mode is set to record.
AutomationModeWidget * am_widget
Automation mode button group.
int index
Index in parent AutomationTracklist.
NONNULL void automation_track_set_index(AutomationTrack *self, int index)
Sets the index of the AutomationTrack in the AutomationTracklist.
Port * port
Cache used during DSP.
bool recording_start_sent
This is a flag to let the recording manager know that a START signal was already sent for recording.
NONNULL AutomationTrack * automation_track_new(Port *port)
Creates an automation track for the given Port.
NONNULL void automation_track_insert_region(AutomationTrack *self, Region *region, int idx)
Inserts an automation Region to the AutomationTrack at the given index.
NONNULL void automation_track_clear(AutomationTrack *self)
Removes and frees all arranger objects recursively.
double height
Position of multipane handle.
NONNULL void automation_track_free(AutomationTrack *at)
Frees the automation track.
NONNULL void automation_track_update_positions(AutomationTrack *self, bool from_ticks, bool bpm_change)
Returns the visible y offset from the top of the track widget.
void automation_record_mode_get_localized(AutomationRecordMode mode, char *buf)
Gets the automation mode as a localized string.
Region ** regions
The automation Region's.
NONNULL AutomationTrack * automation_track_find_from_port_id(PortIdentifier *id, bool basic_search)
NONNULL void automation_track_unselect_all(AutomationTrack *self)
Unselects all arranger objects.
HOT NONNULL bool automation_track_should_be_recording(const AutomationTrack *const at, const gint64 cur_time, const bool record_aps)
Returns if the automation track should currently be recording data.
CustomButtonWidget * top_right_buttons[8]
Buttons used by the track widget.
AutomationMode automation_mode
Automation mode.
PortIdentifier port_id
Identifier of the Port this AutomationTrack is for.
void automation_mode_get_localized(AutomationMode mode, char *buf)
Gets the automation mode as a localized string.
NONNULL AutomationPoint * automation_track_get_ap_before_pos(const AutomationTrack *self, const Position *pos, bool ends_after, bool use_snapshots)
Returns the automation point before the Position on the timeline.
Region ** region_snapshots
Snapshots used during playback TODO unimplemented.
bool recording_started
To be set to true when recording starts (when the first change is received) and false when recording ...
Region * recording_region
Region currently recording to.
Region * automation_track_get_region_before_pos(const AutomationTrack *self, const Position *pos, bool ends_after, bool use_snapshots)
Returns the Region that starts before given Position, if any.
COLD NONNULL_ARGS(1) void automation_track_init_loaded(AutomationTrack *self
Inits a loaded AutomationTracklist.
float last_recorded_value
Last value recorded in this automation track.
HOT NONNULL bool automation_track_should_read_automation(AutomationTrack *at, gint64 cur_time)
Returns whether the automation in the automation track should be read.
bool visible
Whether visible or not.
An automation point inside an AutomationTrack.
Each track has an automation tracklist with automation tracks to be generated at runtime,...
Struct used to identify Ports in the project.
Must ONLY be created via port_new()
A Position is made up of bars.beats.sixteenths.ticks.
A region (clip) is an object on the timeline that contains either MidiNote's or AudioClip's.
Track to be inserted into the Project's Tracklist.