26 using TimelineRange = std::pair<dsp::TimelineTick, dsp::TimelineTick>;
42 juce::MidiMessageSequence &events,
43 std::optional<TimelineRange> timeline_range_ticks = std::nullopt);
57 juce::MidiMessageSequence &events,
58 std::optional<TimelineRange> timeline_range_ticks = std::nullopt);
72 juce::AudioSampleBuffer &buffer,
73 std::optional<TimelineRange> timeline_range_ticks = std::nullopt);
90 dsp::TimelineTick position;
93 float curve_curviness;
99 dsp::TimelineTick curve_origin_end;
100 float curve_origin_value_a;
101 float curve_origin_value_b;
122 std::vector<RenderedAutomationPoint> &points,
123 std::optional<TimelineRange> timeline_range_ticks = std::nullopt)
130 struct LoopParameters
132 dsp::ContentTick loop_start;
133 dsp::ContentTick loop_end;
134 dsp::ContentTick clip_start;
135 dsp::ContentTick loop_length;
136 dsp::ContentTick clip_length;
139 LoopParameters (
const Clip &clip);
142 template <ClipObject ClipT,
typename EventsT>
143 static void serialize_clip (
147 std::optional<TimelineRange> timeline_range_ticks = std::nullopt)
149 const auto clip_length = clip.length ()->asTick ();
151 for_each_loop_segment (
152 clip.clipStartPosition ()->asTick (),
153 clip.loopStartPosition ()->asTick (), clip.loopEndPosition ()->asTick (),
155 if constexpr (std::is_same_v<ClipT, MidiClip>)
156 handle_midi_clip_range (clip, events, segment);
157 else if constexpr (std::is_same_v<ClipT, ChordClip>)
158 handle_chord_clip_range (clip, events, segment);
159 else if constexpr (std::is_same_v<ClipT, AutomationClip>)
160 handle_automation_clip_range (clip, events, segment);
164 static void handle_midi_clip_range (
165 const MidiClip &clip,
166 juce::MidiMessageSequence &events,
167 const LoopSegment &segment);
169 static void handle_chord_clip_range (
170 const ChordClip &clip,
171 juce::MidiMessageSequence &events,
172 const LoopSegment &segment);
174 static void handle_automation_clip_range (
175 const AutomationClip &clip,
176 std::vector<RenderedAutomationPoint> &points,
177 const LoopSegment &segment);
191 const AudioClip &clip,
192 units::sample_t out_start,
193 units::sample_t out_end);
199 apply_gain_pass (
const AudioClip &clip, juce::AudioSampleBuffer &buffer);
205 apply_clip_fades_pass (
const AudioClip &clip, juce::AudioSampleBuffer &buffer);
210 static void apply_builtin_fades_pass (
211 const AudioClip &clip,
212 juce::AudioSampleBuffer &buffer,
213 int builtin_fade_frames);