6#include "utils/types.h"
7#include "utils/units.h"
9#include "juce_wrapper.h"
24 using IntervalType = std::pair<units::sample_t, units::sample_t>;
72 IntervalType interval,
73 const juce::MidiMessageSequence &sequence);
82 return merged_midi_events_;
98 std::map<IntervalType, juce::MidiMessageSequence> midi_sequences_;
106 juce::MidiMessageSequence merged_midi_events_;
144 IntervalType interval,
145 const juce::AudioSampleBuffer &audio_buffer);
154 return audio_regions_;
170 std::vector<AudioRegionEntry> audio_regions_;
208 IntervalType interval,
209 const std::vector<float> &automation_values);
218 return automation_sequences_;
234 std::vector<AutomationCacheEntry> automation_sequences_;
Audio-specific timeline data cache.
void add_audio_region(IntervalType interval, const juce::AudioSampleBuffer &audio_buffer)
Adds an audio region for the given interval.
void clear() override
Clears all cached data.
void remove_sequences_matching_interval(IntervalType interval) override
Removes cached data matching the given interval.
const std::vector< AudioRegionEntry > & get_audio_regions() const
Gets the cached audio regions.
bool has_content() const override
Checks if the cache has any content.
void finalize_changes() override
Finalizes changes and prepares cached data for access.
Automation-specific timeline data cache.
void add_automation_sequence(IntervalType interval, const std::vector< float > &automation_values)
Adds an automation sequence for the given interval.
void remove_sequences_matching_interval(IntervalType interval) override
Removes cached data matching the given interval.
bool has_content() const override
Checks if the cache has any content.
void clear() override
Clears all cached data.
void finalize_changes() override
Finalizes changes and prepares cached data for access.
const std::vector< AutomationCacheEntry > & get_automation_sequences() const
Gets the cached automation sequences.
MIDI-specific timeline data cache.
const juce::MidiMessageSequence & get_midi_events() const
Gets the cached MIDI events.
void add_midi_sequence(IntervalType interval, const juce::MidiMessageSequence &sequence)
Adds a MIDI sequence for the given interval.
void remove_sequences_matching_interval(IntervalType interval) override
Removes cached data matching the given interval.
bool has_content() const override
Checks if the cache has any content.
void finalize_changes() override
Finalizes changes and prepares cached data for access.
void clear() override
Clears all cached data.
Base class for timeline data caches.
virtual bool has_content() const =0
Checks if the cache has any content.
virtual void clear()=0
Clears all cached data.
virtual void remove_sequences_matching_interval(IntervalType interval)=0
Removes cached data matching the given interval.
virtual void finalize_changes()=0
Finalizes changes and prepares cached data for access.
Audio region entry for caching.
units::sample_t end_sample
End position in samples.
juce::AudioSampleBuffer audio_buffer
Copy of the audio sample buffer.
units::sample_t start_sample
Start position in samples.
Automation cache entry for caching.
units::sample_t end_sample
End position in samples.
units::sample_t start_sample
Start position in samples.
std::vector< float > automation_values
Automation values for the parameter.