Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
recording_manager.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2019, 2023 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
10#ifndef __AUDIO_RECORDING_MANAGER_H__
11#define __AUDIO_RECORDING_MANAGER_H__
12
13#include "utils/types.h"
14
15#include "zix/sem.h"
16
17typedef struct ObjectPool ObjectPool;
18typedef struct TrackProcessor TrackProcessor;
19typedef struct MPMCQueue MPMCQueue;
20
27#define RECORDING_MANAGER (ZRYTHM->recording_manager)
28
29typedef struct RecordingManager
30{
33
36
42
45
47 guint source_id;
48
56 int num_recorded_ids;
57
59 GPtrArray * pending_aps;
60
61 bool currently_processing;
62 ZixSem processing_sem;
63
64 bool freeing;
66
80REALTIME
81void
83 RecordingManager * self,
84 const TrackProcessor * track_processor,
85 const EngineProcessTimeInfo * const time_nfo);
86
96int
98
106
107void
108recording_manager_free (RecordingManager * self);
109
114#endif
RecordingManager * recording_manager_new(void)
Creates the event queue and starts the event loop.
REALTIME void recording_manager_handle_recording(RecordingManager *self, const TrackProcessor *track_processor, const EngineProcessTimeInfo *const time_nfo)
Handles the recording logic inside the process cycle.
int recording_manager_process_events(RecordingManager *self)
GSourceFunc to be added using idle add.
Common struct to pass around during processing to avoid repeating the data in function arguments.
Definition types.h:137
Multiple Producer Multiple Consumer lock-free queue.
Definition mpmc_queue.h:69
ArrangerSelections * selections_before_start
Cloned selections before starting recording.
guint source_id
Source func ID.
MPMCQueue * event_queue
Event queue.
ObjectPool * event_obj_pool
Memory pool of event structs to avoid real time allocation.
RegionIdentifier recorded_ids[8000]
Recorded region identifiers, to be used for creating the undoable actions.
GPtrArray * pending_aps
Pending recorded automation points.
int num_active_recordings
Number of recordings currently in progress.
Index/identifier for a Region, so we can get Region objects quickly with it without searching by name...
A TrackProcessor is a processor that is used as the first entry point when processing a track.
Custom types.