Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::audio::SampleResourceCache Class Reference

Control-thread decoded sample cache for samplers and loopers. More...

#include <sample_resource.hpp>

Public Member Functions

 SampleResourceCache (SampleResourceCacheLimits limits={})
std::shared_ptr< const AudioFileData > get (const std::string &path)
bool put (std::string path, AudioFileData data)
bool put (std::string path, std::shared_ptr< const AudioFileData > data)
bool erase (const std::string &path)
void clear ()
SampleResourceCacheStats stats () const
SampleResourceCacheLimits limits () const noexcept

Detailed Description

Control-thread decoded sample cache for samplers and loopers.

This cache owns decoded sample memory and records deterministic hit/miss and eviction counters. It is not an audio-thread API; publish cached data to a SampleResourceHandle or a prepared realtime handoff slot before rendering.

Constructor & Destructor Documentation

◆ SampleResourceCache()

pulp::audio::SampleResourceCache::SampleResourceCache ( SampleResourceCacheLimits limits = {})
inlineexplicit

Member Function Documentation

◆ clear()

void pulp::audio::SampleResourceCache::clear ( )
inline

◆ erase()

bool pulp::audio::SampleResourceCache::erase ( const std::string & path)
inline

◆ get()

std::shared_ptr< const AudioFileData > pulp::audio::SampleResourceCache::get ( const std::string & path)
inline

◆ limits()

SampleResourceCacheLimits pulp::audio::SampleResourceCache::limits ( ) const
inlinenoexcept

◆ put() [1/2]

bool pulp::audio::SampleResourceCache::put ( std::string path,
AudioFileData data )
inline

◆ put() [2/2]

bool pulp::audio::SampleResourceCache::put ( std::string path,
std::shared_ptr< const AudioFileData > data )
inline

◆ stats()

SampleResourceCacheStats pulp::audio::SampleResourceCache::stats ( ) const
inline

The documentation for this class was generated from the following file: