📄 classaflibdata.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>aflibData class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.15 --><center><a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center><hr><h1>aflibData Class Reference</h1>Main data class for a segment of audio data. <a href="#_details">More...</a><p><code>#include <<a class="el" href="aflibData_8h-source.html">aflibData.h</a>></code><p><a href="classaflibData-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0><tr><td colspan=2><br><h2>Public Methods</h2></td></tr><tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classaflibData.html#a0">aflibData</a> (long length)</td></tr><tr><td> </td><td><font size=-1><em>Constructor.</em> <a href="#a0">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classaflibData.html#a1">aflibData</a> (const <a class="el" href="classaflibConfig.html">aflibConfig</a> &config, long length)</td></tr><tr><td> </td><td><font size=-1><em>Constructor.</em> <a href="#a1">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classaflibData.html#a2">aflibData</a> (const aflibData &data)</td></tr><tr><td> </td><td><font size=-1><em>Copy Constructor.</em> <a href="#a2">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classaflibData.html#a3">~aflibData</a> ()</td></tr><tr><td> </td><td><font size=-1><em>Destructor.</em> <a href="#a3">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>aflibData & </td><td valign=bottom><a class="el" href="classaflibData.html#a4">operator=</a> (const aflibData &data)</td></tr><tr><td> </td><td><font size=-1><em>Assignment operator.</em> <a href="#a4">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classaflibData.html#a5">setConfig</a> (const <a class="el" href="classaflibConfig.html">aflibConfig</a> &config)</td></tr><tr><td> </td><td><font size=-1><em>Set the audio configuration of the data.</em> <a href="#a5">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>const <a class="el" href="classaflibConfig.html">aflibConfig</a> & </td><td valign=bottom><a class="el" href="classaflibData.html#a6">getConfig</a> () const</td></tr><tr><td> </td><td><font size=-1><em>Gets audio configuration data.</em> <a href="#a6">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classaflibData.html#a7">getLength</a> (long &length) const</td></tr><tr><td> </td><td><font size=-1><em>Gets 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.</em> <a href="#a7">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>long </td><td valign=bottom><a class="el" href="classaflibData.html#a8">getLength</a> () const</td></tr><tr><td> </td><td><font size=-1><em>Same as getLength(length);.</em> <a href="#a8">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classaflibData.html#a9">getOrigLength</a> (long &length) const</td></tr><tr><td> </td><td><font size=-1><em>Get 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.</em> <a href="#a9">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>long </td><td valign=bottom><a class="el" href="classaflibData.html#a10">getOrigLength</a> () const</td></tr><tr><td> </td><td><font size=-1><em>Same as getOrigLength(length).</em> <a href="#a10">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classaflibData.html#a11">adjustLength</a> (long length)</td></tr><tr><td> </td><td><font size=-1><em>Adjust size of data array.</em> <a href="#a11">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classaflibData.html#a12">adjustTotalLength</a> (long length)</td></tr><tr><td> </td><td><font size=-1><em>Adjust total size of data array.</em> <a href="#a12">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>long </td><td valign=bottom><a class="el" href="classaflibData.html#a13">getTotalLength</a> ()</td></tr><tr><td> </td><td><font size=-1><em>Gets the total length of memory that is allocated.</em> <a href="#a13">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>long </td><td valign=bottom><a class="el" href="classaflibData.html#a14">getTotalAdjustLength</a> ()</td></tr><tr><td> </td><td><font size=-1><em>Gets the total length of memory that is adjusted.</em> <a href="#a14">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>void * </td><td valign=bottom><a class="el" href="classaflibData.html#a15">getDataPointer</a> () const</td></tr><tr><td> </td><td><font size=-1><em>Get a pointer to the internal data.</em> <a href="#a15">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classaflibData.html#a16">setSample</a> (int sample, long position, int channel)</td></tr><tr><td> </td><td><font size=-1><em>Sets a sample of audio data.</em> <a href="#a16">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="classaflibData.html#a17">getSample</a> (long position, int channel)</td></tr><tr><td> </td><td><font size=-1><em>Gets a sample of audio data.</em> <a href="#a17">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classaflibData.html#a18">getMinMax</a> (int &min_value, int &max_value) const</td></tr><tr><td> </td><td><font size=-1><em>Returns absolute min and max values of data type selected.</em> <a href="#a18">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classaflibData.html#a19">convertToSize</a> (<a class="el" href="aflib_8h.html#a30">aflib_data_size</a> data_size)</td></tr><tr><td> </td><td><font size=-1><em>Convert data from one data size to another.</em> <a href="#a19">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classaflibData.html#a20">convertToEndian</a> (<a class="el" href="aflib_8h.html#a31">aflib_data_endian</a> endian)</td></tr><tr><td> </td><td><font size=-1><em>Converts data from one endian format to another.</em> <a href="#a20">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top><a class="el" href="aflib_8h.html#a31">aflib_data_endian</a> </td><td valign=bottom><a class="el" href="classaflibData.html#a21">getHostEndian</a> () const</td></tr><tr><td> </td><td><font size=-1><em>Returns endian state of this computer platform.</em> <a href="#a21">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classaflibData.html#a22">zeroData</a> ()</td></tr><tr><td> </td><td><font size=-1><em>This will zero all audio data in this object.</em> <a href="#a22">More...</a><em></em></font><br><br></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>Main data class for a segment of audio data.<p>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.<p>A copy constructor and assignment operator are provided so that an aflibData object can be set to the same data as another aflibData object. <p><hr><h2>Constructor & Destructor Documentation</h2><a name="a0" doxytag="aflibData::aflibData"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> aflibData::aflibData </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">long </td> <td class="mdname1" valign="top" nowrap> <em>length</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Constructor.<p> </td> </tr></table><a name="a1" doxytag="aflibData::aflibData"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> aflibData::aflibData </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classaflibConfig.html">aflibConfig</a> & </td> <td class="mdname" nowrap> <em>config</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>long </td> <td class="mdname" nowrap> <em>length</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Constructor.<p> </td> </tr></table><a name="a2" doxytag="aflibData::aflibData"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> aflibData::aflibData </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const aflibData & </td> <td class="mdname1" valign="top" nowrap> <em>data</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Copy Constructor.<p>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. </td> </tr></table><a name="a3" doxytag="aflibData::~aflibData"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> aflibData::~aflibData </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Destructor.<p> </td> </tr></table><hr><h2>Member Function Documentation</h2><a name="a11" doxytag="aflibData::adjustLength"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void aflibData::adjustLength </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">long </td> <td class="mdname1" valign="top" nowrap> <em>length</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Adjust size of data array.<p>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. </td> </tr></table><a name="a12" doxytag="aflibData::adjustTotalLength"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void aflibData::adjustTotalLength </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">long </td> <td class="mdname1" valign="top" nowrap> <em>length</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Adjust total size of data array.<p>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 </td> </tr></table><a name="a20" doxytag="aflibData::convertToEndian"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void aflibData::convertToEndian </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="aflib_8h.html#a31">aflib_data_endian</a> </td> <td class="mdname1" valign="top" nowrap> <em>endian</em> </td> <td class="md" valign="top">) </td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -