📄 aflibaudio.3
字号:
.TH "aflibAudio" 3 "8 May 2002" "Open Source Audio Library Project" \" -*- nroff -*-.ad l.nh.SH NAMEaflibAudio \- Main base class for all audio objects to be placed in a chain. .SH SYNOPSIS.br.PP\fC#include <aflibAudio.h>\fP.PPInherits \fBaflibChain\fP, and \fBaflibMemCache\fP..PPInherited by \fBaflibAudioBWFilter\fP, \fBaflibAudioConstantSrc\fP, \fBaflibAudioEdit\fP, \fBaflibAudioFile\fP, \fBaflibAudioMemoryInput\fP, \fBaflibAudioMixer\fP, \fBaflibAudioRecorder\fP, \fBaflibAudioSampleRateCvt\fP, and \fBaflibAudioSpectrum\fP..PP.SS "Public Methods".in +1c.ti -1c.RI "virtual \fB~aflibAudio\fP ()".br.RI "\fIDestructor.\fP".ti -1c.RI "void \fBenable\fP (bool enable)".br.RI "\fIEnables or disables an object in a chain.\fP".ti -1c.RI "bool \fBgetEnable\fP () const".br.RI "\fIGets current state of object.\fP".ti -1c.RI "void \fBenableDataSizeConversion\fP (bool enable)".br.RI "\fIEnables or disables data size conversion.\fP".ti -1c.RI "void \fBenableEndianConversion\fP (bool enable)".br.RI "\fIEnables or disables endian conversion.\fP".ti -1c.RI "void \fBenableSampleRateConversion\fP (bool enable)".br.RI "\fIEnables or disables sample rate conversion.\fP".ti -1c.RI "void \fBenableChannelsConversion\fP (bool enable)".br.RI "\fIEnables or disables number of channels conversion.\fP".ti -1c.RI "virtual void \fBsetInputConfig\fP (const \fBaflibConfig\fP &cfg)".br.RI "\fISets the input audio data configuration of an object.\fP".ti -1c.RI "virtual const \fBaflibConfig\fP & \fBgetInputConfig\fP () const".br.RI "\fIReturns the input audio data configuration of an object.\fP".ti -1c.RI "virtual void \fBsetOutputConfig\fP (const \fBaflibConfig\fP &cfg)".br.RI "\fISets the output audio data configuration of an object.\fP".ti -1c.RI "virtual const \fBaflibConfig\fP & \fBgetOutputConfig\fP () const".br.RI "\fIReturns the output audio data configuration of an object.\fP".ti -1c.RI "virtual const char * \fBgetName\fP () const".br.RI "\fIReturns the name of the derived class, must be implemented by derived class.\fP".ti -1c.RI "virtual \fBaflibStatus\fP \fBcompute_segment\fP (list< \fBaflibData\fP * > &, long long)".br.RI "\fIWork function, must be implemented by derived class.\fP".ti -1c.RI "virtual \fBaflibData\fP * \fBprocess\fP (\fBaflibStatus\fP &ret_status, long long position, int &num_samples, bool free_memory=TRUE)".br.RI "\fIMain processing function for pulling data thru an audio chain.\fP".in -1c.SS "Protected Methods".in +1c.ti -1c.RI "\fBaflibAudio\fP ()".br.RI "\fIConstructor.\fP".ti -1c.RI "\fBaflibAudio\fP (aflibAudio &audio)".br.RI "\fIConstructor.\fP".ti -1c.RI "aflibAudio * \fBconvertSampleRate\fP (aflibAudio &parent)".br.ti -1c.RI "aflibAudio * \fBconvertChannels\fP (aflibAudio &parent)".br.ti -1c.RI "void \fBconvertData\fP (\fBaflibData\fP &data)".br.ti -1c.RI "void \fBexamineChain\fP ()".br.ti -1c.RI "bool \fBcheckChain\fP (const aflibAudio *audio) const".br.ti -1c.RI "void \fBpreprocessChain\fP (aflibAudio *audio, aflibAudio *child)".br.ti -1c.RI "virtual bool \fBisDataSizeSupported\fP (\fBaflib_data_size\fP size)".br.ti -1c.RI "virtual bool \fBisEndianSupported\fP (\fBaflib_data_endian\fP end)".br.ti -1c.RI "virtual bool \fBisSampleRateSupported\fP (int &rate)".br.ti -1c.RI "virtual bool \fBisChannelsSupported\fP (int &channels)".br.ti -1c.RI "void \fBincrementLevel\fP ()".br.ti -1c.RI "void \fBdecrementLevel\fP ()".br.in -1c.SH "DETAILED DESCRIPTION".PP Main base class for all audio objects to be placed in a chain..PPThis is the Base class that all objects will use that want to be used as audio objects with this library. It inherts functionality from the \fBaflibChain\fP class so that these objects can be used in a chain. It is also derived from \fBaflibMemCache\fP class. This provides memory caching for an object..PPTwo constructors are provided. A constructor with no parameters is provided that derived classes should call that can be used as the start of a chain. A mixing class for instance makes no sense to have a default contructor since it can't be used as the start of a chain. Most often the start of a chain will be a file or device object. The second constructor takes an aflibAudio object. This should be called by a derived class that could have a parent audio object feeding it. This will more than likely be almost all objects..PPFunction compute_segment is pure virtual so that all derived classes will have to implement it. There is no implementation in this base class. This is the function that derived classes implement that will do the work. This function will be passed a list of \fBaflibData\fP objects. One for each parent of the object. The order in the list is the same as the order from the getParents function. It will also be passed the position of the data. When done the function should return AFLIB_SUCCESS if success..PPFunction process is defined in this base class and should not be overriden except in certain circumstances. Such as an audio class with more than 1 input that needs special requirements. It provides the functionality to push data throught the chain. The user application can call process from any element in the chain. It will work its way back through the chain and when it gets to the start will start an \fBaflibData\fP object through the chain until arriving at and processing this object. This function might be the ideal place in the future to enable threading. .PP.SH "CONSTRUCTOR & DESTRUCTOR DOCUMENTATION".PP .SS "aflibAudio::~aflibAudio ()\fC [virtual]\fP".PPDestructor..PP.SS "aflibAudio::aflibAudio ()\fC [protected]\fP".PPConstructor..PPThis constructor is for derived classes that have no parent audio object. .SS "aflibAudio::aflibAudio (aflibAudio & audio)\fC [protected]\fP".PPConstructor..PPThis constructor is for derived classes that have a parent audio object. .SH "MEMBER FUNCTION DOCUMENTATION".PP .SS "bool aflibAudio::checkChain (const aflibAudio * audio) const\fC [protected]\fP".PP.SS "virtual \fBaflibStatus\fP aflibAudio::compute_segment (list< \fBaflibData\fP * > &, long long)\fC [inline, virtual]\fP".PPWork function, must be implemented by derived class..PPReimplemented in \fBaflibAudioBWFilter\fP, \fBaflibAudioConstantSrc\fP, \fBaflibAudioEdit\fP, \fBaflibAudioFile\fP, \fBaflibAudioMemoryInput\fP, \fBaflibAudioMixer\fP, \fBaflibAudioRecorder\fP, \fBaflibAudioSampleRateCvt\fP, and \fBaflibAudioSpectrum\fP..SS "aflibAudio * aflibAudio::convertChannels (aflibAudio & parent)\fC [protected]\fP".PP.SS "void aflibAudio::convertData (\fBaflibData\fP & data)\fC [protected]\fP".PP.SS "aflibAudio * aflibAudio::convertSampleRate (aflibAudio & parent)\fC [protected]\fP".PP.SS "void aflibAudio::decrementLevel ()\fC [inline, protected]\fP".PP.SS "void aflibAudio::enable (bool enable)".PPEnables or disables an object in a chain..PPThis allows this node to be enabled or disabled. This assists in removing a node from a chain without having to destruct it. This is useful to enable an application to toggle a filter in and out for example. .SS "void aflibAudio::enableChannelsConversion (bool enable)".PPEnables or disables number of channels conversion..PPThis allows the automatic channel conversion feature to be enabled or disabled. This is already enabled by default. If one does not want a node to perform a mixing operation to convert the number of channels then this can be set on a node to disable it. .SS "void aflibAudio::enableDataSizeConversion (bool enable)".PPEnables or disables data size conversion..PPThis allows the automatic data size conversion feature to be enabled or disabled. This is already enabled by default. If one does not want a node to perform a data size conversion then this can be set on a node to disable it. .SS "void aflibAudio::enableEndianConversion (bool enable)".PPEnables or disables endian conversion..PPThis allows the endian data conversion feature to be enabled or disabled. This is already enabled by default. If one does not want a node to perform an endian conversion then this can be set on a node to disable it. .SS "void aflibAudio::enableSampleRateConversion (bool enable)".PPEnables or disables sample rate conversion..PPThis allows the automatic sample rate conversion feature to be enabled or disabled. This is already enabled by default. If one does not want a node to perform a sample rate conversion then this can be set on a node to disable it. .SS "void aflibAudio::examineChain ()\fC [protected]\fP".PP.SS "bool aflibAudio::getEnable () const".PPGets current state of object..PPThis allows one to determine if an object is Enabled or Disabled. TRUE means that the object is currently enabled. .SS "const \fBaflibConfig\fP & aflibAudio::getInputConfig () const\fC [virtual]\fP".PPReturns the input audio data configuration of an object..PPReimplemented in \fBaflibAudioFile\fP..SS "virtual const char* aflibAudio::getName () const\fC [inline, virtual]\fP".PPReturns the name of the derived class, must be implemented by derived class..PPReimplemented in \fBaflibAudioBWFilter\fP, \fBaflibAudioConstantSrc\fP, \fBaflibAudioEdit\fP, \fBaflibAudioFile\fP, \fBaflibAudioMemoryInput\fP, \fBaflibAudioMixer\fP, \fBaflibAudioPitch\fP, \fBaflibAudioRecorder\fP, \fBaflibAudioSampleRateCvt\fP, \fBaflibAudioSpectrum\fP, and \fBaflibAudioStereoToMono\fP..SS "const \fBaflibConfig\fP & aflibAudio::getOutputConfig () const\fC [virtual]\fP".PPReturns the output audio data configuration of an object..PPReimplemented in \fBaflibAudioFile\fP..SS "void aflibAudio::incrementLevel ()\fC [inline, protected]\fP".PP.SS "bool aflibAudio::isChannelsSupported (int & channels)\fC [protected, virtual]\fP".PPReimplemented in \fBaflibAudioEdit\fP, \fBaflibAudioFile\fP, and \fBaflibAudioSampleRateCvt\fP..SS "bool aflibAudio::isDataSizeSupported (\fBaflib_data_size\fP size)\fC [protected, virtual]\fP".PPReimplemented in \fBaflibAudioBWFilter\fP, \fBaflibAudioEdit\fP, \fBaflibAudioFile\fP, \fBaflibAudioMixer\fP, and \fBaflibAudioSampleRateCvt\fP..SS "bool aflibAudio::isEndianSupported (\fBaflib_data_endian\fP end)\fC [protected, virtual]\fP".PPReimplemented in \fBaflibAudioEdit\fP, \fBaflibAudioFile\fP, and \fBaflibAudioMixer\fP..SS "bool aflibAudio::isSampleRateSupported (int & rate)\fC [protected, virtual]\fP".PPReimplemented in \fBaflibAudioEdit\fP, \fBaflibAudioFile\fP, and \fBaflibAudioMixer\fP..SS "void aflibAudio::preprocessChain (aflibAudio * audio, aflibAudio * child)\fC [protected]\fP".PP.SS "\fBaflibData\fP * aflibAudio::process (\fBaflibStatus\fP & ret_status, long long position, int & num_samples, bool free_memory = TRUE)\fC [virtual]\fP".PPMain processing function for pulling data thru an audio chain..PPThis is the main processing function for pulling data thru an audio chain. It can be called from any aflibAudio derived object. Users should call the process function at the end of a chain. This function will then call each process function in an audio chain until the start of the chain is reached. When the start of the chain is reached then an \fBaflibData\fP object of the proper size will be allocated and each aflibAudio derived objects compute_segment function will be called to process the data until the end of the chain is reached. This implementation will handle multiple parents automatically. It will request data from the same position and size from each parent of an object. It data of a different size or position is needed from each parent then this will need to be overriden in the derived class. This is not recommended. The first parameter will return a status to the caller. If everything worked OK then AFLIB_SUCCESS will be returned. The second is a position parameter. This indicates at which position in an audio source to read data from. This is a suggestion. It will be ignored if reading from an audio device or from an audio format that does not support random access, like mp3. The third parameter is the number of samples to pull thru the chain. If 0 is passed then the library will pick the size. This is a suggestion. It will return the actual number of samples used when pulling data thru the chain. If the caller passes FALSE to free_memory then the pointer to the \fBaflibData\fP class containing the data will be returned. It is then the responsibility of the calling app to free this memory using delete. If no parameter is passed then it will not be returned by default. Instead NULL will be returned. .PPReimplemented in \fBaflibAudioEdit\fP, and \fBaflibAudioSampleRateCvt\fP..SS "void aflibAudio::setInputConfig (const \fBaflibConfig\fP & cfg)\fC [virtual]\fP".PPSets the input audio data configuration of an object..PPThis is a virtual function that derived classes can override if needed. It allows the caller to set the configuration of the audio data of an object. By default it saves the output audio configuration to be the same as the input data configuration that is passed in. This should be sufficient for most derived classes. For those classes that will have a change from the output to input config mapping then this function should be overriden and the output config processed and saved. .PPReimplemented in \fBaflibAudioBWFilter\fP, \fBaflibAudioEdit\fP, \fBaflibAudioFile\fP, \fBaflibAudioMixer\fP, \fBaflibAudioPitch\fP, \fBaflibAudioSampleRateCvt\fP, and \fBaflibAudioSpectrum\fP..SS "void aflibAudio::setOutputConfig (const \fBaflibConfig\fP & cfg)\fC [virtual]\fP".PPSets the output audio data configuration of an object..PPThis is a virtual function that derived classes can override if needed. Most derived classes will not need to override this function but can simply call it to store the output audio configuration. It is virtual so that it can be overriden by the \fBaflibAudioFile\fP class which needs to implement its own. .PPReimplemented in \fBaflibAudioFile\fP..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 + -