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 (AUDIO_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 != AUDIO_BACKEND_JACK || \
93 ((engine)->audio_backend == AUDIO_BACKEND_JACK && \
94 g_atomic_int_get (&(engine)->handled_jack_buffer_size_change) == 1))
95
96#define ENGINE_MAX_EVENTS 100
97
98#define engine_queue_push_back_event(q, x) mpmc_queue_push_back (q, (void *) x)
99
100#define engine_queue_dequeue_event(q, x) mpmc_queue_dequeue (q, (void *) x)
101
105#define ENGINE_EVENTS_PUSH(et, _arg, _uint_arg, _float_arg) \
106 if (true) \
107 { \
108 AudioEngineEvent * _ev = \
109 (AudioEngineEvent *) object_pool_get (AUDIO_ENGINE->ev_pool); \
110 _ev->file = __FILE__; \
111 _ev->func = __func__; \
112 _ev->lineno = __LINE__; \
113 _ev->type = et; \
114 _ev->arg = (void *) _arg; \
115 _ev->uint_arg = _uint_arg; \
116 _ev->float_arg = _float_arg; \
117 if (zrythm_app->gtk_thread == g_thread_self ()) \
118 { \
119 _ev->backtrace = backtrace_get ("", 40, false); \
120 g_debug ( \
121 "pushing engine event " #et " (%s:%d) uint: %u | float: %f", \
122 __func__, __LINE__, _uint_arg, _float_arg); \
123 } \
124 engine_queue_push_back_event (AUDIO_ENGINE->ev_queue, _ev); \
125 }
126
131{
132 AUDIO_ENGINE_EVENT_BUFFER_SIZE_CHANGE,
133 AUDIO_ENGINE_EVENT_SAMPLE_RATE_CHANGE,
135
139typedef struct AudioEngineEvent
140{
142 void * arg;
143 uint32_t uint_arg;
144 float float_arg;
145 const char * file;
146 const char * func;
147 int lineno;
148 char * backtrace;
150
155{
156 AUDIO_ENGINE_BUFFER_SIZE_16,
157 AUDIO_ENGINE_BUFFER_SIZE_32,
158 AUDIO_ENGINE_BUFFER_SIZE_64,
159 AUDIO_ENGINE_BUFFER_SIZE_128,
160 AUDIO_ENGINE_BUFFER_SIZE_256,
161 AUDIO_ENGINE_BUFFER_SIZE_512,
162 AUDIO_ENGINE_BUFFER_SIZE_1024,
163 AUDIO_ENGINE_BUFFER_SIZE_2048,
164 AUDIO_ENGINE_BUFFER_SIZE_4096,
165 NUM_AUDIO_ENGINE_BUFFER_SIZES,
167
168static const char * buffer_size_str[] = {
169 "16", "32", "64", "128", "256",
170 "512", N_ ("1,024"), N_ ("2,048"), N_ ("4,096"),
171};
172
173static inline const char *
174engine_buffer_size_to_string (AudioEngineBufferSize buf_size)
175{
176 return buffer_size_str[buf_size];
177}
178
183{
184 AUDIO_ENGINE_SAMPLERATE_22050,
185 AUDIO_ENGINE_SAMPLERATE_32000,
186 AUDIO_ENGINE_SAMPLERATE_44100,
187 AUDIO_ENGINE_SAMPLERATE_48000,
188 AUDIO_ENGINE_SAMPLERATE_88200,
189 AUDIO_ENGINE_SAMPLERATE_96000,
190 AUDIO_ENGINE_SAMPLERATE_192000,
191 NUM_AUDIO_ENGINE_SAMPLERATES,
193
194static const char * sample_rate_str[] = {
195 N_ ("22,050"), N_ ("32,000"), N_ ("44,100"), N_ ("48,000"),
196 N_ ("88,200"), N_ ("96,000"), N_ ("192,000"),
197};
198
199static inline const char *
200engine_sample_rate_to_string (AudioEngineSamplerate sample_rate)
201{
202 return sample_rate_str[sample_rate];
203}
204
205typedef enum AudioBackend
206{
207 AUDIO_BACKEND_DUMMY,
208 AUDIO_BACKEND_DUMMY_LIBSOUNDIO,
209 AUDIO_BACKEND_ALSA,
210 AUDIO_BACKEND_ALSA_LIBSOUNDIO,
211 AUDIO_BACKEND_ALSA_RTAUDIO,
212 AUDIO_BACKEND_JACK,
213 AUDIO_BACKEND_JACK_LIBSOUNDIO,
214 AUDIO_BACKEND_JACK_RTAUDIO,
215 AUDIO_BACKEND_PULSEAUDIO,
216 AUDIO_BACKEND_PULSEAUDIO_LIBSOUNDIO,
217 AUDIO_BACKEND_PULSEAUDIO_RTAUDIO,
218 AUDIO_BACKEND_COREAUDIO_LIBSOUNDIO,
219 AUDIO_BACKEND_COREAUDIO_RTAUDIO,
220 AUDIO_BACKEND_SDL,
221 AUDIO_BACKEND_WASAPI_LIBSOUNDIO,
222 AUDIO_BACKEND_WASAPI_RTAUDIO,
223 AUDIO_BACKEND_ASIO_RTAUDIO,
224 NUM_AUDIO_BACKENDS,
225} AudioBackend;
226
227static inline bool
228audio_backend_is_rtaudio (AudioBackend backend)
229{
230 return backend == AUDIO_BACKEND_ALSA_RTAUDIO
231 || backend == AUDIO_BACKEND_JACK_RTAUDIO
232 || backend == AUDIO_BACKEND_PULSEAUDIO_RTAUDIO
233 || backend == AUDIO_BACKEND_COREAUDIO_RTAUDIO
234 || backend == AUDIO_BACKEND_WASAPI_RTAUDIO
235 || backend == AUDIO_BACKEND_ASIO_RTAUDIO;
236}
237
238__attribute__ ((unused)) static const char * audio_backend_str[] = {
239 /* TRANSLATORS: Dummy backend */
240 N_ ("Dummy"), N_ ("Dummy (libsoundio)"),
241 "ALSA (not working)", "ALSA (libsoundio)",
242 "ALSA (rtaudio)", "JACK",
243 "JACK (libsoundio)", "JACK (rtaudio)",
244 "PulseAudio", "PulseAudio (libsoundio)",
245 "PulseAudio (rtaudio)", "CoreAudio (libsoundio)",
246 "CoreAudio (rtaudio)", "SDL",
247 "WASAPI (libsoundio)", "WASAPI (rtaudio)",
248 "ASIO (rtaudio)",
249};
250
271
272typedef enum MidiBackend
273{
274 MIDI_BACKEND_DUMMY,
275 MIDI_BACKEND_ALSA,
276 MIDI_BACKEND_ALSA_RTMIDI,
277 MIDI_BACKEND_JACK,
278 MIDI_BACKEND_JACK_RTMIDI,
279 MIDI_BACKEND_WINDOWS_MME,
280 MIDI_BACKEND_WINDOWS_MME_RTMIDI,
281 MIDI_BACKEND_COREMIDI_RTMIDI,
282 MIDI_BACKEND_WINDOWS_UWP_RTMIDI,
283 NUM_MIDI_BACKENDS,
284} MidiBackend;
285
286static inline bool
287midi_backend_is_rtmidi (MidiBackend backend)
288{
289 return backend == MIDI_BACKEND_ALSA_RTMIDI || backend == MIDI_BACKEND_JACK_RTMIDI
290 || backend == MIDI_BACKEND_WINDOWS_MME_RTMIDI
291 || backend == MIDI_BACKEND_COREMIDI_RTMIDI
292 || backend == MIDI_BACKEND_WINDOWS_UWP_RTMIDI;
293}
294
295static const char * midi_backend_str[] = {
296 /* TRANSLATORS: Dummy backend */
297 N_ ("Dummy"),
298 N_ ("ALSA Sequencer (not working)"),
299 N_ ("ALSA Sequencer (rtmidi)"),
300 "JACK MIDI",
301 "JACK MIDI (rtmidi)",
302 "Windows MME",
303 "Windows MME (rtmidi)",
304 "CoreMIDI (rtmidi)",
305 "Windows UWP (rtmidi)",
306};
307
308typedef enum AudioEngineJackTransportType
309{
310 AUDIO_ENGINE_JACK_TIMEBASE_MASTER,
311 AUDIO_ENGINE_JACK_TRANSPORT_CLIENT,
312 AUDIO_ENGINE_NO_JACK_TRANSPORT,
313} AudioEngineJackTransportType;
314
316{
319
321 float bpm;
322
325
326 /* - below are used as cache to avoid re-calculations - */
327
329 int32_t bar;
330
332 int32_t beat;
333
335 int32_t sixteenth;
336
339
343
346
349
353
357typedef struct AudioEngine
358{
364 uint_fast64_t cycle;
365
366#ifdef HAVE_JACK
368 jack_client_t * client;
369#else
370 void * client;
371#endif
372
381
386 AudioEngineJackTransportType transport_type;
387
389 AudioBackend audio_backend;
390
392 MidiBackend midi_backend;
393
396
399
402
405
411
414
417
420
423
430
437
440
443
451
459
467
468#if 0
474 gint64 last_midi_activity;
475#endif
476
489
497
505
511
513 gint run;
514
517
520
522 gint panic;
523
524 // ZixSem alsa_callback_start;
525
526 /* ----------- ALSA --------------- */
527#ifdef HAVE_ALSA
529 snd_pcm_t * playback_handle;
530 snd_seq_t * seq_handle;
531 snd_pcm_hw_params_t * hw_params;
532 snd_pcm_sw_params_t * sw_params;
533
542 // MidiEvents alsa_midi_events;
543
546 // ZixSem alsa_midi_events_sem;
547#else
548 void * playback_handle;
549 void * seq_handle;
550 void * hw_params;
551 void * sw_params;
552#endif
553
556
557 /* ------------------------------- */
558
561
565
566#ifdef HAVE_PORT_AUDIO
567 PaStream * pa_stream;
568#else
569 void * pa_stream;
570#endif
571
579 float * pa_out_buf;
580
581#ifdef _WOE32
583 WindowsMmeDevice * mme_in_devs[1024];
584 int num_mme_in_devs;
585 WindowsMmeDevice * mme_out_devs[1024];
586 int num_mme_out_devs;
587#else
588 void * mme_in_devs[1024];
589 int num_mme_in_devs;
590 void * mme_out_devs[1024];
591 int num_mme_out_devs;
592#endif
593
594#ifdef HAVE_SDL
595 SDL_AudioDeviceID dev;
596#else
597 uint32_t sdl_dev;
598#endif
599
600#ifdef HAVE_RTAUDIO
601 rtaudio_t rtaudio;
602#else
603 void * rtaudio;
604#endif
605
606#ifdef HAVE_PULSEAUDIO
607 pa_threaded_mainloop * pulse_mainloop;
608 pa_context * pulse_context;
609 pa_stream * pulse_stream;
610#else
611 void * pulse_mainloop;
612 void * pulse_context;
613 void * pulse_stream;
614#endif
615 gboolean pulse_notified_underflow;
616
621
624
629
630 /* note: these 2 are ignored at the moment */
635
638
642
646
650
653
656
661
662 SampleProcessor * sample_processor;
663
667
670
679
691 float denormal_prevention_val;
692
693 /* --- trial version flags --- */
694
698
702
703 /* --- end trial version flags --- */
704
713
715 BounceStep bounce_step;
716
720
723
724 /* --- events --- */
725
738
744
747
750
753
756
757 /* --- end events --- */
758
761
764
766 bool setup;
767
770
773
780
786
791
796
798
799void
800engine_realloc_port_buffers (AudioEngine * self, nframes_t buf_size);
801
802COLD NONNULL_ARGS (1) bool engine_init_loaded (
803 AudioEngine * self,
804 Project * project,
805 GError ** error);
806
813COLD WARN_UNUSED_RESULT AudioEngine *
814engine_new (Project * project);
815
816typedef struct EngineState
817{
825
831void
833 AudioEngine * self,
834 EngineState * state,
835 bool force_pause,
836 bool with_fadeout);
837
838void
839engine_resume (AudioEngine * self, EngineState * state);
840
846void
848
849void
850engine_append_ports (AudioEngine * self, GPtrArray * ports);
851
856void
858
863void
865
872COLD void
873engine_activate (AudioEngine * self, bool activate);
874
886void
888 AudioEngine * self,
889 const int beats_per_bar,
890 const bpm_t bpm,
891 const sample_rate_t sample_rate,
892 bool thread_check,
893 bool update_from_ticks,
894 bool bpm_change);
895
901int
903
912NONNULL HOT bool
914
921NONNULL HOT int
922engine_process (AudioEngine * self, const nframes_t total_frames_to_process);
923
932NONNULL HOT void
934 AudioEngine * self,
935 const nframes_t roll_nframes,
936 const nframes_t nframes);
937
942NONNULL void
944
949int
951
956int
958
967void
968engine_set_buffer_size (AudioEngine * self, uint32_t buf_size);
969
974#define engine_is_port_own(self, port) \
975 (port == MONITOR_FADER->stereo_in->l || port == MONITOR_FADER->stereo_in->r \
976 || port == MONITOR_FADER->stereo_out->l \
977 || port == MONITOR_FADER->stereo_out->r)
978
982const char *
983engine_audio_backend_to_string (AudioBackend backend);
984
985AudioBackend
986engine_audio_backend_from_string (const char * str);
987
991static inline const char *
992engine_midi_backend_to_string (MidiBackend backend)
993{
994 return midi_backend_str[backend];
995}
996
997MidiBackend
998engine_midi_backend_from_string (const char * str);
999
1004void
1006
1015void
1016engine_set_default_backends (bool reset_to_dummy);
1017
1023COLD NONNULL AudioEngine *
1025
1029COLD NONNULL void
1031
1036#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:183
AudioEngineEventType
Audio engine event type.
Definition engine.h:131
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:155
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:256
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_OFF
Don't bounce.
Definition engine.h:258
@ BOUNCE_INHERIT
Bounce if parent is bouncing.
Definition engine.h:269
@ BOUNCE_ON
Bounce.
Definition engine.h:261
uint32_t sample_rate_t
Sample rate.
Definition types.h:38
float bpm_t
The BPM type.
Definition types.h:50
uint32_t nframes_t
Frame count.
Definition types.h:35
uint8_t midi_byte_t
MIDI byte.
Definition types.h:32
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:140
int32_t beat
Current beat (within bar).
Definition engine.h:332
double tick_within_beat
Current tick-within-beat.
Definition engine.h:345
int32_t sixteenth_within_bar
Current sixteenth (within bar).
Definition engine.h:338
double tick_within_bar
Current tick (within bar).
Definition engine.h:348
int32_t ninetysixth_notes
Total 1/96th notes completed up to current pos.
Definition engine.h:351
int32_t sixteenth_within_song
Current sixteenth (within song, ie, total sixteenths).
Definition engine.h:342
bool is_rolling
Transport is rolling.
Definition engine.h:318
double playhead_ticks
Exact playhead position (in ticks).
Definition engine.h:324
int32_t bar
Current bar.
Definition engine.h:329
int32_t sixteenth
Current sixteenth (within beat).
Definition engine.h:335
The audio engine.
Definition engine.h:358
HardwareProcessor * hw_in_processor
Input device processor.
Definition engine.h:419
AudioEnginePositionInfo pos_nfo_at_end
Expected position info at the end of the current cycle.
Definition engine.h:795
double ticks_per_frame
Reciprocal of AudioEngine::frames_per_tick.
Definition engine.h:410
double frames_per_tick
Number of frames/samples per tick.
Definition engine.h:404
bool bounce_with_parents
Whether currently bouncing with parents (cache).
Definition engine.h:719
nframes_t remaining_latency_preroll
When first set, it is equal to the max playback latency of all initial trigger nodes.
Definition engine.h:660
nframes_t nframes
Number of frames/samples in the current cycle, per channel.
Definition engine.h:504
size_t midi_buf_size
Size of MIDI port buffers in bytes.
Definition engine.h:398
ControlRoom * control_room
The ControlRoom.
Definition engine.h:439
Port * midi_editor_manual_press
Manual note press events from the piano roll.
Definition engine.h:488
gint64 last_timestamp_start
Timestamp at start of previous cycle.
Definition engine.h:652
int capture_cc
To be set to 1 when the CC from the Midi in port should be captured.
Definition engine.h:666
bool setup
Whether the engine is already set up.
Definition engine.h:766
gint cycle_running
Whether the cycle is currently running.
Definition engine.h:760
PanLaw pan_law
Pan law.
Definition engine.h:632
gint64 last_events_process_started
Time last event processing started.
Definition engine.h:752
gint64 zrythm_start_time
Time at start to keep track if trial limit is reached.
Definition engine.h:697
gint handled_jack_buffer_size_change
Whether pending jack buffer change was handled (buffers reallocated).
Definition engine.h:380
gint64 timestamp_start
Timestamp at the start of the current cycle.
Definition engine.h:645
AudioEnginePositionInfo pos_nfo_before
Position info at the end of the previous cycle before moving the transport.
Definition engine.h:785
int processing_events
Whether currently processing events.
Definition engine.h:749
StereoPorts * dummy_input
Used during tests to pass input data for recording.
Definition engine.h:450
Port * midi_in
Port used for receiving MIDI in messages for binding CC and other non-recording purposes.
Definition engine.h:496
AudioBackend audio_backend
Current audio backend.
Definition engine.h:389
sample_rate_t sample_rate
Sample rate.
Definition engine.h:401
nframes_t block_length
Audio buffer size (block length), per channel.
Definition engine.h:395
AudioPool * pool
Audio file pool.
Definition engine.h:442
AudioEngineJackTransportType transport_type
Whether transport master/client or no connection with jack transport.
Definition engine.h:386
Metronome * metronome
The metronome.
Definition engine.h:722
int limit_reached
Flag to keep track of the first time the limit is reached.
Definition engine.h:701
MPMCQueue * ev_queue
Event queue.
Definition engine.h:737
bool updating_frames_per_tick
True while updating frames per tick.
Definition engine.h:779
gint exporting
1 if currently exporting.
Definition engine.h:519
gint filled_stereo_out_bufs
Flag used when processing in some backends.
Definition engine.h:560
MidiBackend midi_backend
Current MIDI backend.
Definition engine.h:392
bool preparing_to_export
To be set to true when preparing to export.
Definition engine.h:516
gint64 last_xrun_notification
Last time an XRUN notification was shown.
Definition engine.h:678
StereoPorts * monitor_out
Monitor - these should be the last ports in the signal chain.
Definition engine.h:458
gint panic
Send note off MIDI everywhere.
Definition engine.h:522
Router * router
The processing graph router.
Definition engine.h:416
gint preparing_for_process
Flag used to check if we are inside engine_process_prepare().
Definition engine.h:564
gint64 last_events_processed
Time last event processing completed.
Definition engine.h:755
BounceMode bounce_mode
If this is on, only tracks/regions marked as "for bounce" will be allowed to make sound.
Definition engine.h:712
guint process_source_id
ID of the event processing source func.
Definition engine.h:746
BounceStep bounce_step
Bounce step cache.
Definition engine.h:715
ObjectPool * ev_pool
Object pool of event structs to avoid allocation.
Definition engine.h:743
ZixSem port_operation_lock
Semaphore for blocking DSP while a plugin and its ports are deleted.
Definition engine.h:510
AudioEnginePositionInfo pos_nfo_current
Position info at the start of the current cycle.
Definition engine.h:790
Project * project
Pointer to owner project, if any.
Definition engine.h:772
float * pa_out_buf
Port Audio output buffer.
Definition engine.h:579
gint64 max_time_taken
Max time taken to process in the last few cycles.
Definition engine.h:641
float * alsa_out_buf
ALSA audio buffer.
Definition engine.h:555
Transport * transport
Timeline metadata like BPM, time signature, etc.
Definition engine.h:628
gint64 last_timestamp_end
Timestamp at end of previous cycle.
Definition engine.h:655
bool denormal_prevention_val_positive
Whether the denormal prevention value (1e-12 ~ 1e-20) is positive.
Definition engine.h:690
Port * midi_clock_out
MIDI Clock output.
Definition engine.h:436
GThread * dummy_audio_thread
Dummy audio DSP processing thread.
Definition engine.h:620
uint_fast64_t cycle
Cycle count to know which cycle we are in.
Definition engine.h:364
gint64 last_time_taken
Time taken to process in the last cycle.
Definition engine.h:637
PanAlgorithm pan_algo
Pan algorithm.
Definition engine.h:634
bool pre_setup
Whether the engine is already pre-set up.
Definition engine.h:763
Port * midi_clock_in
MIDI Clock input TODO.
Definition engine.h:429
midi_byte_t last_cc[3]
Last MIDI CC captured.
Definition engine.h:669
gint64 timestamp_end
Expected timestamp at the end of the current cycle.
Definition engine.h:649
int stop_dummy_audio_thread
Set to 1 to stop the dummy audio thread.
Definition engine.h:623
HardwareProcessor * hw_out_processor
Output device processor.
Definition engine.h:422
int trigger_midi_activity
Flag to tell the UI that this channel had MIDI activity.
Definition engine.h:466
int buf_size_set
True iff buffer size callback fired.
Definition engine.h:413
gint run
Ok to process or not.
Definition engine.h:513
bool activated
Whether the engine is currently activated.
Definition engine.h:769
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:61
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:823
int running
Engine running.
Definition engine.h:819
bool playing
Playback.
Definition engine.h:821
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:139
Contains all of the info that will be serialized into a project file.
Definition project.h:146
A processor to be used in the routing graph for playing samples independent of the timeline.
L & R port, for convenience.
Definition port.h:505
The Tracklist contains all the tracks in the Project.
Definition tracklist.h:61
The transport.
Definition transport.h:148
Transport API.
Custom types.