|
Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
|
Base class for timeline data caches. More...
#include <src/dsp/timeline_data_cache.h>


Public Types | |
| using | IntervalType = std::pair<units::sample_t, units::sample_t> |
Public Member Functions | |
| TimelineDataCache (QObject *parent=nullptr) | |
| void | clear () |
| Clears all cached data and emits cachedRangesChanged. | |
| virtual void | remove_sequences_matching_interval (IntervalType interval)=0 |
| Removes cached data for intervals that truly overlap with the given interval. | |
| void | finalize_changes () |
| Finalizes changes, prepares cached data for access, and emits cachedRangesChanged. | |
| virtual bool | has_content () const =0 |
| Checks if the cache has any content. | |
| Q_SIGNAL void | cachedRangesChanged (std::vector< IntervalType > ranges) const |
| Emitted when the cache content changes (after finalize_changes or clear). | |
Static Protected Member Functions | |
| static bool | intervals_overlap (IntervalType a, IntervalType b) noexcept |
| Returns true if two intervals truly overlap (adjacent intervals do not count). | |
Base class for timeline data caches.
Provides common functionality for all timeline data cache types. This is an abstract base class that defines the interface that all derived cache classes must implement.
Definition at line 22 of file timeline_data_cache.h.
| using zrythm::dsp::TimelineDataCache::IntervalType = std::pair<units::sample_t, units::sample_t> |
Definition at line 27 of file timeline_data_cache.h.
|
inlineexplicit |
Definition at line 29 of file timeline_data_cache.h.
| Q_SIGNAL void zrythm::dsp::TimelineDataCache::cachedRangesChanged | ( | std::vector< IntervalType > | ranges | ) | const |
Emitted when the cache content changes (after finalize_changes or clear).
Carries the current list of sample intervals that are cached. Used for debug visualization of cache coverage.
|
inline |
Clears all cached data and emits cachedRangesChanged.
Definition at line 36 of file timeline_data_cache.h.
|
inline |
Finalizes changes, prepares cached data for access, and emits cachedRangesChanged.
This should be called after all modifications are complete to prepare the cached data for real-time access.
Definition at line 63 of file timeline_data_cache.h.
|
pure virtual |
Checks if the cache has any content.
Implemented in zrythm::dsp::AudioTimelineDataCache, zrythm::dsp::AutomationTimelineDataCache, and zrythm::dsp::MidiTimelineDataCache.
|
inlinestaticprotectednoexcept |
Returns true if two intervals truly overlap (adjacent intervals do not count).
Definition at line 90 of file timeline_data_cache.h.
|
pure virtual |
Removes cached data for intervals that truly overlap with the given interval.
Adjacent intervals (where one's end equals another's start) are NOT considered overlapping, since cache entries use exclusive-end semantics (end = one past the last sample).
| interval | The time interval to remove (in samples). |
Call finalize_changes() after one or more calls to this method.
Implemented in zrythm::dsp::AudioTimelineDataCache, zrythm::dsp::AutomationTimelineDataCache, and zrythm::dsp::MidiTimelineDataCache.