audio/track.h file


The backend for a timeline track.


struct Track
Track to be inserted into the Project's Tracklist.


The Track's type.


using TrackType = enum TrackType
The Track's type.
using Track = struct Track
Track to be inserted into the Project's Tracklist.


void track_init(Track* self, const int add_lane)
Inits the Track, optionally adding a single lane.
auto track_new(TrackType type, int pos, const char* label, const int with_lane) -> Track*
Creates a track with the given label and returns it.
auto track_clone(Track* track, bool src_is_project) -> Track*
Clones the track and returns the clone.
auto track_type_has_channel(TrackType type) -> bool
Returns if the given TrackType is a type of Track that has a Channel.
void track_set_muted(Track* track, bool mute, bool trigger_undo, bool fire_events)
Sets track muted and optionally adds the action to the undo stack.
auto track_get_full_visible_height(Track* self) -> int
Returns the full visible height (main height + height of all visible automation tracks + height of all visible lanes).
auto track_get_soloed(Track* self) -> bool
Returns if the track is soloed.
auto track_get_implied_soloed(Track* self) -> bool
Returns whether the track is not soloed on its own but its direct out (or its direct out's direct out, etc.) is soloed.
auto track_get_muted(Track* self) -> bool
Returns if the track is muted.
void track_set_recording(Track* track, bool recording, bool fire_events)
Sets recording and connects/disconnects the JACK ports.
void track_set_soloed(Track* track, bool solo, bool trigger_undo, bool fire_events)
Sets track soloed and optionally adds the action to the undo stack.
auto track_is_selected(Track* self) -> int
Returns if Track is in TracklistSelections.
void track_add_region(Track* track, ZRegion* region, AutomationTrack* at, int lane_pos, int gen_name, int fire_events)
Adds a ZRegion to the given lane or AutomationTrack of the track.
void track_insert_region(Track* track, ZRegion* region, AutomationTrack* at, int lane_pos, int idx, int gen_name, int fire_events)
Inserts a ZRegion to the given lane or AutomationTrack of the track, at the given index.
void track_write_to_midi_file(Track* self, MIDI_FILE* mf)
Writes the track to the given MIDI file.
void track_select(Track* self, int select, int exclusive, int fire_events)
Appends the Track to the selections.
void track_unselect_all(Track* self)
Unselects all arranger objects in the track.
void track_clear(Track* self)
Removes all objects recursively from the track.
void track_remove_region(Track* self, ZRegion* region, bool fire_events, bool free)
Only removes the region from the track.
auto track_verify_identifiers(Track* self) -> bool
Verifies the identifiers on a live Track (in the project, not a clone).
auto track_get_region_at_pos(const Track* track, const Position* pos) -> ZRegion*
Returns the region at the given position, or NULL.
auto track_get_last_region(Track* track) -> ZRegion*
Returns the last ZRegion in the track, or NULL.
void track_set_lanes_visible(Track* track, const int visible)
Set track lanes visible and fire events.
void track_set_automation_visible(Track* track, const bool visible)
Set automation visible and fire events.
auto track_type_can_host_region_type(const TrackType tt, const RegionType rt) -> int
Returns if the given TrackType can host the given RegionType.
static auto track_type_can_record(const TrackType type) -> int
Returns if the Track can record.
void track_generate_automation_tracks(Track* track)
Generates automatables for the track.
void track_setup(Track* track)
auto track_get_automation_tracklist(Track* track) -> AutomationTracklist*
Returns the automation tracklist if the track type has one, or NULL if it doesn't (like chord tracks).
auto track_get_channel(Track* track) -> Channel*
Returns the channel of the track, if the track type has a channel, or NULL if it doesn't.
void track_set_pos(Track* track, int pos)
Updates position in the tracklist and also updates the information in the lanes.
auto track_has_piano_roll(const Track* track) -> int
Returns if the Track should have a piano roll.
static auto track_has_inputs(const Track* track) -> int
Returns if the Track should have an inputs selector.
void track_get_velocities_in_range(const Track* track, const Position* start_pos, const Position* end_pos, Velocity*** velocities, int* num_velocities, int* velocities_size, int inside)
Fills in the array with all the velocities in the project that are within or outside the range given.
auto track_get_name(Track* track) -> const char*
Getter for the track name.
void track_set_name_with_action(Track* track, const char* name)
Setter to be used by the UI to create an undoable action.
void track_set_name(Track* track, const char* _name, bool pub_events)
Setter for the track name.
auto track_get_from_name(const char* name) -> Track*
Returns the Track from the Project matching name.
static auto track_type_is_compatible_for_moving(const TrackType type1, const TrackType type2) -> int
Returns if regions in tracks from type1 can be moved to type2.
void track_update_frames(Track* track)
Updates the frames of each position in each child of the track recursively.
auto track_get_fader(Track* track, bool post_fader) -> Fader*
Returns the Fader (if applicable).
auto track_get_fader_type(const Track* track) -> FaderType
Returns the FaderType corresponding to the given Track.
auto track_type_get_prefader_type(TrackType type) -> FaderType
Returns the prefader type corresponding to the given Track.
void track_create_missing_lanes(Track* track, const int pos)
Creates missing TrackLane's until pos.
void track_remove_empty_last_lanes(Track* track)
Removes the empty last lanes of the Track (except the last one).
auto track_get_regions_in_range(Track* self, Position* p1, Position* p2, ZRegion** regions) -> int
Returns all the regions inside the given range, or all the regions if both p1 and p2 are NULL.
void track_set_comment(void* track, const char* comment)
Comment setter.
auto track_get_comment(void* track) -> const char*
Comment getter.
void track_set_color(Track* self, const GdkRGBA* color, bool undoable, bool fire_events)
Sets the track color.
void track_set_icon(Track* self, const char* icon_name, bool undoable, bool fire_events)
Sets the track icon.
void track_set_is_project(Track* self, bool is_project)
Recursively marks the track and children as project objects or not.
auto track_get_plugin_at_slot(Track* track, PluginSlotType slot_type, int slot) -> Plugin*
Returns the plugin at the given slot, if any.
void track_mark_for_bounce(Track* self, bool bounce, bool mark_regions, bool mark_children)
Marks the track for bouncing.
void track_append_all_ports(Track* self, Port*** ports, int* size, bool is_dynamic, int* max_size, bool include_plugins)
Appends all channel ports and optionally plugin ports to the array.
void track_freeze(Track* self, bool freeze)
Freezes or unfreezes the track.
void track_insert_plugin(Track* self, Plugin* pl, PluginSlotType slot_type, int slot, bool replacing_plugin, bool moving_plugin, bool confirm, bool gen_automatables, bool recalc_graph, bool fire_events)
Wrapper over channel_add_plugin() and modulator_track_insert_modulator().
void track_remove_plugin(Track* self, PluginSlotType slot_type, int slot, bool replacing_plugin, bool moving_plugin, bool deleting_plugin, bool deleting_track, bool recalc_graph)
Wrapper over channel_remove_plugin() and modulator_track_remove_modulator().
void track_disconnect(Track* self, bool remove_pl, bool recalc_graph)
Disconnects the track from the processing chain.
void track_free(Track* track)
Wrapper for each track type.