Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::engine::session::RecordingManager Class Reference

Handles the recording logic for the application. More...

#include <src/engine/session/recording_manager.h>

Inheritance diagram for zrythm::engine::session::RecordingManager:
Collaboration diagram for zrythm::engine::session::RecordingManager:

Public Types

using Position = zrythm::dsp::Position
 
using AutomationTrack = structure::tracks::AutomationTrack
 
using AutomationRegion = structure::arrangement::AutomationRegion
 
using AutomationPoint = structure::arrangement::AutomationPoint
 

Public Member Functions

 RecordingManager (QObject *parent=nullptr)
 Creates the event queue and starts the event loop.
 
void handle_recording (const structure::tracks::TrackProcessor *track_processor, const EngineProcessTimeInfo *time_nfo)
 Handles the recording logic inside the process cycle.
 
Q_SLOT void process_events ()
 

Data Fields

int num_active_recordings_ = 0
 Number of recordings currently in progress.
 
MPMCQueue< RecordingEvent * > event_queue_
 Event queue.
 
ObjectPool< RecordingEventevent_obj_pool_
 Memory pool of event structs to avoid real time allocation.
 
std::vector< structure::arrangement::ArrangerObjectPtrVariant > objects_before_start_
 Cloned objects before starting recording.
 
std::vector< structure::arrangement::Region::Uuidrecorded_ids_
 Recorded region identifiers, to be used for creating the undoable actions.
 
std::vector< structure::arrangement::AutomationPoint * > pending_aps_
 Pending recorded automation points.
 
bool currently_processing_ = false
 
std::binary_semaphore processing_sem_ { 1 }
 
bool freeing_ = false
 

Detailed Description

Handles the recording logic for the application.

This class is responsible for managing the recording process, including handling recording events, creating new regions, and managing automation points. It uses a queue to process recording events in a separate thread, and provides methods for starting, pausing, and stopping recording.

The class is designed to be thread-safe, with a binary semaphore to ensure that only one thread can access the recording logic at a time.

Definition at line 36 of file recording_manager.h.

Member Typedef Documentation

◆ AutomationPoint

◆ AutomationRegion

◆ AutomationTrack

◆ Position

Constructor & Destructor Documentation

◆ RecordingManager()

zrythm::engine::session::RecordingManager::RecordingManager ( QObject * parent = nullptr)

Creates the event queue and starts the event loop.

Must be called from a GTK thread.

Member Function Documentation

◆ handle_recording()

void zrythm::engine::session::RecordingManager::handle_recording ( const structure::tracks::TrackProcessor * track_processor,
const EngineProcessTimeInfo * time_nfo )

Handles the recording logic inside the process cycle.

The MidiEvents are already dequeued at this point.

Parameters
g_frames_startGlobal start frames.
nframesNumber of frames to process. If this is zero, a pause will be added. See RECORDING_EVENT_TYPE_PAUSE_TRACK_RECORDING and RECORDING_EVENT_TYPE_PAUSE_AUTOMATION_RECORDING.

Field Documentation

◆ currently_processing_

bool zrythm::engine::session::RecordingManager::currently_processing_ = false

Definition at line 176 of file recording_manager.h.

◆ event_obj_pool_

ObjectPool<RecordingEvent> zrythm::engine::session::RecordingManager::event_obj_pool_

Memory pool of event structs to avoid real time allocation.

Definition at line 162 of file recording_manager.h.

◆ event_queue_

MPMCQueue<RecordingEvent *> zrythm::engine::session::RecordingManager::event_queue_

Event queue.

Definition at line 157 of file recording_manager.h.

◆ freeing_

bool zrythm::engine::session::RecordingManager::freeing_ = false

Definition at line 179 of file recording_manager.h.

◆ num_active_recordings_

int zrythm::engine::session::RecordingManager::num_active_recordings_ = 0

Number of recordings currently in progress.

Definition at line 154 of file recording_manager.h.

◆ objects_before_start_

std::vector<structure::arrangement::ArrangerObjectPtrVariant> zrythm::engine::session::RecordingManager::objects_before_start_

Cloned objects before starting recording.

Definition at line 166 of file recording_manager.h.

◆ pending_aps_

std::vector<structure::arrangement::AutomationPoint *> zrythm::engine::session::RecordingManager::pending_aps_

Pending recorded automation points.

Definition at line 174 of file recording_manager.h.

◆ processing_sem_

std::binary_semaphore zrythm::engine::session::RecordingManager::processing_sem_ { 1 }

Definition at line 177 of file recording_manager.h.

◆ recorded_ids_

std::vector<structure::arrangement::Region::Uuid> zrythm::engine::session::RecordingManager::recorded_ids_

Recorded region identifiers, to be used for creating the undoable actions.

Definition at line 171 of file recording_manager.h.


The documentation for this class was generated from the following file: