audio/engine.h file

Contents

The audio engine.

Classes

struct AudioEngine
The audio engine.

Enums

enum AudioEngineBufferSize { AUDIO_ENGINE_BUFFER_SIZE_16, AUDIO_ENGINE_BUFFER_SIZE_32, AUDIO_ENGINE_BUFFER_SIZE_64, AUDIO_ENGINE_BUFFER_SIZE_128, AUDIO_ENGINE_BUFFER_SIZE_256, AUDIO_ENGINE_BUFFER_SIZE_512, AUDIO_ENGINE_BUFFER_SIZE_1024, AUDIO_ENGINE_BUFFER_SIZE_2048, AUDIO_ENGINE_BUFFER_SIZE_4096, NUM_AUDIO_ENGINE_BUFFER_SIZES }
Buffer sizes to be used in combo boxes.
enum AudioEngineSamplerate { AUDIO_ENGINE_SAMPLERATE_22050, AUDIO_ENGINE_SAMPLERATE_32000, AUDIO_ENGINE_SAMPLERATE_44100, AUDIO_ENGINE_SAMPLERATE_48000, AUDIO_ENGINE_SAMPLERATE_88200, AUDIO_ENGINE_SAMPLERATE_96000, AUDIO_ENGINE_SAMPLERATE_192000, NUM_AUDIO_ENGINE_SAMPLERATES }
Samplerates to be used in comboboxes.
enum BounceMode { BOUNCE_OFF, BOUNCE_ON, BOUNCE_INHERIT }
Mode used when bouncing, either during exporting or when bouncing tracks or regions to audio.

Typedefs

using AudioEngineBufferSize = enum AudioEngineBufferSize
Buffer sizes to be used in combo boxes.
using AudioEngineSamplerate = enum AudioEngineSamplerate
Samplerates to be used in comboboxes.
using BounceMode = enum BounceMode
Mode used when bouncing, either during exporting or when bouncing tracks or regions to audio.
using AudioEngine = struct AudioEngine
The audio engine.

Functions

auto engine_new(Project* project) -> AudioEngine*
Create a new audio engine.
void engine_setup(AudioEngine* self)
Set up the audio engine, ie, connect to the backend but does not start processing yet.
void engine_activate(AudioEngine* self, bool activate)
Activates the audio engine to start processing and receiving events.
void engine_update_frames_per_tick(AudioEngine* self, const int beats_per_bar, const float bpm, const sample_rate_t sample_rate)
Updates frames per tick based on the time sig, the BPM, and the sample rate.
void engine_process_prepare(AudioEngine* self, nframes_t nframes)
To be called by each implementation to prepare the structures before processing.
auto engine_process(AudioEngine* self, nframes_t nframes) -> int
Processes current cycle.
void engine_post_process(AudioEngine* self, const nframes_t nframes)
To be called after processing for common logic.
void engine_fill_out_bufs(AudioEngine* self, const nframes_t nframes)
Called to fill in the external buffers at the end of the processing cycle.
auto engine_buffer_size_enum_to_int(AudioEngineBufferSize buffer_size) -> int
Returns the int value correesponding to the given AudioEngineBufferSize.
auto engine_samplerate_enum_to_int(AudioEngineSamplerate samplerate) -> int
Returns the int value correesponding to the given AudioEngineSamplerate.
static auto engine_audio_backend_to_string(AudioBackend backend) -> const char*
Returns the audio backend as a string.
static auto engine_midi_backend_to_string(MidiBackend backend) -> const char*
Returns the MIDI backend as a string.
void engine_reset_bounce_mode(AudioEngine* self)
Reset the bounce mode on the engine, all tracks and regions to OFF.
void engine_free(AudioEngine* self)
Closes any connections and free's data.

Defines

#define engine_set_run(engine, _run)
Set whether engine should process (true) or skip (false).
#define engine_is_port_own(self, port)
Returns 1 if the port is an engine port or control room port, otherwise 0.