<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.15"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>Audaspace: VolumeReader Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">Audaspace  <span id="projectnumber">1.3.0</span> </div> <div id="projectbrief">A high level audio library.</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.15 --> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ var searchBox = new SearchBox("searchBox", "search",false,'Search'); /* @license-end */ </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); /* @license-end */</script> <div id="main-nav"></div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="classVolumeReader-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">VolumeReader Class Reference</div> </div> </div><!--header--> <div class="contents"> <p>This class represents a reader for a sound that has its own shared volume. <a href="classVolumeReader.html#details">More...</a></p> <p><code>#include <<a class="el" href="VolumeReader_8h_source.html">VolumeReader.h</a>></code></p> <div class="dynheader"> Inheritance diagram for VolumeReader:</div> <div class="dyncontent"> <div class="center"><img src="classVolumeReader__inherit__graph.png" border="0" usemap="#VolumeReader_inherit__map" alt="Inheritance graph"/></div> <map name="VolumeReader_inherit__map" id="VolumeReader_inherit__map"> <area shape="rect" title="This class represents a reader for a sound that has its own shared volume." alt="" coords="5,80,117,107"/> <area shape="rect" href="classIReader.html" title="This class represents a sound source as stream or as buffer which can be read for example by another ..." alt="" coords="27,5,96,32"/> </map> <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:ae9d49297c0c600cde4eded9aaecf4629"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classVolumeReader.html#ae9d49297c0c600cde4eded9aaecf4629">VolumeReader</a> (std::shared_ptr< <a class="el" href="classIReader.html">IReader</a> > reader, std::shared_ptr< <a class="el" href="classVolumeStorage.html">VolumeStorage</a> > volumeStorage)</td></tr> <tr class="memdesc:ae9d49297c0c600cde4eded9aaecf4629"><td class="mdescLeft"> </td><td class="mdescRight">Creates a new volume reader. <a href="#ae9d49297c0c600cde4eded9aaecf4629">More...</a><br /></td></tr> <tr class="separator:ae9d49297c0c600cde4eded9aaecf4629"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ac301a06b28a9d1e82bfb5dba9146b267"><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classVolumeReader.html#ac301a06b28a9d1e82bfb5dba9146b267">isSeekable</a> () const</td></tr> <tr class="memdesc:ac301a06b28a9d1e82bfb5dba9146b267"><td class="mdescLeft"> </td><td class="mdescRight">Tells whether the source provides seeking functionality or not. <a href="#ac301a06b28a9d1e82bfb5dba9146b267">More...</a><br /></td></tr> <tr class="separator:ac301a06b28a9d1e82bfb5dba9146b267"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a433f7b214109455c2bae16359352309b"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classVolumeReader.html#a433f7b214109455c2bae16359352309b">seek</a> (int position)</td></tr> <tr class="memdesc:a433f7b214109455c2bae16359352309b"><td class="mdescLeft"> </td><td class="mdescRight">Seeks to a specific position in the source. <a href="#a433f7b214109455c2bae16359352309b">More...</a><br /></td></tr> <tr class="separator:a433f7b214109455c2bae16359352309b"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a0e8b86af78e089b6e41f000e81f50d08"><td class="memItemLeft" align="right" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="classVolumeReader.html#a0e8b86af78e089b6e41f000e81f50d08">getLength</a> () const</td></tr> <tr class="memdesc:a0e8b86af78e089b6e41f000e81f50d08"><td class="mdescLeft"> </td><td class="mdescRight">Returns an approximated length of the source in samples. <a href="#a0e8b86af78e089b6e41f000e81f50d08">More...</a><br /></td></tr> <tr class="separator:a0e8b86af78e089b6e41f000e81f50d08"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ac9abe14b8a08f9c8819f7a60ba470686"><td class="memItemLeft" align="right" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="classVolumeReader.html#ac9abe14b8a08f9c8819f7a60ba470686">getPosition</a> () const</td></tr> <tr class="memdesc:ac9abe14b8a08f9c8819f7a60ba470686"><td class="mdescLeft"> </td><td class="mdescRight">Returns the position of the source as a sample count value. <a href="#ac9abe14b8a08f9c8819f7a60ba470686">More...</a><br /></td></tr> <tr class="separator:ac9abe14b8a08f9c8819f7a60ba470686"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a1b8e64c092d7f8fd235c4eacf1fabc16"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="structSpecs.html">Specs</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classVolumeReader.html#a1b8e64c092d7f8fd235c4eacf1fabc16">getSpecs</a> () const</td></tr> <tr class="memdesc:a1b8e64c092d7f8fd235c4eacf1fabc16"><td class="mdescLeft"> </td><td class="mdescRight">Returns the specification of the reader. <a href="#a1b8e64c092d7f8fd235c4eacf1fabc16">More...</a><br /></td></tr> <tr class="separator:a1b8e64c092d7f8fd235c4eacf1fabc16"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ab549f99d1f10ca8f00a3ac1d83616887"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classVolumeReader.html#ab549f99d1f10ca8f00a3ac1d83616887">read</a> (int &length, bool &eos, <a class="el" href="Audaspace_8h.html#aa0798f7ea0975b143a1d9deac8c05d43">sample_t</a> *buffer)</td></tr> <tr class="memdesc:ab549f99d1f10ca8f00a3ac1d83616887"><td class="mdescLeft"> </td><td class="mdescRight">Request to read the next length samples out of the source. <a href="#ab549f99d1f10ca8f00a3ac1d83616887">More...</a><br /></td></tr> <tr class="separator:ab549f99d1f10ca8f00a3ac1d83616887"><td class="memSeparator" colspan="2"> </td></tr> <tr class="inherit_header pub_methods_classIReader"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classIReader')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="classIReader.html">IReader</a></td></tr> <tr class="memitem:a3489c23855da532dd3a10cfae78bc899 inherit pub_methods_classIReader"><td class="memItemLeft" align="right" valign="top"><a id="a3489c23855da532dd3a10cfae78bc899"></a> virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classIReader.html#a3489c23855da532dd3a10cfae78bc899">~IReader</a> ()</td></tr> <tr class="memdesc:a3489c23855da532dd3a10cfae78bc899 inherit pub_methods_classIReader"><td class="mdescLeft"> </td><td class="mdescRight">Destroys the reader. <br /></td></tr> <tr class="separator:a3489c23855da532dd3a10cfae78bc899 inherit pub_methods_classIReader"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>This class represents a reader for a sound that has its own shared volume. </p> </div><h2 class="groupheader">Constructor & Destructor Documentation</h2> <a id="ae9d49297c0c600cde4eded9aaecf4629"></a> <h2 class="memtitle"><span class="permalink"><a href="#ae9d49297c0c600cde4eded9aaecf4629">◆ </a></span>VolumeReader()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">VolumeReader::VolumeReader </td> <td>(</td> <td class="paramtype">std::shared_ptr< <a class="el" href="classIReader.html">IReader</a> > </td> <td class="paramname"><em>reader</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">std::shared_ptr< <a class="el" href="classVolumeStorage.html">VolumeStorage</a> > </td> <td class="paramname"><em>volumeStorage</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Creates a new volume reader. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">reader</td><td>A reader of the sound to be assigned to this reader. </td></tr> <tr><td class="paramname">volumeStorage</td><td>A shared pointer to a <a class="el" href="classVolumeStorage.html" title="This class stores a volume value and allows to change if for a number of sounds in one go.">VolumeStorage</a> object. </td></tr> </table> </dd> </dl> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a id="a0e8b86af78e089b6e41f000e81f50d08"></a> <h2 class="memtitle"><span class="permalink"><a href="#a0e8b86af78e089b6e41f000e81f50d08">◆ </a></span>getLength()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual int VolumeReader::getLength </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns an approximated length of the source in samples. </p> <dl class="section return"><dt>Returns</dt><dd>The length as sample count. May be negative if unknown. </dd></dl> <p>Implements <a class="el" href="classIReader.html#a384465b5d988cc802702ae4bdc56ea85">IReader</a>.</p> </div> </div> <a id="ac9abe14b8a08f9c8819f7a60ba470686"></a> <h2 class="memtitle"><span class="permalink"><a href="#ac9abe14b8a08f9c8819f7a60ba470686">◆ </a></span>getPosition()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual int VolumeReader::getPosition </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the position of the source as a sample count value. </p> <dl class="section return"><dt>Returns</dt><dd>The current position in the source. A negative value indicates that the position is unknown. </dd></dl> <dl class="section warning"><dt>Warning</dt><dd>The value returned doesn't always have to be correct for readers, especially after seeking. </dd></dl> <p>Implements <a class="el" href="classIReader.html#a47a8f86fd242a02ff626eb506cdb319d">IReader</a>.</p> </div> </div> <a id="a1b8e64c092d7f8fd235c4eacf1fabc16"></a> <h2 class="memtitle"><span class="permalink"><a href="#a1b8e64c092d7f8fd235c4eacf1fabc16">◆ </a></span>getSpecs()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual <a class="el" href="structSpecs.html">Specs</a> VolumeReader::getSpecs </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the specification of the reader. </p> <dl class="section return"><dt>Returns</dt><dd>The <a class="el" href="structSpecs.html" title="Specification of a sound source.">Specs</a> structure. </dd></dl> <p>Implements <a class="el" href="classIReader.html#aac4f3a14d42e5c4280488db98dd771b1">IReader</a>.</p> </div> </div> <a id="ac301a06b28a9d1e82bfb5dba9146b267"></a> <h2 class="memtitle"><span class="permalink"><a href="#ac301a06b28a9d1e82bfb5dba9146b267">◆ </a></span>isSeekable()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual bool VolumeReader::isSeekable </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Tells whether the source provides seeking functionality or not. </p> <dl class="section warning"><dt>Warning</dt><dd>This doesn't mean that the seeking always has to succeed. </dd></dl> <dl class="section return"><dt>Returns</dt><dd>Always returns true for readers of buffering types. </dd></dl> <p>Implements <a class="el" href="classIReader.html#acf13bbdc14e680c21122981f7d3bf6be">IReader</a>.</p> </div> </div> <a id="ab549f99d1f10ca8f00a3ac1d83616887"></a> <h2 class="memtitle"><span class="permalink"><a href="#ab549f99d1f10ca8f00a3ac1d83616887">◆ </a></span>read()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void VolumeReader::read </td> <td>(</td> <td class="paramtype">int & </td> <td class="paramname"><em>length</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool & </td> <td class="paramname"><em>eos</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="Audaspace_8h.html#aa0798f7ea0975b143a1d9deac8c05d43">sample_t</a> * </td> <td class="paramname"><em>buffer</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Request to read the next length samples out of the source. </p> <p>The buffer supplied has the needed size. </p><dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in,out]</td><td class="paramname">length</td><td>The count of samples that should be read. Shall contain the real count of samples after reading, in case there were only fewer samples available. A smaller value also indicates the end of the reader. </td></tr> <tr><td class="paramdir">[out]</td><td class="paramname">eos</td><td>End of stream, whether the end is reached or not. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">buffer</td><td>The pointer to the buffer to read into. </td></tr> </table> </dd> </dl> <p>Implements <a class="el" href="classIReader.html#aef6fa21dfb71d3065fb14517bf0f24d5">IReader</a>.</p> </div> </div> <a id="a433f7b214109455c2bae16359352309b"></a> <h2 class="memtitle"><span class="permalink"><a href="#a433f7b214109455c2bae16359352309b">◆ </a></span>seek()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void VolumeReader::seek </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"><em>position</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Seeks to a specific position in the source. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">position</td><td>The position to seek for measured in samples. To get from a given time to the samples you simply have to multiply the time value in seconds with the sample rate of the reader. </td></tr> </table> </dd> </dl> <dl class="section warning"><dt>Warning</dt><dd>This may work or not, depending on the actual reader. </dd></dl> <p>Implements <a class="el" href="classIReader.html#ad9fc74bb6f4c2b1ecc0f75b7118c1458">IReader</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li>fx/<a class="el" href="VolumeReader_8h_source.html">VolumeReader.h</a></li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.15 </small></address> </body> </html>