Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
engine.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2018-2023 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-FileCopyrightText: © 2020 Ryan Gonzalez <rymg19 at gmail dot com>
3// SPDX-License-Identifier: LicenseRef-ZrythmLicense
4
11#ifndef __AUDIO_ENGINE_H__
12#define __AUDIO_ENGINE_H__
13
14#include "zrythm-config.h"
15
16#include "dsp/control_room.h"
17#include "dsp/exporter.h"
18#include "dsp/ext_port.h"
20#include "dsp/pan.h"
21#include "dsp/pool.h"
23#include "dsp/transport.h"
24#include "utils/types.h"
25
26#include "zix/sem.h"
27
28#ifdef HAVE_JACK
29# include "weak_libjack.h"
30#endif
31
32#ifdef HAVE_PULSEAUDIO
33# include <pulse/pulseaudio.h>
34#endif
35
36#ifdef HAVE_PORT_AUDIO
37# include <portaudio.h>
38#endif
39
40#ifdef HAVE_ALSA
41# include <alsa/asoundlib.h>
42#endif
43
44#ifdef HAVE_SDL
45# include <SDL2/SDL_audio.h>
46#endif
47
48#ifdef HAVE_RTAUDIO
49# include <rtaudio_c.h>
50#endif
51
52typedef struct StereoPorts StereoPorts;
53typedef struct Port Port;
54typedef struct Channel Channel;
55typedef struct Plugin Plugin;
56typedef struct Tracklist Tracklist;
57typedef struct ExtPort ExtPort;
58typedef struct MidiMappings MidiMappings;
59typedef struct WindowsMmeDevice WindowsMmeDevice;
60typedef struct Router Router;
61typedef struct Metronome Metronome;
62typedef struct Project Project;
64typedef struct ObjectPool ObjectPool;
65typedef struct MPMCQueue MPMCQueue;
66
73#define BLOCK_LENGTH 4096 // should be set by backend
74#define MIDI_BUF_SIZE 1024 // should be set by backend
75
76#define MIDI_IN_NUM_EVENTS AUDIO_ENGINE->midi_in->midi_events->num_events
77
78#define AUDIO_ENGINE (PROJECT->audio_engine)
79#define MANUAL_PRESS_EVENTS \
80 (AUDIO_ENGINE->midi_editor_manual_press->midi_events)
81
82#define DENORMAL_PREVENTION_VAL(engine_) (engine_->denormal_prevention_val)
83
84#define engine_is_in_active_project(self) (self->project == PROJECT)
85
88#define engine_set_run(engine, _run) g_atomic_int_set (&(engine)->run, _run)
89#define engine_get_run(engine) g_atomic_int_get (&(engine)->run)
90
91#define engine_has_handled_buffer_size_change(engine) \
92 ((engine)->audio_backend != AudioBackend::AUDIO_BACKEND_JACK || ((engine)->audio_backend == AudioBackend::AUDIO_BACKEND_JACK && g_atomic_int_get (&(engine)->handled_jack_buffer_size_change) == 1))
93
94#define ENGINE_MAX_EVENTS 100
95
96#define engine_queue_push_back_event(q, x) mpmc_queue_push_back (q, (void *) x)
97
98#define engine_queue_dequeue_event(q, x) mpmc_queue_dequeue (q, (void **) x)
99
103#define ENGINE_EVENTS_PUSH(et, _arg, _uint_arg, _float_arg) \
104 if (true) \
105 { \
106 AudioEngineEvent * _ev = \
107 (AudioEngineEvent *) object_pool_get (AUDIO_ENGINE->ev_pool); \
108 _ev->file = __FILE__; \
109 _ev->func = __func__; \
110 _ev->lineno = __LINE__; \
111 _ev->type = et; \
112 _ev->arg = (void *) _arg; \
113 _ev->uint_arg = _uint_arg; \
114 _ev->float_arg = _float_arg; \
115 if (zrythm_app->gtk_thread == g_thread_self ()) \
116 { \
117 _ev->backtrace = backtrace_get ("", 40, false); \
118 g_debug ( \
119 "pushing engine event " #et " (%s:%d) uint: %u | float: %f", \
120 __func__, __LINE__, _uint_arg, _float_arg); \
121 } \
122 engine_queue_push_back_event (AUDIO_ENGINE->ev_queue, _ev); \
123 }
124
129{
130 AUDIO_ENGINE_EVENT_BUFFER_SIZE_CHANGE,
131 AUDIO_ENGINE_EVENT_SAMPLE_RATE_CHANGE,
132};
133
137typedef struct AudioEngineEvent
138{
140 void * arg;
141 uint32_t uint_arg;
142 float float_arg;
143 const char * file;
144 const char * func;
145 int lineno;
146 char * backtrace;
148
153{
154 AUDIO_ENGINE_BUFFER_SIZE_16,
155 AUDIO_ENGINE_BUFFER_SIZE_32,
156 AUDIO_ENGINE_BUFFER_SIZE_64,
157 AUDIO_ENGINE_BUFFER_SIZE_128,
158 AUDIO_ENGINE_BUFFER_SIZE_256,
159 AUDIO_ENGINE_BUFFER_SIZE_512,
160 AUDIO_ENGINE_BUFFER_SIZE_1024,
161 AUDIO_ENGINE_BUFFER_SIZE_2048,
162 AUDIO_ENGINE_BUFFER_SIZE_4096,
163};
164
165static const char * buffer_size_str[] = {
166 "16", "32", "64", "128", "256",
167 "512", N_ ("1,024"), N_ ("2,048"), N_ ("4,096"),
168};
169
170static inline const char *
171engine_buffer_size_to_string (AudioEngineBufferSize buf_size)
172{
173 return buffer_size_str[static_cast<int> (buf_size)];
174}
175
180{
181 AUDIO_ENGINE_SAMPLERATE_22050,
182 AUDIO_ENGINE_SAMPLERATE_32000,
183 AUDIO_ENGINE_SAMPLERATE_44100,
184 AUDIO_ENGINE_SAMPLERATE_48000,
185 AUDIO_ENGINE_SAMPLERATE_88200,
186 AUDIO_ENGINE_SAMPLERATE_96000,
187 AUDIO_ENGINE_SAMPLERATE_192000,
188};
189
190static const char * sample_rate_str[] = {
191 N_ ("22,050"), N_ ("32,000"), N_ ("44,100"), N_ ("48,000"),
192 N_ ("88,200"), N_ ("96,000"), N_ ("192,000"),
193};
194
195static inline const char *
196engine_sample_rate_to_string (AudioEngineSamplerate sample_rate)
197{
198 return sample_rate_str[static_cast<int> (sample_rate)];
199}
200
201enum class AudioBackend
202{
203 AUDIO_BACKEND_DUMMY,
204 AUDIO_BACKEND_DUMMY_LIBSOUNDIO,
205 AUDIO_BACKEND_ALSA,
206 AUDIO_BACKEND_ALSA_LIBSOUNDIO,
207 AUDIO_BACKEND_ALSA_RTAUDIO,
208 AUDIO_BACKEND_JACK,
209 AUDIO_BACKEND_JACK_LIBSOUNDIO,
210 AUDIO_BACKEND_JACK_RTAUDIO,
211 AUDIO_BACKEND_PULSEAUDIO,
212 AUDIO_BACKEND_PULSEAUDIO_LIBSOUNDIO,
213 AUDIO_BACKEND_PULSEAUDIO_RTAUDIO,
214 AUDIO_BACKEND_COREAUDIO_LIBSOUNDIO,
215 AUDIO_BACKEND_COREAUDIO_RTAUDIO,
216 AUDIO_BACKEND_SDL,
217 AUDIO_BACKEND_WASAPI_LIBSOUNDIO,
218 AUDIO_BACKEND_WASAPI_RTAUDIO,
219 AUDIO_BACKEND_ASIO_RTAUDIO,
220};
221
222static inline bool
223audio_backend_is_rtaudio (AudioBackend backend)
224{
225 return backend == AudioBackend::AUDIO_BACKEND_ALSA_RTAUDIO
226 || backend == AudioBackend::AUDIO_BACKEND_JACK_RTAUDIO
227 || backend == AudioBackend::AUDIO_BACKEND_PULSEAUDIO_RTAUDIO
228 || backend == AudioBackend::AUDIO_BACKEND_COREAUDIO_RTAUDIO
229 || backend == AudioBackend::AUDIO_BACKEND_WASAPI_RTAUDIO
230 || backend == AudioBackend::AUDIO_BACKEND_ASIO_RTAUDIO;
231}
232
233__attribute__ ((unused)) static const char * audio_backend_str[] = {
234 /* TRANSLATORS: Dummy backend */
235 N_ ("Dummy"), N_ ("Dummy (libsoundio)"),
236 "ALSA (not working)", "ALSA (libsoundio)",
237 "ALSA (rtaudio)", "JACK",
238 "JACK (libsoundio)", "JACK (rtaudio)",
239 "PulseAudio", "PulseAudio (libsoundio)",
240 "PulseAudio (rtaudio)", "CoreAudio (libsoundio)",
241 "CoreAudio (rtaudio)", "SDL",
242 "WASAPI (libsoundio)", "WASAPI (rtaudio)",
243 "ASIO (rtaudio)",
244};
245
250enum class BounceMode
251{
254
256 BOUNCE_ON,
257
265};
266
267enum class MidiBackend
268{
269 MIDI_BACKEND_DUMMY,
270 MIDI_BACKEND_ALSA,
271 MIDI_BACKEND_ALSA_RTMIDI,
272 MIDI_BACKEND_JACK,
273 MIDI_BACKEND_JACK_RTMIDI,
274 MIDI_BACKEND_WINDOWS_MME,
275 MIDI_BACKEND_WINDOWS_MME_RTMIDI,
276 MIDI_BACKEND_COREMIDI_RTMIDI,
277 MIDI_BACKEND_WINDOWS_UWP_RTMIDI,
278};
279
280static inline bool
281midi_backend_is_rtmidi (MidiBackend backend)
282{
283 return backend == MidiBackend::MIDI_BACKEND_ALSA_RTMIDI
284 || backend == MidiBackend::MIDI_BACKEND_JACK_RTMIDI
285 || backend == MidiBackend::MIDI_BACKEND_WINDOWS_MME_RTMIDI
286 || backend == MidiBackend::MIDI_BACKEND_COREMIDI_RTMIDI
287 || backend == MidiBackend::MIDI_BACKEND_WINDOWS_UWP_RTMIDI;
288}
289
290static const char * midi_backend_str[] = {
291 /* TRANSLATORS: Dummy backend */
292 N_ ("Dummy"),
293 N_ ("ALSA Sequencer (not working)"),
294 N_ ("ALSA Sequencer (rtmidi)"),
295 "JACK MIDI",
296 "JACK MIDI (rtmidi)",
297 "Windows MME",
298 "Windows MME (rtmidi)",
299 "CoreMIDI (rtmidi)",
300 "Windows UWP (rtmidi)",
301};
302
303enum class AudioEngineJackTransportType
304{
305 AUDIO_ENGINE_JACK_TIMEBASE_MASTER,
306 AUDIO_ENGINE_JACK_TRANSPORT_CLIENT,
307 AUDIO_ENGINE_NO_JACK_TRANSPORT,
308};
309
311{
314
316 float bpm;
317
320
321 /* - below are used as cache to avoid re-calculations - */
322
324 int32_t bar;
325
327 int32_t beat;
328
330 int32_t sixteenth;
331
334
338
341
344
348
352typedef struct AudioEngine
353{
359 uint_fast64_t cycle;
360
361#ifdef HAVE_JACK
363 jack_client_t * client;
364#else
365 void * client;
366#endif
367
376
381 AudioEngineJackTransportType transport_type;
382
384 AudioBackend audio_backend;
385
387 MidiBackend midi_backend;
388
391
394
397
400
406
409
412
415
418
425
432
435
438
446
454
462
463#if 0
469 gint64 last_midi_activity;
470#endif
471
484
492
500
506
508 gint run;
509
512
515
517 gint panic;
518
519 // ZixSem alsa_callback_start;
520
521 /* ----------- ALSA --------------- */
522#ifdef HAVE_ALSA
524 snd_pcm_t * playback_handle;
525 snd_seq_t * seq_handle;
526 snd_pcm_hw_params_t * hw_params;
527 snd_pcm_sw_params_t * sw_params;
528
537 // MidiEvents alsa_midi_events;
538
541 // ZixSem alsa_midi_events_sem;
542#else
543 void * playback_handle;
544 void * seq_handle;
545 void * hw_params;
546 void * sw_params;
547#endif
548
551
552 /* ------------------------------- */
553
556
560
561#ifdef HAVE_PORT_AUDIO
562 PaStream * port_audio_stream;
563#else
564 void * port_audio_stream;
565#endif
566
575
576#ifdef _WIN32
578 WindowsMmeDevice * mme_in_devs[1024];
579 int num_mme_in_devs;
580 WindowsMmeDevice * mme_out_devs[1024];
581 int num_mme_out_devs;
582#else
583 void * mme_in_devs[1024];
584 int num_mme_in_devs;
585 void * mme_out_devs[1024];
586 int num_mme_out_devs;
587#endif
588
589#ifdef HAVE_SDL
590 SDL_AudioDeviceID dev;
591#else
592 uint32_t sdl_dev;
593#endif
594
595#ifdef HAVE_RTAUDIO
596 rtaudio_t rtaudio;
597#else
598 void * rtaudio;
599#endif
600
601#ifdef HAVE_PULSEAUDIO
602 pa_threaded_mainloop * pulse_mainloop;
603 pa_context * pulse_context;
604 pa_stream * pulse_stream;
605#else
606 void * pulse_mainloop;
607 void * pulse_context;
608 void * pulse_stream;
609#endif
610 gboolean pulse_notified_underflow;
611
616
619
624
625 /* note: these 2 are ignored at the moment */
630
633
637
641
645
648
651
656
657 SampleProcessor * sample_processor;
658
662
665
674
686 float denormal_prevention_val;
687
688 /* --- trial version flags --- */
689
693
697
698 /* --- end trial version flags --- */
699
708
710 BounceStep bounce_step;
711
715
718
719 /* --- events --- */
720
731
737
740
743
746
749
750 /* --- end events --- */
751
754
757
759 bool setup;
760
763
766
773
779
784
789
791
792void
793engine_realloc_port_buffers (AudioEngine * self, nframes_t buf_size);
794
795COLD NONNULL_ARGS (1) bool engine_init_loaded (
796 AudioEngine * self,
797 Project * project,
798 GError ** error);
799
806COLD WARN_UNUSED_RESULT AudioEngine *
807engine_new (Project * project);
808
809typedef struct EngineState
810{
818
824void
826 AudioEngine * self,
827 EngineState * state,
828 bool force_pause,
829 bool with_fadeout);
830
831void
832engine_resume (AudioEngine * self, EngineState * state);
833
839void
841
842void
843engine_append_ports (AudioEngine * self, GPtrArray * ports);
844
849void
851
856void
858
865COLD void
866engine_activate (AudioEngine * self, bool activate);
867
879void
881 AudioEngine * self,
882 const int beats_per_bar,
883 const bpm_t bpm,
884 const sample_rate_t sample_rate,
885 bool thread_check,
886 bool update_from_ticks,
887 bool bpm_change);
888
894int
896
905NONNULL HOT bool
907
914NONNULL HOT int
915engine_process (AudioEngine * self, const nframes_t total_frames_to_process);
916
925NONNULL HOT void
927 AudioEngine * self,
928 const nframes_t roll_nframes,
929 const nframes_t nframes);
930
935NONNULL void
937
942int
944
949int
951
960void
961engine_set_buffer_size (AudioEngine * self, uint32_t buf_size);
962
967#define engine_is_port_own(self, port) \
968 (port == MONITOR_FADER->stereo_in->l || port == MONITOR_FADER->stereo_in->r \
969 || port == MONITOR_FADER->stereo_out->l \
970 || port == MONITOR_FADER->stereo_out->r)
971
975const char *
976engine_audio_backend_to_string (AudioBackend backend);
977
978AudioBackend
979engine_audio_backend_from_string (const char * str);
980
984static inline const char *
985engine_midi_backend_to_string (MidiBackend backend)
986{
987 return midi_backend_str[static_cast<int> (backend)];
988}
989
990MidiBackend
991engine_midi_backend_from_string (const char * str);
992
997void
999
1008void
1009engine_set_default_backends (bool reset_to_dummy);
1010
1016COLD NONNULL AudioEngine *
1018
1022COLD NONNULL void
1024
1029#endif
The control room backend.
External ports.
NONNULL_ARGS(1) int undo_manager_undo(UndoManager *self
Undo last action.
AudioEngineSamplerate
Samplerates to be used in comboboxes.
Definition engine.h:180
AudioEngineEventType
Audio engine event type.
Definition engine.h:129
void engine_set_default_backends(bool reset_to_dummy)
Detects the best backends on the system and sets them to GSettings.
void engine_setup(AudioEngine *self)
Sets up the audio engine after the project is initialized/loaded.
void engine_wait_for_pause(AudioEngine *self, EngineState *state, bool force_pause, bool with_fadeout)
AudioEngineBufferSize
Buffer sizes to be used in combo boxes.
Definition engine.h:153
const char * engine_audio_backend_to_string(AudioBackend backend)
Returns the audio backend as a string.
COLD WARN_UNUSED_RESULT AudioEngine * engine_new(Project *project)
Create a new audio engine.
int engine_samplerate_enum_to_int(AudioEngineSamplerate samplerate)
Returns the int value corresponding to the given AudioEngineSamplerate.
void engine_pre_setup(AudioEngine *self)
Sets up the audio engine before the project is initialized/loaded.
void engine_wait_n_cycles(AudioEngine *self, int n)
Waits for n processing cycles to finish.
NONNULL HOT void engine_post_process(AudioEngine *self, const nframes_t roll_nframes, const nframes_t nframes)
To be called after processing for common logic.
NONNULL HOT bool engine_process_prepare(AudioEngine *self, nframes_t nframes)
To be called by each implementation to prepare the structures before processing.
COLD NONNULL void engine_free(AudioEngine *self)
Closes any connections and free's data.
void engine_reset_bounce_mode(AudioEngine *self)
Reset the bounce mode on the engine, all tracks and regions to OFF.
NONNULL 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.
BounceMode
Mode used when bouncing, either during exporting or when bouncing tracks or regions to audio.
Definition engine.h:251
COLD 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 bpm_t bpm, const sample_rate_t sample_rate, bool thread_check, bool update_from_ticks, bool bpm_change)
Updates frames per tick based on the time sig, the BPM, and the sample rate.
COLD NONNULL AudioEngine * engine_clone(const AudioEngine *src)
Clones the audio engine.
void engine_set_buffer_size(AudioEngine *self, uint32_t buf_size)
Request the backend to set the buffer size.
int engine_process_events(AudioEngine *self)
GSourceFunc to be added using idle add.
NONNULL HOT int engine_process(AudioEngine *self, const nframes_t total_frames_to_process)
Processes current cycle.
int engine_buffer_size_enum_to_int(AudioEngineBufferSize buffer_size)
Returns the int value corresponding to the given AudioEngineBufferSize.
@ BOUNCE_ON
Bounce.
@ BOUNCE_INHERIT
Bounce if parent is bouncing.
@ BOUNCE_OFF
Don't bounce.
uint32_t sample_rate_t
Sample rate.
Definition types.h:42
float bpm_t
The BPM type.
Definition types.h:54
uint32_t nframes_t
Frame count.
Definition types.h:39
uint8_t midi_byte_t
MIDI byte.
Definition types.h:36
Hardware processor for the routing graph.
Panning mono sources.
PanAlgorithm
See https://www.harmonycentral.com/articles/the-truth-about-panning-laws.
Definition pan.h:53
PanLaw
These are only useful when changing mono to stereo.
Definition pan.h:30
Audio file pool.
Sample processor.
Audio engine event.
Definition engine.h:138
int32_t beat
Current beat (within bar).
Definition engine.h:327
double tick_within_beat
Current tick-within-beat.
Definition engine.h:340
int32_t sixteenth_within_bar
Current sixteenth (within bar).
Definition engine.h:333
double tick_within_bar
Current tick (within bar).
Definition engine.h:343
int32_t ninetysixth_notes
Total 1/96th notes completed up to current pos.
Definition engine.h:346
int32_t sixteenth_within_song
Current sixteenth (within song, ie, total sixteenths).
Definition engine.h:337
bool is_rolling
Transport is rolling.
Definition engine.h:313
double playhead_ticks
Exact playhead position (in ticks).
Definition engine.h:319
int32_t bar
Current bar.
Definition engine.h:324
int32_t sixteenth
Current sixteenth (within beat).
Definition engine.h:330
The audio engine.
Definition engine.h:353
HardwareProcessor * hw_in_processor
Input device processor.
Definition engine.h:414
AudioEnginePositionInfo pos_nfo_at_end
Expected position info at the end of the current cycle.
Definition engine.h:788
double ticks_per_frame
Reciprocal of AudioEngine::frames_per_tick.
Definition engine.h:405
double frames_per_tick
Number of frames/samples per tick.
Definition engine.h:399
bool bounce_with_parents
Whether currently bouncing with parents (cache).
Definition engine.h:714
nframes_t remaining_latency_preroll
When first set, it is equal to the max playback latency of all initial trigger nodes.
Definition engine.h:655
nframes_t nframes
Number of frames/samples in the current cycle, per channel.
Definition engine.h:499
size_t midi_buf_size
Size of MIDI port buffers in bytes.
Definition engine.h:393
ControlRoom * control_room
The ControlRoom.
Definition engine.h:434
Port * midi_editor_manual_press
Manual note press events from the piano roll.
Definition engine.h:483
gint64 last_timestamp_start
Timestamp at start of previous cycle.
Definition engine.h:647
int capture_cc
To be set to 1 when the CC from the Midi in port should be captured.
Definition engine.h:661
bool setup
Whether the engine is already set up.
Definition engine.h:759
gint cycle_running
Whether the cycle is currently running.
Definition engine.h:753
PanLaw pan_law
Pan law.
Definition engine.h:627
gint64 last_events_process_started
Time last event processing started.
Definition engine.h:745
gint64 zrythm_start_time
Time at start to keep track if trial limit is reached.
Definition engine.h:692
gint handled_jack_buffer_size_change
Whether pending jack buffer change was handled (buffers reallocated).
Definition engine.h:375
gint64 timestamp_start
Timestamp at the start of the current cycle.
Definition engine.h:640
AudioEnginePositionInfo pos_nfo_before
Position info at the end of the previous cycle before moving the transport.
Definition engine.h:778
int processing_events
Whether currently processing events.
Definition engine.h:742
StereoPorts * dummy_input
Used during tests to pass input data for recording.
Definition engine.h:445
Port * midi_in
Port used for receiving MIDI in messages for binding CC and other non-recording purposes.
Definition engine.h:491
AudioBackend audio_backend
Current audio backend.
Definition engine.h:384
sample_rate_t sample_rate
Sample rate.
Definition engine.h:396
nframes_t block_length
Audio buffer size (block length), per channel.
Definition engine.h:390
float * port_audio_out_buf
Port Audio output buffer.
Definition engine.h:574
AudioPool * pool
Audio file pool.
Definition engine.h:437
AudioEngineJackTransportType transport_type
Whether transport master/client or no connection with jack transport.
Definition engine.h:381
Metronome * metronome
The metronome.
Definition engine.h:717
int limit_reached
Flag to keep track of the first time the limit is reached.
Definition engine.h:696
MPMCQueue * ev_queue
Event queue.
Definition engine.h:730
bool updating_frames_per_tick
True while updating frames per tick.
Definition engine.h:772
gint exporting
1 if currently exporting.
Definition engine.h:514
gint filled_stereo_out_bufs
Flag used when processing in some backends.
Definition engine.h:555
MidiBackend midi_backend
Current MIDI backend.
Definition engine.h:387
bool preparing_to_export
To be set to true when preparing to export.
Definition engine.h:511
gint64 last_xrun_notification
Last time an XRUN notification was shown.
Definition engine.h:673
StereoPorts * monitor_out
Monitor - these should be the last ports in the signal chain.
Definition engine.h:453
gint panic
Send note off MIDI everywhere.
Definition engine.h:517
Router * router
The processing graph router.
Definition engine.h:411
gint preparing_for_process
Flag used to check if we are inside engine_process_prepare().
Definition engine.h:559
gint64 last_events_processed
Time last event processing completed.
Definition engine.h:748
BounceMode bounce_mode
If this is on, only tracks/regions marked as "for bounce" will be allowed to make sound.
Definition engine.h:707
guint process_source_id
ID of the event processing source func.
Definition engine.h:739
BounceStep bounce_step
Bounce step cache.
Definition engine.h:710
ObjectPool * ev_pool
Object pool of event structs to avoid allocation.
Definition engine.h:736
ZixSem port_operation_lock
Semaphore for blocking DSP while a plugin and its ports are deleted.
Definition engine.h:505
AudioEnginePositionInfo pos_nfo_current
Position info at the start of the current cycle.
Definition engine.h:783
Project * project
Pointer to owner project, if any.
Definition engine.h:765
gint64 max_time_taken
Max time taken to process in the last few cycles.
Definition engine.h:636
float * alsa_out_buf
ALSA audio buffer.
Definition engine.h:550
Transport * transport
Timeline metadata like BPM, time signature, etc.
Definition engine.h:623
gint64 last_timestamp_end
Timestamp at end of previous cycle.
Definition engine.h:650
bool denormal_prevention_val_positive
Whether the denormal prevention value (1e-12 ~ 1e-20) is positive.
Definition engine.h:685
Port * midi_clock_out
MIDI Clock output.
Definition engine.h:431
GThread * dummy_audio_thread
Dummy audio DSP processing thread.
Definition engine.h:615
uint_fast64_t cycle
Cycle count to know which cycle we are in.
Definition engine.h:359
gint64 last_time_taken
Time taken to process in the last cycle.
Definition engine.h:632
PanAlgorithm pan_algo
Pan algorithm.
Definition engine.h:629
bool pre_setup
Whether the engine is already pre-set up.
Definition engine.h:756
Port * midi_clock_in
MIDI Clock input TODO.
Definition engine.h:424
midi_byte_t last_cc[3]
Last MIDI CC captured.
Definition engine.h:664
gint64 timestamp_end
Expected timestamp at the end of the current cycle.
Definition engine.h:644
int stop_dummy_audio_thread
Set to 1 to stop the dummy audio thread.
Definition engine.h:618
HardwareProcessor * hw_out_processor
Output device processor.
Definition engine.h:417
int trigger_midi_activity
Flag to tell the UI that this channel had MIDI activity.
Definition engine.h:461
int buf_size_set
True iff buffer size callback fired.
Definition engine.h:408
gint run
Ok to process or not.
Definition engine.h:508
bool activated
Whether the engine is currently activated.
Definition engine.h:762
An audio pool is a pool of audio files and their corresponding float arrays in memory that are refere...
Definition pool.h:39
A Channel is part of a Track (excluding Tracks that don't have Channels) and contains information rel...
Definition channel.h:57
The control room allows to specify how Listen will work on each Channel and to set overall volume aft...
bool looping
Transport loop.
Definition engine.h:816
int running
Engine running.
Definition engine.h:812
bool playing
Playback.
Definition engine.h:814
External port.
Definition ext_port.h:69
Hardware processor.
Multiple Producer Multiple Consumer lock-free queue.
Definition mpmc_queue.h:69
Metronome settings.
Definition metronome.h:41
All MIDI mappings in Zrythm.
The base plugin Inheriting plugins must have this as a child.
Definition plugin.h:74
Must ONLY be created via port_new()
Definition port.h:136
Contains all of the info that will be serialized into a project file.
Definition project.h:145
A processor to be used in the routing graph for playing samples independent of the timeline.
L & R port, for convenience.
Definition port.h:501
The Tracklist contains all the tracks in the Project.
Definition tracklist.h:61
The transport.
Definition transport.h:151
Transport API.
Custom types.