audio/track.h file

The backend for a timeline track.

Contents

Classes

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

Enums

enum TrackType { TRACK_TYPE_INSTRUMENT, TRACK_TYPE_AUDIO, TRACK_TYPE_MASTER, TRACK_TYPE_CHORD, TRACK_TYPE_MARKER, TRACK_TYPE_BUS, TRACK_TYPE_GROUP, TRACK_TYPE_MIDI }

Typedefs

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

Functions

void track_init(Track* track)
Only to be used by implementing structs.
auto track_new(TrackType type, char* label) -> Track*
Creates a track with the given label and returns it.
auto track_clone(Track* track) -> Track*
Clones the track and returns the clone.
static auto track_type_has_channel(TrackType type) -> int
Returns if the given TrackType is a type of Track that has a Channel.
void track_set_muted(Track* track, int mute, int trigger_undo)
Sets track muted and optionally adds the action to the undo stack.
void track_set_recording(Track* self, int recording)
Sets recording and connects/disconnects the JACK ports.
void track_set_soloed(Track* track, int solo, int trigger_undo)
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, Region* region, AutomationTrack* at, int lane_pos, int gen_name)
Adds a Region to the given lane or AutomationTrack of the track.
void track_remove_region(Track* track, Region* region, int free)
Removes the region from the track.
auto track_get_region_at_pos(const Track* track, const Position* pos) -> Region*
Returns the region at the given position, or NULL.
auto track_get_last_region(Track* track) -> Region*
Returns the last Region in the track, or NULL.
void track_setup(Track* track)
Wrapper.
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.
auto track_get_fader_automatable(Track* track) -> Automatable*
Wrapper for track types that have fader automatables.
void track_set_pos(Track* track, int pos)
Updates position in the tracklist and also updates the information in the lanes.
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(Track* track, const char* name)
Setter for the track name.
void track_add_modulator(Track* track, Modulator* modulator)
Adds and connects a Modulator to the Track.
void track_update_frames(Track* track)
Updates the frames of each position in each child of the track recursively.
void track_free(Track* track)
Wrapper for each track type.

Enum documentation

enum TrackType

Enumerators
TRACK_TYPE_INSTRUMENT

Instrument tracks must have an Instrument plugin at the first slot and they produce audio output.

TRACK_TYPE_AUDIO

Audio tracks can record and contain audio clips.

Other than that their channel strips are similar to buses.

TRACK_TYPE_MASTER

The master track is a special type of group track.

TRACK_TYPE_CHORD

The chord track contains chords that can be used to modify midi in real time or to color the piano roll.

TRACK_TYPE_MARKER

Marker Track's contain named markers at specific Position's in the song.

TRACK_TYPE_BUS

Buses are channels that receive audio input and have effects on their channel strip.

They are similar to Group Tracks, except that they cannot be routed to directly. Buses are used for send effects.

TRACK_TYPE_GROUP

Group Tracks are used for grouping audio signals, for example routing multiple drum tracks to a "Drums" group track.

Like buses, they only contain effects but unlike buses they can be routed to.

TRACK_TYPE_MIDI

Midi tracks can only have MIDI effects in the strip and produce MIDI output that can be routed to instrument channels or hardware.

Typedef documentation

typedef struct Track Track

Track to be inserted into the Project's Tracklist.

Each Track contains a Channel with Plugins.

Tracks shall be identified by ther position (index) in the Tracklist.

Function documentation

void track_init(Track* track)

Only to be used by implementing structs.

Sets member variables to default values.

Track* track_new(TrackType type, char* label)

Creates a track with the given label and returns it.

If the TrackType is one that needs a Channel, then a Channel is also created for the track.

void track_set_soloed(Track* track, int solo, int trigger_undo)

Sets track soloed and optionally adds the action to the undo stack.

Sets track soloed and optionally adds the action to the undo stack.

void track_add_region(Track* track, Region* region, AutomationTrack* at, int lane_pos, int gen_name)

Adds a Region to the given lane or AutomationTrack of the track.

Parameters
track
region
at The AutomationTrack of this Region, if automation region.
lane_pos The position of the lane to add to, if applicable.
gen_name Generate a unique region name or not. This will be 0 if the caller already generated a unique name.

The Region must be the main region (see ArrangerObjectInfo).

Adds a Region to the given lane or AutomationTrack of the track.

The Region must be the main region (see ArrangerObjectInfo).

void track_remove_region(Track* track, Region* region, int free)

Removes the region from the track.

free Also free the Region.

Removes the region from the track.

free Also free the Region.

Region* track_get_last_region(Track* track)

Returns the last Region in the track, or NULL.

Returns the last Region in the track, or NULL.

Automatable* track_get_fader_automatable(Track* track)

Wrapper for track types that have fader automatables.

Otherwise returns NULL.

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.

Parameters
track
start_pos
end_pos
velocities
num_velocities
velocities_size
inside Whether to find velocities inside the range (1) or outside (0).

const char* track_get_name(Track* track)

Getter for the track name.

Getter for the track name.

void track_set_name(Track* track, const char* name)

Setter for the track name.

If the track name is duplicate, it discards the new name.

If the track name is duplicate, it discards the new name.

Must only be called from the GTK thread.