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

Non-RT service for background sample decode and cache prefetch. More...

#include <sample_resource.hpp>

Public Member Functions

 SampleResourceService (SampleResourceCacheLimits limits={}, SampleResourceDecodeFunction decode={})
 ~SampleResourceService ()
 SampleResourceService (const SampleResourceService &)=delete
SampleResourceService & operator= (const SampleResourceService &)=delete
runtime::BackgroundJobHandle load_async (std::string path, SampleResourceHandle &target, SampleResourceLoadOptions options={})
runtime::BackgroundJobHandle prefetch_async (std::string path, SampleResourceLoadOptions options={})
std::size_t drain_completions ()
bool publish_cached (const std::string &path, SampleResourceHandle &target, uint64_t memory_budget_bytes=0)
bool publish_cached (const std::string &path, SampleResourceHandle &target, SampleResourceLoadOptions options)
SampleResourceCacheStats cache_stats () const
SampleResourceServiceStats stats () const
std::size_t pending_count () const

Static Public Member Functions

static std::optional< AudioFileData > default_decode (const std::string &path, runtime::BackgroundJobContext &)

Detailed Description

Non-RT service for background sample decode and cache prefetch.

Worker jobs decode files and queue completions. Owners must call drain_completions() from a non-RT control thread to publish decoded data into SampleResourceCache and optional SampleResourceHandle instances.

Constructor & Destructor Documentation

◆ SampleResourceService() [1/2]

pulp::audio::SampleResourceService::SampleResourceService ( SampleResourceCacheLimits limits = {},
SampleResourceDecodeFunction decode = {} )
inlineexplicit

◆ ~SampleResourceService()

pulp::audio::SampleResourceService::~SampleResourceService ( )
inline

◆ SampleResourceService() [2/2]

pulp::audio::SampleResourceService::SampleResourceService ( const SampleResourceService & )
delete

Member Function Documentation

◆ cache_stats()

SampleResourceCacheStats pulp::audio::SampleResourceService::cache_stats ( ) const
inline

◆ default_decode()

std::optional< AudioFileData > pulp::audio::SampleResourceService::default_decode ( const std::string & path,
runtime::BackgroundJobContext &  )
inlinestatic

◆ drain_completions()

std::size_t pulp::audio::SampleResourceService::drain_completions ( )
inline

◆ load_async()

runtime::BackgroundJobHandle pulp::audio::SampleResourceService::load_async ( std::string path,
SampleResourceHandle & target,
SampleResourceLoadOptions options = {} )
inline

◆ operator=()

SampleResourceService & pulp::audio::SampleResourceService::operator= ( const SampleResourceService & )
delete

◆ pending_count()

std::size_t pulp::audio::SampleResourceService::pending_count ( ) const
inline

◆ prefetch_async()

runtime::BackgroundJobHandle pulp::audio::SampleResourceService::prefetch_async ( std::string path,
SampleResourceLoadOptions options = {} )
inline

◆ publish_cached() [1/2]

bool pulp::audio::SampleResourceService::publish_cached ( const std::string & path,
SampleResourceHandle & target,
SampleResourceLoadOptions options )
inline

◆ publish_cached() [2/2]

bool pulp::audio::SampleResourceService::publish_cached ( const std::string & path,
SampleResourceHandle & target,
uint64_t memory_budget_bytes = 0 )
inline

◆ stats()

SampleResourceServiceStats pulp::audio::SampleResourceService::stats ( ) const
inline

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