|
Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
|
The Transport class represents the transport controls and state for an audio engine. More...
#include <src/dsp/transport.h>


Data Structures | |
| struct | ConfigProvider |
| class | TransportSnapshot |
Public Types | |
| enum class | Display { BBT , Time } |
| Corrseponts to "transport-display" in the gsettings. More... | |
| enum class | RecordingMode { OverwriteEvents , MergeEvents , Takes , TakesMuted } |
| Recording mode for MIDI and audio. More... | |
| Public Types inherited from zrythm::dsp::ITransport | |
| enum class | PlayState : std::uint8_t { RollRequested , Rolling , PauseRequested , Paused } |
Public Member Functions | |
| Transport (const dsp::TempoMap &tempo_map, ConfigProvider config_provider, QObject *parent=nullptr) | |
| bool | loopEnabled () const |
| void | setLoopEnabled (bool enabled) |
| Q_SIGNAL void | loopEnabledChanged (bool enabled) |
| bool | recordEnabled () const |
| void | setRecordEnabled (bool enabled) |
| Q_SIGNAL void | recordEnabledChanged (bool enabled) |
| bool | punchEnabled () const |
| void | setPunchEnabled (bool enabled) |
| Q_SIGNAL void | punchEnabledChanged (bool enabled) |
| PlayState | getPlayState () const |
| void | setPlayState (PlayState state) |
| Q_SIGNAL void | playStateChanged (PlayState state) |
| dsp::PlayheadQmlWrapper * | playhead () const |
| dsp::AtomicPositionQmlAdapter * | cuePosition () const |
| dsp::AtomicPositionQmlAdapter * | loopStartPosition () const |
| dsp::AtomicPositionQmlAdapter * | loopEndPosition () const |
| dsp::AtomicPositionQmlAdapter * | punchInPosition () const |
| dsp::AtomicPositionQmlAdapter * | punchOutPosition () const |
| Q_INVOKABLE void | requestPause () |
| Request pause. | |
| Q_INVOKABLE void | requestRoll () |
| Request playback. | |
| units::sample_t | get_playhead_position_in_audio_thread () const noexcept override |
| Get the playhead position. | |
| std::pair< units::sample_t, units::sample_t > | get_loop_range_positions () const noexcept override |
| Returns the loop range positions in samples. | |
| std::pair< units::sample_t, units::sample_t > | get_punch_range_positions () const noexcept override |
| Returns the punch recording range positions in samples. | |
| PlayState | get_play_state () const noexcept override |
| bool | loop_enabled () const noexcept override |
| bool | punch_enabled () const noexcept override |
| bool | recording_enabled () const noexcept override |
| Returns whether recording is enabled. | |
| units::sample_t | recording_preroll_frames_remaining () const noexcept override |
| Frames remaining to preroll (playing back some time earlier before actually recording/rolling). | |
| units::sample_t | metronome_countin_frames_remaining () const noexcept override |
| Frames remaining for metronome countin. | |
| Q_INVOKABLE bool | isRolling () const |
| Q_INVOKABLE bool | isPaused () const |
| void | add_to_playhead_in_audio_thread (units::sample_t nframes) |
| Moves the playhead by the time corresponding to given samples, taking into account the loop end point. | |
| void | set_play_state_rt_safe (PlayState state) |
| void | move_playhead (units::precise_tick_t target_ticks, bool set_cue_point) |
| Moves playhead to given pos. | |
| void | goto_prev_or_next_marker (bool prev, RangeOf< units::precise_tick_t > auto &&extra_markers) |
| Moves the playhead to the previous or next marker. | |
| bool | position_is_inside_punch_range (units::sample_t pos) |
| auto | playhead_ticks_before_pause () const |
| void | consume_metronome_countin_samples (units::sample_t samples) |
| For engine use only. | |
| void | consume_recording_preroll_samples (units::sample_t samples) |
| For engine use only. | |
| auto | get_snapshot () const |
| Public Member Functions inherited from zrythm::dsp::ITransport | |
| units::sample_t | get_playhead_position_after_adding_frames_in_audio_thread (const units::sample_t current_playhead_position, const units::sample_t frames_to_add) const noexcept |
| Gets the playhead position, similarly to get_playhead_position(), except that it adjusts the new position if the loop end point was crossed. | |
| bool | has_recording_preroll_frames_remaining () const noexcept |
| units::sample_t | is_loop_point_met_in_audio_thread (units::sample_t g_start_frames, units::sample_t nframes) const noexcept |
| 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;. | |
Friends | |
| void | init_from (Transport &obj, const Transport &other, utils::ObjectCloneType clone_type) |
| void | to_json (nlohmann::json &j, const Transport &transport) |
| void | from_json (const nlohmann::json &j, Transport &transport) |
The Transport class represents the transport controls and state for an audio engine.
It manages playback, recording, and other transport-related functionality.
Definition at line 43 of file transport.h.
|
strong |
Corrseponts to "transport-display" in the gsettings.
Definition at line 72 of file transport.h.
|
strong |
Recording mode for MIDI and audio.
In all cases, only objects created during the current recording cycle can be changed. Previous objects shall not be touched.
Definition at line 85 of file transport.h.
|
inline |
For engine use only.
| samples | Samples to consume. |
Definition at line 433 of file transport.h.
|
inline |
For engine use only.
| samples | Samples to consume. |
Definition at line 444 of file transport.h.
|
inline |
Definition at line 258 of file transport.h.
|
inlineoverridevirtualnoexcept |
Returns the loop range positions in samples.
Implements zrythm::dsp::ITransport.
Definition at line 302 of file transport.h.
|
inlineoverridevirtualnoexcept |
Implements zrythm::dsp::ITransport.
Definition at line 315 of file transport.h.
|
inlineoverridevirtualnoexcept |
Get the playhead position.
Implements zrythm::dsp::ITransport.
Definition at line 296 of file transport.h.
|
inlineoverridevirtualnoexcept |
Returns the punch recording range positions in samples.
Implements zrythm::dsp::ITransport.
Definition at line 309 of file transport.h.
|
inline |
Definition at line 450 of file transport.h.
|
inline |
Moves the playhead to the previous or next marker.
| prev | True for previous, false for next. |
Definition at line 367 of file transport.h.
|
inline |
Definition at line 336 of file transport.h.
|
inline |
Definition at line 331 of file transport.h.
|
inlineoverridevirtualnoexcept |
Implements zrythm::dsp::ITransport.
Definition at line 317 of file transport.h.
|
inline |
Definition at line 238 of file transport.h.
|
inline |
Definition at line 266 of file transport.h.
|
inline |
Definition at line 262 of file transport.h.
|
inlineoverridevirtualnoexcept |
Frames remaining for metronome countin.
Implements zrythm::dsp::ITransport.
Definition at line 324 of file transport.h.
| void zrythm::dsp::Transport::move_playhead | ( | units::precise_tick_t | target_ticks, |
| bool | set_cue_point ) |
Moves playhead to given pos.
This is only for moves other than while playing and for looping while playing.
Should not be used during exporting.
| target_ticks | Position to set to. |
| set_cue_point | Also set the cue point at this position. |
|
inline |
Definition at line 254 of file transport.h.
|
inline |
Definition at line 423 of file transport.h.
|
inlineoverridevirtualnoexcept |
Implements zrythm::dsp::ITransport.
Definition at line 318 of file transport.h.
|
inline |
Definition at line 246 of file transport.h.
|
inline |
Definition at line 270 of file transport.h.
|
inline |
Definition at line 274 of file transport.h.
|
inline |
Definition at line 242 of file transport.h.
|
inlineoverridevirtualnoexcept |
Returns whether recording is enabled.
Implements zrythm::dsp::ITransport.
Definition at line 319 of file transport.h.
|
inlineoverridevirtualnoexcept |
Frames remaining to preroll (playing back some time earlier before actually recording/rolling).
Preroll is a number of frames earlier to start at before the punch in position during recording.
Implements zrythm::dsp::ITransport.
Definition at line 320 of file transport.h.
|
read |
Definition at line 52 of file transport.h.
|
readwrite |
Definition at line 47 of file transport.h.
|
read |
Definition at line 54 of file transport.h.
|
read |
Definition at line 53 of file transport.h.
|
read |
Definition at line 51 of file transport.h.
|
readwrite |
Definition at line 50 of file transport.h.
|
readwrite |
Definition at line 49 of file transport.h.
|
read |
Definition at line 56 of file transport.h.
|
read |
Definition at line 58 of file transport.h.
|
readwrite |
Definition at line 48 of file transport.h.