The audio engine.
More...
#include <src/dsp/engine.h>
|
| enum class | State : std::uint8_t { Uninitialized
, Initialized
, Active
} |
| enum class | ProcessReturnStatus : std::uint8_t { ProcessCompleted
, ProcessSkipped
, ProcessFailed
} |
|
| | AudioEngine (dsp::Transport &transport, const dsp::TempoMap &tempo_map, std::shared_ptr< juce::AudioDeviceManager > device_mgr, dsp::DspGraphDispatcher &graph_dispatcher, QObject *parent=nullptr) |
| | Create a new audio engine.
|
|
| ~AudioEngine () override |
| | Closes any connections and free's data.
|
| Q_INVOKABLE int | xRunCount () const |
| Q_INVOKABLE double | loadPercentage () const |
| int | sampleRate () const |
|
Q_SIGNAL void | sampleRateChanged (int sampleRate) |
| void | wait_for_pause (EngineState &state, bool force_pause, bool with_fadeout) |
|
void | resume (const EngineState &state) |
| void | activate (bool activate) |
| | Activates the audio engine to start processing and receiving events.
|
| bool | process_prepare (dsp::Transport::TransportSnapshot &transport_snapshot, nframes_t nframes, SemaphoreRAII< moodycamel::LightweightSemaphore > &sem) noexcept |
| | To be called by each implementation to prepare the structures before processing.
|
| auto | process (const dsp::PlayheadProcessingGuard &playhead_guard, nframes_t total_frames_to_process) noexcept -> ProcessReturnStatus |
| | Processes current cycle.
|
| void | advance_playhead_after_processing (dsp::Transport::TransportSnapshot &transport_snapshot, const dsp::PlayheadProcessingGuard &playhead_guard, nframes_t roll_nframes, nframes_t nframes) noexcept |
| | Advances the playhead if transport is rolling.
|
| auto & | get_monitor_out_port () |
| auto * | midi_panic_processor () const |
|
void | panic_all () |
| | Queues MIDI note off to event queues.
|
| auto | get_device_manager () const |
| bool | activated () const |
| bool | running () const |
| void | set_running (bool run) |
| auto & | graph_dispatcher () |
| bool | exporting () const |
| void | set_exporting (bool exporting) |
| auto | get_processing_lock () |
| nframes_t | get_block_length () const |
| units::sample_rate_t | get_sample_rate () const |
| void | execute_function_with_paused_processing_synchronously (const std::function< void()> &func, bool recalculate_graph) |
| | Executes the given function after pausing processing and then resumes processing.
|
The audio engine.
Definition at line 21 of file engine.h.
◆ ProcessReturnStatus
| enum class zrythm::dsp::AudioEngine::ProcessReturnStatus : std::uint8_t |
|
strong |
◆ State
| enum class zrythm::dsp::AudioEngine::State : std::uint8_t |
|
strong |
◆ AudioEngine()
| zrythm::dsp::AudioEngine::AudioEngine |
( |
dsp::Transport & | transport, |
|
|
const dsp::TempoMap & | tempo_map, |
|
|
std::shared_ptr< juce::AudioDeviceManager > | device_mgr, |
|
|
dsp::DspGraphDispatcher & | graph_dispatcher, |
|
|
QObject * | parent = nullptr ) |
Create a new audio engine.
This only initializes the engine and does not connect to any backend.
◆ activate()
| void zrythm::dsp::AudioEngine::activate |
( |
bool | activate | ) |
|
Activates the audio engine to start processing and receiving events.
- Parameters
-
| activate | Activate or deactivate. |
◆ activated()
| bool zrythm::dsp::AudioEngine::activated |
( |
| ) |
const |
|
inline |
◆ advance_playhead_after_processing()
Advances the playhead if transport is rolling.
- Parameters
-
| roll_nframes | Frames to roll (add to the playhead - if transport rolling). |
| nframes | Total frames for this processing cycle. |
◆ execute_function_with_paused_processing_synchronously()
| void zrythm::dsp::AudioEngine::execute_function_with_paused_processing_synchronously |
( |
const std::function< void()> & | func, |
|
|
bool | recalculate_graph ) |
Executes the given function after pausing processing and then resumes processing.
- Parameters
-
| recalculate_graph | Whether to also recreate the processing graph before resuming processing. |
◆ exporting()
| bool zrythm::dsp::AudioEngine::exporting |
( |
| ) |
const |
|
inline |
◆ get_block_length()
| nframes_t zrythm::dsp::AudioEngine::get_block_length |
( |
| ) |
const |
|
inline |
◆ get_device_manager()
| auto zrythm::dsp::AudioEngine::get_device_manager |
( |
| ) |
const |
|
inline |
◆ get_monitor_out_port()
| auto & zrythm::dsp::AudioEngine::get_monitor_out_port |
( |
| ) |
|
|
inline |
◆ get_processing_lock()
| auto zrythm::dsp::AudioEngine::get_processing_lock |
( |
| ) |
|
|
inline |
◆ get_sample_rate()
| units::sample_rate_t zrythm::dsp::AudioEngine::get_sample_rate |
( |
| ) |
const |
|
inline |
◆ graph_dispatcher()
| auto & zrythm::dsp::AudioEngine::graph_dispatcher |
( |
| ) |
|
|
inline |
◆ loadPercentage()
| Q_INVOKABLE double zrythm::dsp::AudioEngine::loadPercentage |
( |
| ) |
const |
|
inline |
◆ midi_panic_processor()
| auto * zrythm::dsp::AudioEngine::midi_panic_processor |
( |
| ) |
const |
|
inline |
◆ process()
Processes current cycle.
To be called by each implementation in its callback.
◆ process_prepare()
To be called by each implementation to prepare the structures before processing.
Clears buffers, marks all as unprocessed, etc.
- Parameters
-
| sem | SemamphoreRAII to check if acquired. If not acquired before calling this function, it will only clear output buffers and return true. |
- Returns
- Whether the cycle should be skipped.
◆ running()
| bool zrythm::dsp::AudioEngine::running |
( |
| ) |
const |
|
inline |
◆ sampleRate()
| int zrythm::dsp::AudioEngine::sampleRate |
( |
| ) |
const |
|
inline |
◆ set_exporting()
| void zrythm::dsp::AudioEngine::set_exporting |
( |
bool | exporting | ) |
|
|
inline |
◆ set_running()
| void zrythm::dsp::AudioEngine::set_running |
( |
bool | run | ) |
|
|
inline |
◆ wait_for_pause()
| void zrythm::dsp::AudioEngine::wait_for_pause |
( |
EngineState & | state, |
|
|
bool | force_pause, |
|
|
bool | with_fadeout ) |
- Parameters
-
| force_pause | Whether to force transport pause, otherwise for engine to process and handle the pause request. |
◆ xRunCount()
| Q_INVOKABLE int zrythm::dsp::AudioEngine::xRunCount |
( |
| ) |
const |
|
inline |
◆ sampleRate
| int zrythm::dsp::AudioEngine::sampleRate |
|
read |
The documentation for this class was generated from the following file: