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,
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
76 units::sample_u64_t g_start_frame_w_offset_;
77
79 units::sample_u32_t local_offset_;
80
82 units::sample_u32_t nframes_;
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
dsp::MidiEvent midi_event_
MidiEvent, if midi.
units::sample_u64_t g_start_frame_w_offset_
Global start frames of the event (including offset).
std::array< float, 8192 > lbuf_
The actual data (if audio).
units::sample_u32_t local_offset_
Offset in current cycle that this event starts from.
@ 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.
units::sample_u32_t nframes_
Number of frames processed in this event.
Represents a track in the project.
Definition track.h:54
Timed MIDI event.
Definition midi_event.h:28
Common struct to pass around during processing to avoid repeating the data in function arguments.
Definition graph_node.h:51
units::sample_u32_t nframes_
Number of frames to process in this call, starting from the offset.
Definition graph_node.h:70
units::sample_u32_t local_offset_
Offset in the current processing cycle, between 0 and the number of frames in AudioEngine....
Definition graph_node.h:65
units::sample_u64_t g_start_frame_w_offset_
Global position with dsp::graph::EngineProcessTimeInfo.local_offset added, for convenience.
Definition graph_node.h:61