|
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. | |
| Q_INVOKABLE void | movePlayhead (double ticks, bool setCuePoint) |
| Moves the playhead to the given tick position. | |
| 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 44 of file transport.h.
|
strong |
Corrseponts to "transport-display" in the gsettings.
Definition at line 73 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 86 of file transport.h.
|
inline |
For engine use only.
| samples | Samples to consume. |
Definition at line 442 of file transport.h.
|
inline |
For engine use only.
| samples | Samples to consume. |
Definition at line 453 of file transport.h.
|
inline |
Definition at line 259 of file transport.h.
|
inlineoverridevirtualnoexcept |
Returns the loop range positions in samples.
Implements zrythm::dsp::ITransport.
Definition at line 314 of file transport.h.
|
inlineoverridevirtualnoexcept |
Implements zrythm::dsp::ITransport.
Definition at line 327 of file transport.h.
|
inlineoverridevirtualnoexcept |
Get the playhead position.
Implements zrythm::dsp::ITransport.
Definition at line 308 of file transport.h.
|
inlineoverridevirtualnoexcept |
Returns the punch recording range positions in samples.
Implements zrythm::dsp::ITransport.
Definition at line 321 of file transport.h.
|
inline |
Definition at line 459 of file transport.h.
|
inline |
Moves the playhead to the previous or next marker.
| prev | True for previous, false for next. |
Definition at line 380 of file transport.h.
|
inline |
Definition at line 348 of file transport.h.
|
inline |
Definition at line 343 of file transport.h.
|
inlineoverridevirtualnoexcept |
Implements zrythm::dsp::ITransport.
Definition at line 329 of file transport.h.
|
inline |
Definition at line 239 of file transport.h.
|
inline |
Definition at line 267 of file transport.h.
|
inline |
Definition at line 263 of file transport.h.
|
inlineoverridevirtualnoexcept |
Frames remaining for metronome countin.
Implements zrythm::dsp::ITransport.
Definition at line 336 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. For example it should be used for moves when the user clicks on a position in the ruler.
Should not be used during exporting.
| target_ticks | Position to set to. |
| set_cue_point | Also set the cue point at this position. |
| Q_INVOKABLE void zrythm::dsp::Transport::movePlayhead | ( | double | ticks, |
| bool | setCuePoint ) |
Moves the playhead to the given tick position.
This is intended for user-initiated playhead moves (e.g., clicking on the ruler).
| ticks | The target position in ticks. |
| setCuePoint | If true, also sets the cue position to this position. |
|
inline |
Definition at line 255 of file transport.h.
|
inline |
Definition at line 432 of file transport.h.
|
inlineoverridevirtualnoexcept |
Implements zrythm::dsp::ITransport.
Definition at line 330 of file transport.h.
|
inline |
Definition at line 247 of file transport.h.
|
inline |
Definition at line 271 of file transport.h.
|
inline |
Definition at line 275 of file transport.h.
|
inline |
Definition at line 243 of file transport.h.
|
inlineoverridevirtualnoexcept |
Returns whether recording is enabled.
Implements zrythm::dsp::ITransport.
Definition at line 331 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 332 of file transport.h.
|
read |
Definition at line 53 of file transport.h.
|
readwrite |
Definition at line 48 of file transport.h.
|
read |
Definition at line 55 of file transport.h.
|
read |
Definition at line 54 of file transport.h.
|
read |
Definition at line 52 of file transport.h.
|
readwrite |
Definition at line 51 of file transport.h.
|
readwrite |
Definition at line 50 of file transport.h.
|
read |
Definition at line 57 of file transport.h.
|
read |
Definition at line 59 of file transport.h.
|
readwrite |
Definition at line 49 of file transport.h.