audio/transport.h file

Transport API.



struct Transport
The transport.


Corrseponts to "transport-display" in the gsettings.
Recording mode for MIDI and audio.


using TransportDisplay = enum TransportDisplay
Corrseponts to "transport-display" in the gsettings.
using TransportRecordingMode = enum TransportRecordingMode
Recording mode for MIDI and audio.
using Transport = struct Transport
The transport.


auto transport_new(AudioEngine* engine) -> Transport*
Initialize transport.
auto transport_clone(Transport* self) -> Transport*
Clones the transport values.
void transport_prepare_audio_regions_for_stretch(Transport* self, TimelineSelections* sel)
Prepares audio regions for stretching (sets the ZRegion::before_length).
void transport_stretch_audio_regions(Transport* self, TimelineSelections* sel, bool with_fixed_ratio, double time_ratio)
Stretches audio regions.
void transport_set_time_sig(Transport* self, TimeSignature* time_sig)
Updates beat unit and anything depending on it.
void transport_set_metronome_enabled(Transport* self, const int enabled)
Sets whether metronome is enabled or not.
void transport_add_to_playhead(Transport* self, const long nframes)
Moves the playhead by the time corresponding to given samples, taking into account the loop end point.
void transport_set_playhead_pos(Transport* self, Position* pos)
Setter for playhead Position.
void transport_get_playhead_pos(Transport* self, Position* pos)
Getter for playhead Position.
void transport_move_backward(Transport* self)
Move to the previous snap point on the timeline.
void transport_move_forward(Transport* self)
Move to the next snap point on the timeline.
void transport_move_playhead(Transport* self, Position* target, bool panic, bool set_cue_point)
Moves playhead to given pos.
void transport_set_loop(Transport* self, bool enabled)
Enables or disables loop.
void transport_goto_prev_marker(Transport* self)
Moves the playhead to the prev Marker.
void transport_goto_next_marker(Transport* self)
Moves the playhead to the next Marker.
void transport_update_position_frames(Transport* self)
Updates the frames in all transport positions.
void transport_position_add_frames(const Transport* self, Position* pos, const long frames)
Adds frames to the given position similar to position_add_frames, except that it adjusts the new Position if the loop end point was crossed.
auto transport_get_ppqn(Transport* self) -> double
Returns the PPQN (Parts/Ticks Per Quarter Note).
void transport_get_range_pos(Transport* self, bool first, Position* pos)
Stores the position of the range in pos.
void transport_set_has_range(Transport* self, bool has_range)
Sets if the project has range and updates UI.
auto transport_is_loop_point_met(const Transport* self, const long g_start_frames, const nframes_t nframes) -> HOT nframes_t
Returns the number of processable frames until and excluding the loop end point as a positive number (>= 1) if the loop point was met between g_start_frames and (g_start_frames + nframes), otherwise returns 0;.
void transport_recalculate_total_bars(Transport* self)
Recalculates the total bars based on the last object's position.
void transport_update_total_bars(Transport* self, int total_bars, bool fire_events)
Updates the total bars.
void transport_set_recording(Transport* self, bool record, bool fire_events)
Sets recording on/off.