|
Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
|
A class that converts region data to serialized formats. More...
#include <src/structure/arrangement/region_renderer.h>
Static Public Member Functions | |
| static void | serialize_to_sequence (const MidiRegion ®ion, juce::MidiMessageSequence &events, std::optional< std::pair< double, double > > timeline_range_ticks=std::nullopt) |
| Serializes a MIDI region to a MIDI message sequence. | |
| static void | serialize_to_sequence (const ChordRegion ®ion, juce::MidiMessageSequence &events, std::optional< std::pair< double, double > > timeline_range_ticks=std::nullopt) |
| Serializes a Chord region to a MIDI message sequence. | |
| static void | serialize_to_buffer (const AudioRegion ®ion, juce::AudioSampleBuffer &buffer, std::optional< std::pair< double, double > > timeline_range_ticks=std::nullopt) |
| Serializes an Audio region to an audio sample buffer. | |
| static void | serialize_to_automation_values (const AutomationRegion ®ion, std::vector< float > &values, std::optional< std::pair< double, double > > timeline_range_ticks=std::nullopt) |
| Serializes an Automation region to sample-accurate automation values. | |
A class that converts region data to serialized formats.
This class provides methods to serialize both MIDI and Audio regions, handling looped playback and various constraints.
Definition at line 20 of file region_renderer.h.
|
static |
Serializes an Automation region to sample-accurate automation values.
The output buffer always represents the full region length, with index 0 corresponding to the region's start position. Automation point positions are relative to the region start.
Values between automation points are interpolated using the curve algorithm defined on each automation point. The last automation point fills all remaining samples with its value.
Playback behavior:
Constraints (start/end) are global timeline positions and are applied by setting values outside the constraint range to -1.0. The output buffer size is always the full region length, regardless of constraints.
| region | The Automation region to serialize | |
| [out] | values | Output vector of normalized automation values (sample-accurate). Values are resized to the full region length. Negative values (-1.0) indicate no automation present. |
| start | Optional global timeline start position in ticks for constraints | |
| end | Optional global timeline end position in ticks for constraints |
|
static |
Serializes an Audio region to an audio sample buffer.
Audio regions are always serialized as they would be played in the timeline (with loops and clip start). The buffer always starts at the region's audio data without any leading silence.
| region | The Audio region to serialize |
| buffer | Output audio sample buffer |
| start | Optional timeline start position in ticks |
| end | Optional timeline end position in ticks |
| builtin_fade_frames | Number of frames to use for built-in fades |
|
static |
Serializes a Chord region to a MIDI message sequence.
| region | The Chord region to serialize |
| events | Output MIDI message sequence |
| start | Optional timeline start position in ticks |
| end | Optional timeline end position in ticks |
| add_region_start | Add region start offset to positions |
| as_played | Serialize as it would be played in the timeline (with loops and clip start) |
|
static |
Serializes a MIDI region to a MIDI message sequence.
| region | The MIDI region to serialize |
| events | Output MIDI message sequence |
| start | Optional timeline start position in ticks |
| end | Optional timeline end position in ticks |
| add_region_start | Add region start offset to positions (false) |
| as_played | Serialize as it would be played in the timeline (with loops and clip start) (true) |