.TH "aflibMemCache" 3 "16 Jan 2007" "Open Source Audio Library Project" \" -*- nroff -*- .ad l .nh .SH NAME aflibMemCache \- Base class that implements audio data caching. .PP .SH SYNOPSIS .br .PP \fC#include \fP .PP Inherited by \fBaflibAudio\fP. .PP .SS "Public Member Functions" .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 Member Functions" .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. The 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. .PP Most 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 "Member Function Documentation" .PP .SS "bool aflibMemCache::getCacheEnable ()" .PP Returns the current state of caching for this object. .PP Return the state of the cache. TRUE means caching is enabled. .SH "Author" .PP Generated automatically by Doxygen for Open Source Audio Library Project from the source code.