📄 aflibmemcache.3
字号:
.TH "aflibMemCache" 3 "8 May 2002" "Open Source Audio Library Project" \" -*- nroff -*-.ad l.nh.SH NAMEaflibMemCache \- Base class that implements audio data caching. .SH SYNOPSIS.br.PP\fC#include <aflibMemCache.h>\fP.PPInherited by \fBaflibAudio\fP..PP.SS "Public Methods".in +1c.ti -1c.RI "\fBaflibMemCache\fP ()".br.RI "\fIConstructor.\fP".ti -1c.RI "virtual \fB~aflibMemCache\fP ()".br.RI "\fIDestructor.\fP".ti -1c.RI "bool \fBgetCacheEnable\fP ()".br.RI "\fIReturns the current state of caching for this object.\fP".ti -1c.RI "void \fBsetCacheEnable\fP (bool enable)".br.RI "\fISet the state of caching for this object.\fP".ti -1c.RI "long long \fBgetCacheMax\fP () const".br.RI "\fIReturns the maximum allowed size of the cache.\fP".ti -1c.RI "long long \fBgetCacheTotal\fP () const".br.RI "\fIGets the total size of all caches added together.\fP".ti -1c.RI "long long \fBgetCacheLocal\fP () const".br.RI "\fIGets the current size of the cache for this object only.\fP".ti -1c.RI "void \fBclearCache\fP ()".br.RI "\fIEmpties the cache for this object only.\fP".in -1c.SS "Protected Methods".in +1c.ti -1c.RI "void \fBlookupData\fP (long long &position, int &num_samples)".br.ti -1c.RI "void \fBfillDataFromCache\fP (\fBaflibData\fP &data, long long &position, int &num_samples, long long orig_position, int orig_num_samples)".br.in -1c.SH "DETAILED DESCRIPTION".PP Base class that implements audio data caching..PPThe purpose of this class is to provide a memory caching mechanism to those classes who whould benefit from this. It will store audio data into a buffer that it controls so that when audio data is reread for what ever purpose it will come from this cache instead of from the original source. This is beneficial for three reasons. 1) Some sources may not support backing up for old data. For instance an http stream comming over an internet connection. Some derived \fBaflibAudio\fP objects need to back up over old data. For instance the sample rate converter class. It needs to operate on an old history of the data for best results. In order to save the complexity from each derived class we will implement caching here. 2) Reading audio data can be expensive from some sources. Reading from a disk can be slow and audio data from mp3s requires decoding. This will provide the capability to not have to reread again from the original source. 3) Some audio sources do not support random access. We can provide a limited random access capability for these sources by caching the audio data from the start of the file. Of course there are limitations with this..PPMost derived classes by default have caching disabled. To enable or disable caching one would call setCacheEnable. The environment variable AFLIB_CACHE_SIZE can be set to set the maximum amount of cache to use. The default is 1MB. .PP.SH "CONSTRUCTOR & DESTRUCTOR DOCUMENTATION".PP .SS "aflibMemCache::aflibMemCache ()".PPConstructor..PP.SS "aflibMemCache::~aflibMemCache ()\fC [virtual]\fP".PPDestructor..PP.SH "MEMBER FUNCTION DOCUMENTATION".PP .SS "void aflibMemCache::clearCache ()".PPEmpties the cache for this object only..PP.SS "void aflibMemCache::fillDataFromCache (\fBaflibData\fP & data, long long & position, int & num_samples, long long orig_position, int orig_num_samples)\fC [protected]\fP".PP.SS "bool aflibMemCache::getCacheEnable ()".PPReturns the current state of caching for this object..PPReturn the state of the cache. TRUE means caching is enabled. .SS "long long aflibMemCache::getCacheLocal () const".PPGets the current size of the cache for this object only..PP.SS "long long aflibMemCache::getCacheMax () const".PPReturns the maximum allowed size of the cache..PP.SS "long long aflibMemCache::getCacheTotal () const".PPGets the total size of all caches added together..PP.SS "void aflibMemCache::lookupData (long long & position, int & num_samples)\fC [protected]\fP".PP.SS "void aflibMemCache::setCacheEnable (bool enable)".PPSet the state of caching for this object..PP.SH "AUTHOR".PP Generated automatically by Doxygen for Open Source Audio Library Project from the source code.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -