📄 aflibdata.3
字号:
.TH "aflibData" 3 "8 May 2002" "Open Source Audio Library Project" \" -*- nroff -*-.ad l.nh.SH NAMEaflibData \- Main data class for a segment of audio data. .SH SYNOPSIS.br.PP\fC#include <aflibData.h>\fP.PP.SS "Public Methods".in +1c.ti -1c.RI "\fBaflibData\fP (long length)".br.RI "\fIConstructor.\fP".ti -1c.RI "\fBaflibData\fP (const \fBaflibConfig\fP &config, long length)".br.RI "\fIConstructor.\fP".ti -1c.RI "\fBaflibData\fP (const aflibData &data)".br.RI "\fICopy Constructor.\fP".ti -1c.RI "\fB~aflibData\fP ()".br.RI "\fIDestructor.\fP".ti -1c.RI "aflibData & \fBoperator=\fP (const aflibData &data)".br.RI "\fIAssignment operator.\fP".ti -1c.RI "void \fBsetConfig\fP (const \fBaflibConfig\fP &config)".br.RI "\fISet the audio configuration of the data.\fP".ti -1c.RI "const \fBaflibConfig\fP & \fBgetConfig\fP () const".br.RI "\fIGets audio configuration data.\fP".ti -1c.RI "void \fBgetLength\fP (long &length) const".br.RI "\fIGets length of data. This returns the number of samples. It does not matter how many channels. It only means samples no matter how many channels.\fP".ti -1c.RI "long \fBgetLength\fP () const".br.RI "\fISame as getLength(length);.\fP".ti -1c.RI "void \fBgetOrigLength\fP (long &length) const".br.RI "\fIGet the original length. This returns the original number of samples that was used to allocate space. If the samples are adjusted down then this is the original value and not the adjusted value. It does not matter how many channels. It only means samples no matter how many channels.\fP".ti -1c.RI "long \fBgetOrigLength\fP () const".br.RI "\fISame as getOrigLength(length).\fP".ti -1c.RI "void \fBadjustLength\fP (long length)".br.RI "\fIAdjust size of data array.\fP".ti -1c.RI "void \fBadjustTotalLength\fP (long length)".br.RI "\fIAdjust total size of data array.\fP".ti -1c.RI "long \fBgetTotalLength\fP ()".br.RI "\fIGets the total length of memory that is allocated.\fP".ti -1c.RI "long \fBgetTotalAdjustLength\fP ()".br.RI "\fIGets the total length of memory that is adjusted.\fP".ti -1c.RI "void * \fBgetDataPointer\fP () const".br.RI "\fIGet a pointer to the internal data.\fP".ti -1c.RI "void \fBsetSample\fP (int sample, long position, int channel)".br.RI "\fISets a sample of audio data.\fP".ti -1c.RI "int \fBgetSample\fP (long position, int channel)".br.RI "\fIGets a sample of audio data.\fP".ti -1c.RI "void \fBgetMinMax\fP (int &min_value, int &max_value) const".br.RI "\fIReturns absolute min and max values of data type selected.\fP".ti -1c.RI "void \fBconvertToSize\fP (\fBaflib_data_size\fP data_size)".br.RI "\fIConvert data from one data size to another.\fP".ti -1c.RI "void \fBconvertToEndian\fP (\fBaflib_data_endian\fP endian)".br.RI "\fIConverts data from one endian format to another.\fP".ti -1c.RI "\fBaflib_data_endian\fP \fBgetHostEndian\fP () const".br.RI "\fIReturns endian state of this computer platform.\fP".ti -1c.RI "void \fBzeroData\fP ()".br.RI "\fIThis will zero all audio data in this object.\fP".in -1c.SH "DETAILED DESCRIPTION".PP Main data class for a segment of audio data..PPThis is the main data class that defines a segment of audio data. The length of data can be set in the constructor. The configuration of the data can also be set either in the constructor or seperately. The actual space for the data is allocated in this class and should not be freed or allocated outside this class. This class provides access to this memory via a getDataPointer function. But it is encouraged to use the getSample and setSample functions to manipulate the data. These functions are not efficient and will be made so in the future. For those who wish to use the pointer access function then a call to getTotalLength should be made first. This will tell them the total length of the allocated memory buffer. It is up to the caller to make sure one does not write or read beyond this buffer. This class also provides convience functions to manipulate data. Functions convertToSize and convertToEndian will convert from one format to another. Function zeroData will zero all audio data..PPA copy constructor and assignment operator are provided so that an aflibData object can be set to the same data as another aflibData object. .PP.SH "CONSTRUCTOR & DESTRUCTOR DOCUMENTATION".PP .SS "aflibData::aflibData (long length)".PPConstructor..PP.SS "aflibData::aflibData (const \fBaflibConfig\fP & config, long length)".PPConstructor..PP.SS "aflibData::aflibData (const aflibData & data)".PPCopy Constructor..PPThis copy constructor will create another data object with the same data as the other one. It will have newly allocated memory with an identical configuration and data. .SS "aflibData::~aflibData ()".PPDestructor..PP.SH "MEMBER FUNCTION DOCUMENTATION".PP .SS "void aflibData::adjustLength (long length)".PPAdjust size of data array..PPThis allows one to adjust the size of the data array downward without allocating new data. This is useful when a data object is passed to a read file class with a certain size. If we are at the end of the file and only a portion of the data requested is available then the size of the data object can be changed downward. .SS "void aflibData::adjustTotalLength (long length)".PPAdjust total size of data array..PPThis allows one to adjust the size of the data array downward without allocating new data. This is useful when a data object is passed to a read file class with a certain size. If we are at the end of the file and only a portion of the data requested is available then the size of the data object can be changed downward. The parameter passed is in total bytes not samples .SS "void aflibData::convertToEndian (\fBaflib_data_endian\fP endian)".PPConverts data from one endian format to another..PPThis function will convert the data in this object to a different endian layout. If the user passes the endian layout that the data is currently in then nothing will be done. .SS "void aflibData::convertToSize (\fBaflib_data_size\fP data_size)".PPConvert data from one data size to another..PPThis function will convert the data in this object to a different size. It will rescale the data. If the user passes the data size that the data is currently in then nothing will be done. .SS "const \fBaflibConfig\fP & aflibData::getConfig () const".PPGets audio configuration data..PP.SS "void * aflibData::getDataPointer () const".PPGet a pointer to the internal data..PPThis will return a void pointer to the internally allocated data array. One should use the setSample and getSample routines if at all possible instead of this one. Possible exceptions are the start of an audio chain such as a device or file. In that case we determine the data layout so we can just get a pointer to the data and copy the data. getTotalLength will tell the total size of the allocated memory. One should not read or write beyond this value. .SS "\fBaflib_data_endian\fP aflibData::getHostEndian () const".PPReturns endian state of this computer platform..PP.SS "long aflibData::getLength () const".PPSame as getLength(length);..PP.SS "void aflibData::getLength (long & length) const".PPGets length of data. This returns the number of samples. It does not matter how many channels. It only means samples no matter how many channels..PP.SS "void aflibData::getMinMax (int & min_value, int & max_value) const".PPReturns absolute min and max values of data type selected..PP.SS "long aflibData::getOrigLength () const".PPSame as getOrigLength(length)..PP.SS "void aflibData::getOrigLength (long & length) const".PPGet the original length. This returns the original number of samples that was used to allocate space. If the samples are adjusted down then this is the original value and not the adjusted value. It does not matter how many channels. It only means samples no matter how many channels..PP.SS "int aflibData::getSample (long position, int channel)".PPGets a sample of audio data..PPThis will retrieve a single data value from interval memory and return it as an int. First position begins at 0. First channel begins at 0. .SS "long aflibData::getTotalAdjustLength ()".PPGets the total length of memory that is adjusted..PP.SS "long aflibData::getTotalLength ()".PPGets the total length of memory that is allocated..PP.SS "aflibData & aflibData::operator= (const aflibData & data)".PPAssignment operator..PPThis will set one data object with the same data as the other one. It will have newly allocated memory with an identical configuration and data. .SS "void aflibData::setConfig (const \fBaflibConfig\fP & config)".PPSet the audio configuration of the data..PPThis allows one to set the audio configuration of this data class. This can be used when it was not set in the constructor or one needs to change it. Any audio data stored will be lost and a new array allocated. .SS "void aflibData::setSample (int sample, long position, int channel)".PPSets a sample of audio data..PPThis stores a single sample value into the data array based on the audio configuration data. First position begins at 0. First channel begins at 0. .SS "void aflibData::zeroData ()".PPThis will zero all audio data in 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 + -