A class that converts clip data to serialized formats.
More...
#include <src/structure/arrangement/clip_renderer.h>
|
| using | TimelineRange = std::pair<dsp::TimelineTick, dsp::TimelineTick> |
|
| static void | serialize_to_sequence (const MidiClip &clip, juce::MidiMessageSequence &events, std::optional< TimelineRange > timeline_range_ticks=std::nullopt) |
| | Serializes a MIDI clip to a MIDI message sequence.
|
| static void | serialize_to_sequence (const ChordClip &clip, juce::MidiMessageSequence &events, std::optional< TimelineRange > timeline_range_ticks=std::nullopt) |
| | Serializes a Chord clip to a MIDI message sequence.
|
| static void | serialize_to_buffer (const AudioClip &clip, juce::AudioSampleBuffer &buffer, std::optional< TimelineRange > timeline_range_ticks=std::nullopt) |
| | Serializes an Audio clip to an audio sample buffer.
|
| static void | serialize_to_points (const AutomationClip &clip, std::vector< RenderedAutomationPoint > &points, std::optional< TimelineRange > timeline_range_ticks=std::nullopt) |
| | Serializes an AutomationClip to a list of control points in timeline-tick space (relative to clip start).
|
A class that converts clip data to serialized formats.
This class provides methods to serialize both MIDI and Audio clips, handling looped playback and various constraints.
Definition at line 23 of file clip_renderer.h.
◆ TimelineRange
| using zrythm::structure::arrangement::ClipRenderer::TimelineRange = std::pair<dsp::TimelineTick, dsp::TimelineTick> |
◆ serialize_to_buffer()
| void zrythm::structure::arrangement::ClipRenderer::serialize_to_buffer |
( |
const AudioClip & | clip, |
|
|
juce::AudioSampleBuffer & | buffer, |
|
|
std::optional< TimelineRange > | timeline_range_ticks = std::nullopt ) |
|
static |
Serializes an Audio clip to an audio sample buffer.
The buffer represents the clip's audio as played back with looping and clip-start applied. Buffer index 0 corresponds to the clip start.
- Parameters
-
| clip | The Audio clip to serialize. |
| buffer | Output audio sample buffer. |
| timeline_range_ticks | Currently unused. |
◆ serialize_to_points()
| void zrythm::structure::arrangement::ClipRenderer::serialize_to_points |
( |
const AutomationClip & | clip, |
|
|
std::vector< RenderedAutomationPoint > & | points, |
|
|
std::optional< TimelineRange > | timeline_range_ticks = std::nullopt ) |
|
static |
Serializes an AutomationClip to a list of control points in timeline-tick space (relative to clip start).
Uses the same serialize_clip loop walk as MIDI/Audio/Chord. When a loop iteration boundary falls between two automation points, an interpolated control point is inserted so the curve resumes correctly.
Points are sorted by position. Callers that need absolute timeline positions should add clip.position()->asTick() to each point's position (cf. MidiMessageSequence::addTimeToMessages).
- Parameters
-
| clip | The automation clip to serialize. |
| points | Output vector of control points. |
| timeline_range_ticks | Currently unused. |
◆ serialize_to_sequence() [1/2]
| void zrythm::structure::arrangement::ClipRenderer::serialize_to_sequence |
( |
const ChordClip & | clip, |
|
|
juce::MidiMessageSequence & | events, |
|
|
std::optional< TimelineRange > | timeline_range_ticks = std::nullopt ) |
|
static |
Serializes a Chord clip to a MIDI message sequence.
Event timestamps are in ticks relative to the clip start (tick 0 = clip start). See the MidiClip overload for details.
- Parameters
-
| clip | The Chord clip to serialize. |
| Events | Output MIDI message sequence. |
| timeline_range_ticks | Currently unused. |
◆ serialize_to_sequence() [2/2]
| void zrythm::structure::arrangement::ClipRenderer::serialize_to_sequence |
( |
const MidiClip & | clip, |
|
|
juce::MidiMessageSequence & | events, |
|
|
std::optional< TimelineRange > | timeline_range_ticks = std::nullopt ) |
|
static |
Serializes a MIDI clip to a MIDI message sequence.
Event timestamps are in ticks relative to the clip start (tick 0 = clip start). Looping and clip-start offsets are applied. Callers that need absolute timeline positions should add clip.position()->ticks() to each event timestamp (e.g. via events.addTimeToMessages()).
- Parameters
-
| clip | The MIDI clip to serialize. |
| Events | Output MIDI message sequence. |
| timeline_range_ticks | Currently unused. |
The documentation for this class was generated from the following file: