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
14#include "utils/types.h"
15
16#include "zix/sem.h"
17
18typedef struct ObjectPool ObjectPool;
19typedef struct TrackProcessor TrackProcessor;
20typedef struct MPMCQueue MPMCQueue;
22
29#define RECORDING_MANAGER (gZrythm->recording_manager)
30
31typedef struct RecordingManager
32{
35
38
44
47
49 guint source_id;
50
58 int num_recorded_ids;
59
61 GPtrArray * pending_aps;
62
63 bool currently_processing;
64 ZixSem processing_sem;
65
66 bool freeing;
68
82REALTIME
83void
85 RecordingManager * self,
86 const TrackProcessor * track_processor,
87 const EngineProcessTimeInfo * time_nfo);
88
98int
100
108
109void
110recording_manager_free (RecordingManager * self);
111
116#endif
RecordingManager * recording_manager_new()
Creates the event queue and starts the event loop.
int recording_manager_process_events(RecordingManager *self)
GSourceFunc to be added using idle add.
REALTIME void recording_manager_handle_recording(RecordingManager *self, const TrackProcessor *track_processor, const EngineProcessTimeInfo *time_nfo)
Handles the recording logic inside the process cycle.
Region identifier.
Common struct to pass around during processing to avoid repeating the data in function arguments.
Definition types.h:142
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.