|
Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
|
Helper that manages cache activity state for a cache-holding object. More...
#include <src/structure/tracks/playback_cache_activity_tracker.h>
Public Types | |
| using | SampleToTickConverter = std::function<double (units::sample_t)> |
| Function type for converting sample position to tick position. | |
Signals | |
| void | pendingChanged () |
| void | entriesChanged () |
| void | cachedRangesChanged () |
Public Member Functions | |
| PlaybackCacheActivityTracker (utils::PlaybackCacheScheduler *scheduler, const dsp::TimelineDataCache &cache, SampleToTickConverter sample_to_tick, QObject *parent=nullptr) | |
| void | onRegenerationComplete (utils::ExpandableTickRange affectedRange) |
| Called when cache regeneration completes. | |
| bool | isPending () const |
| QVariantList | entries () const |
| size_t | entryCount () const |
| QVariantList | cachedRanges () const |
Static Public Attributes | |
| static constexpr auto | kMaxEntries = 100zu |
| static constexpr auto | kEntryLifetimeMs = std::chrono::milliseconds (300) |
Properties | |
| bool | pending |
| QVariantList | entries |
| QVariantList | cachedRanges |
Helper that manages cache activity state for a cache-holding object.
Encapsulates the shared logic used by both Track and AutomationTrack for tracking pending cache requests and completed regeneration entries.
The pending state is driven solely by the scheduler's isPendingChanged signal. The entries list is capped at kMaxEntries to prevent unbounded growth. Entries are automatically removed after kEntryLifetimeMs by a periodic sweep timer.
Definition at line 66 of file playback_cache_activity_tracker.h.
| using zrythm::structure::tracks::PlaybackCacheActivityTracker::SampleToTickConverter = std::function<double (units::sample_t)> |
Function type for converting sample position to tick position.
Definition at line 82 of file playback_cache_activity_tracker.h.
|
explicit |
| scheduler | The playback cache scheduler to track. |
| cache | The timeline data cache to observe for range changes. |
| sample_to_tick | Function that converts sample positions to tick positions. |
| parent | Parent QObject. |
|
inlinenodiscard |
Definition at line 107 of file playback_cache_activity_tracker.h.
|
inlinenodiscard |
Definition at line 105 of file playback_cache_activity_tracker.h.
| void zrythm::structure::tracks::PlaybackCacheActivityTracker::onRegenerationComplete | ( | utils::ExpandableTickRange | affectedRange | ) |
Called when cache regeneration completes.
Adds an entry to the entries list and trims to kMaxEntries. Does NOT modify pending state – that is driven solely by isPendingChanged.
|
staticconstexpr |
Definition at line 77 of file playback_cache_activity_tracker.h.
|
staticconstexpr |
Definition at line 76 of file playback_cache_activity_tracker.h.
|
read |
Definition at line 71 of file playback_cache_activity_tracker.h.
|
read |
Definition at line 70 of file playback_cache_activity_tracker.h.
|
read |
Definition at line 69 of file playback_cache_activity_tracker.h.