.TH "aflibData" 3 "16 Jan 2007" "Open Source Audio Library Project" \" -*- nroff -*- .ad l .nh .SH NAME aflibData \- Main data class for a segment of audio data. .PP .SH SYNOPSIS .br .PP \fC#include \fP .PP .SS "Public Member Functions" .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 \fBaflibData\fP &data)" .br .RI "\fICopy Constructor. \fP" .ti -1c .RI "\fB~aflibData\fP ()" .br .RI "\fIDestructor. \fP" .ti -1c .RI "\fBaflibData\fP & \fBoperator=\fP (const \fBaflibData\fP &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 (aflib_data_size data_size)" .br .RI "\fIConvert data from one data size to another. \fP" .ti -1c .RI "void \fBconvertToEndian\fP (aflib_data_endian endian)" .br .RI "\fIConverts data from one endian format to another. \fP" .ti -1c .RI "aflib_data_endian \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. This 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. .PP A copy constructor and assignment operator are provided so that an \fBaflibData\fP object can be set to the same data as another \fBaflibData\fP object. .PP .SH "Constructor & Destructor Documentation" .PP .SS "aflibData::aflibData (const \fBaflibData\fP & data)" .PP Copy Constructor. .PP This 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. .SH "Member Function Documentation" .PP .SS "void aflibData::adjustLength (long length)" .PP Adjust size of data array. .PP This 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)" .PP Adjust total size of data array. .PP This 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 (aflib_data_endian endian)" .PP Converts data from one endian format to another. .PP This 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 (aflib_data_size data_size)" .PP Convert data from one data size to another. .PP This 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 "void * aflibData::getDataPointer () const" .PP Get a pointer to the internal data. .PP This 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 "int aflibData::getSample (long position, int channel)" .PP Gets a sample of audio data. .PP This 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 "\fBaflibData\fP & aflibData::operator= (const \fBaflibData\fP & data)" .PP Assignment operator. .PP This 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)" .PP Set the audio configuration of the data. .PP This 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)" .PP Sets a sample of audio data. .PP This 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. .SH "Author" .PP Generated automatically by Doxygen for Open Source Audio Library Project from the source code.