Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
recording_event.h
1// SPDX-FileCopyrightText: © 2019-2022, 2024-2025 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include <source_location>
7
8#include "dsp/midi_event.h"
9#include "structure/tracks/track.h"
10#include "utils/types.h"
11
12namespace zrythm::engine::session
13{
14
24{
25public:
26 enum class Type
27 {
28 StartTrackRecording,
29 StartAutomationRecording,
30
33 Audio,
34 Automation,
35
43 PauseAutomationRecording,
44
45 StopTrackRecording,
46 StopAutomationRecording,
47 };
48
49public:
50 void init (
51 const Type type,
52 const structure::tracks::Track &track,
53 const EngineProcessTimeInfo &time_nfo,
54 std::source_location source_location = std::source_location::current ())
55 {
56 type_ = type;
57 track_uuid_ = track.get_uuid ();
60 has_midi_event_ = false;
63 nframes_ = time_nfo.nframes_;
64 source_location_ = source_location;
65 }
66
67public:
68 Type type_ = Type::Audio;
69
70 bool has_midi_event_ = false;
71
73 structure::tracks::TrackUuid track_uuid_;
74
77
80
83
86
92 std::array<float, 8192> lbuf_{};
93 std::array<float, 8192> rbuf_{};
94
99
100 /* debug info */
101 std::source_location source_location_;
102
103 BOOST_DESCRIBE_CLASS (
105 (),
106 (type_,
110 nframes_,
112 has_midi_event_,
113 source_location_),
114 (),
115 ())
116};
117} // namespace zrythm::engine::session
unsigned_frame_t g_start_frame_w_offset_
Global start frames of the event (including offset).
dsp::MidiEvent midi_event_
MidiEvent, if midi.
std::array< float, 8192 > lbuf_
The actual data (if audio).
@ Midi
These events are for processing any range.
@ PauseTrackRecording
These events are for temporarily stopping recording (eg, when outside the punch range or when looping...
structure::tracks::TrackUuid track_uuid_
The identifier of the track this event is for.
int automation_track_idx_
Index of automation track, if automation.
nframes_t local_offset_
Offset in current cycle that this event starts from.
nframes_t nframes_
Number of frames processed in this event.
Represents a track in the project.
Definition track.h:54
uint_fast64_t unsigned_frame_t
Unsigned type for frame index.
Definition types.h:78
uint32_t nframes_t
Frame count.
Definition types.h:58
Common struct to pass around during processing to avoid repeating the data in function arguments.
Definition types.h:133
nframes_t local_offset_
Offset in the current processing cycle, between 0 and the number of frames in AudioEngine....
Definition types.h:147
unsigned_frame_t g_start_frame_w_offset_
Global position with EngineProcessTimeInfo.local_offset added, for convenience.
Definition types.h:143
nframes_t nframes_
Number of frames to process in this call, starting from the offset.
Definition types.h:152
Timed MIDI event.
Definition midi_event.h:30