proteaAudio/doc/class_device_audio.html
2012-05-27 18:34:36 -04:00

920 lines
36 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>proteaAudio</title>
<link href="protea.css" rel="stylesheet" type="text/css">
</head><body>
<div style="text-align: center"><img src="proteaAudio.png"/></div>
<!-- Generated by Doxygen 1.4.3 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<h1>DeviceAudio Class Reference</h1><!-- doxytag: class=<DeviceAudio> -->abstract base class for stereo audio mixer/playback devices
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="pro_audio_8h-source.html">proAudio.h</a>&gt;</code>
<p>
<p>Inheritance diagram for DeviceAudio:
<p><center><img src="class_device_audio.png" usemap="#DeviceAudio_map" border="0" alt=""></center>
<map name="DeviceAudio_map">
<area href="class_device_audio_rt.html" alt="DeviceAudioRt" shape="rect" coords="0,56,103,80">
<area href="class_device_audio_sdl.html" alt="DeviceAudioSdl" shape="rect" coords="113,56,216,80">
</map>
<a href="class_device_audio-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio.html#a0">volume</a> (float left, float right)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio.html#a1">volume</a> (float leftAndRight)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio.html#a2">loaderRegister</a> (<a class="el" href="class_audio_sample.html">AudioSample</a> *(*loadFunc)(const std::string &amp;), const std::string &amp;suffix)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio.html#a3">loaderAvailable</a> (const std::string &amp;suffix) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio.html#a4">sampleFromFile</a> (const std::string &amp;filename, float volume=1.0f)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio.html#a5">sampleFromMemory</a> (const <a class="el" href="class_audio_sample.html">AudioSample</a> &amp;sample, float volume=1.0f)=0</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio.html#a6">sampleDestroy</a> (unsigned int sample)=0</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual const <a class="el" href="class_audio_sample.html">AudioSample</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio.html#a7">sample</a> (unsigned int handle) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio.html#a8">soundPlay</a> (unsigned int sample, float volumeL=1.0f, float volumeR=1.0f, float disparity=0.0f, float pitch=1.0f)=0</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio.html#a9">soundLoop</a> (unsigned int sample, float volumeL=1.0f, float volumeR=1.0f, float disparity=0.0f, float pitch=1.0f)=0</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio.html#a10">soundUpdate</a> (unsigned int sound, float volumeL, float volumeR, float disparity=0.0f, float pitch=1.0f)=0</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio.html#a11">soundStop</a> (unsigned int sound)=0</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio.html#a12">soundStop</a> ()=0</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio.html#a13">soundActive</a> () const =0</td></tr>
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="class_device_audio.html">DeviceAudio</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio.html#e0">singleton</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio.html#e1">destroy</a> ()</td></tr>
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio.html#b0">DeviceAudio</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio.html#b1">~DeviceAudio</a> ()</td></tr>
<tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio.html#p0">m_freqOut</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">float&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio.html#p1">m_volL</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">float&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio.html#p2">m_volR</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">std::map&lt; std::string, <a class="el" href="class_audio_sample.html">AudioSample</a> <br>
*(*)(const std::string &amp;)&gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio.html#p3">mm_loader</a></td></tr>
<tr><td colspan="2"><br><h2>Static Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="class_device_audio.html">DeviceAudio</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio.html#t0">s_instance</a></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
abstract base class for stereo audio mixer/playback devices
<p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="b0"></a><!-- doxytag: member=<DeviceAudio::DeviceAudio> ref=<b0> args=<()> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">DeviceAudio::DeviceAudio </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [protected]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
constructor
<p>
</td>
</tr>
</table>
<a class="anchor" name="b1"></a><!-- doxytag: member=<DeviceAudio::~DeviceAudio> ref=<b1> args=<()> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual DeviceAudio::~DeviceAudio </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [inline, protected, virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
destructor
<p>
</td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="e1"></a><!-- doxytag: member=<DeviceAudio::destroy> ref=<e1> args=<()> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">static void DeviceAudio::destroy </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [inline, static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
calls the destructor of the singleton object
<p>
</td>
</tr>
</table>
<a class="anchor" name="a3"></a><!-- doxytag: member=<DeviceAudio::loaderAvailable> ref=<a3> args=<(const std::string &amp;suffix) const > --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">bool DeviceAudio::loaderAvailable </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const std::string &amp;&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>suffix</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
returns true in case a loader for this file type is available
<p>
</td>
</tr>
</table>
<a class="anchor" name="a2"></a><!-- doxytag: member=<DeviceAudio::loaderRegister> ref=<a2> args=<(AudioSample *(*loadFunc)(const std::string &amp;), const std::string &amp;suffix)> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">bool DeviceAudio::loaderRegister </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="class_audio_sample.html">AudioSample</a> *(*)(const std::string &amp;)&nbsp;</td>
<td class="mdname" nowrap> <em>loadFunc</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const std::string &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>suffix</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
registers an audio sample loader function handling a file type identified by suffix
<p>
The function has to be of type <a class="el" href="class_audio_sample.html">AudioSample</a> * loadXYZ(const std::string &amp; filename). </td>
</tr>
</table>
<a class="anchor" name="a7"></a><!-- doxytag: member=<DeviceAudio::sample> ref=<a7> args=<(unsigned int handle) const > --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual const <a class="el" href="class_audio_sample.html">AudioSample</a>* DeviceAudio::sample </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">unsigned int&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>handle</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap> const<code> [inline, virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
allows read access to a sample identified by its handle
<p>
<p>
Reimplemented in <a class="el" href="class_device_audio_rt.html#a2">DeviceAudioRt</a>. </td>
</tr>
</table>
<a class="anchor" name="a6"></a><!-- doxytag: member=<DeviceAudio::sampleDestroy> ref=<a6> args=<(unsigned int sample)=0> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual bool DeviceAudio::sampleDestroy </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">unsigned int&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>sample</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [pure virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
deletes a previously created sound sample resource identified by its handle
<p>
<p>
Implemented in <a class="el" href="class_device_audio_rt.html#a1">DeviceAudioRt</a>, and <a class="el" href="class_device_audio_sdl.html#a1">DeviceAudioSdl</a>. </td>
</tr>
</table>
<a class="anchor" name="a4"></a><!-- doxytag: member=<DeviceAudio::sampleFromFile> ref=<a4> args=<(const std::string &amp;filename, float volume=1.0f)> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual unsigned int DeviceAudio::sampleFromFile </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const std::string &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>filename</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float&nbsp;</td>
<td class="mdname" nowrap> <em>volume</em> = <code>1.0f</code></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
loads a sound sample from file, optionally adjusts volume, returns handle
<p>
</td>
</tr>
</table>
<a class="anchor" name="a5"></a><!-- doxytag: member=<DeviceAudio::sampleFromMemory> ref=<a5> args=<(const AudioSample &amp;sample, float volume=1.0f)=0> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual unsigned int DeviceAudio::sampleFromMemory </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const <a class="el" href="class_audio_sample.html">AudioSample</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>sample</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float&nbsp;</td>
<td class="mdname" nowrap> <em>volume</em> = <code>1.0f</code></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [pure virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
converts a sound sample to internal audio format, returns handle
<p>
<p>
Implemented in <a class="el" href="class_device_audio_rt.html#a0">DeviceAudioRt</a>, and <a class="el" href="class_device_audio_sdl.html#a0">DeviceAudioSdl</a>. </td>
</tr>
</table>
<a class="anchor" name="e0"></a><!-- doxytag: member=<DeviceAudio::singleton> ref=<e0> args=<()> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">static <a class="el" href="class_device_audio.html">DeviceAudio</a>&amp; DeviceAudio::singleton </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [inline, static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
returns singleton object
<p>
This call is only allowed after a successful precedent creation of an audio device </td>
</tr>
</table>
<a class="anchor" name="a13"></a><!-- doxytag: member=<DeviceAudio::soundActive> ref=<a13> args=<() const =0> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual unsigned int DeviceAudio::soundActive </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap> const<code> [pure virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
returns number of currently active sounds
<p>
<p>
Implemented in <a class="el" href="class_device_audio_rt.html#a8">DeviceAudioRt</a>, and <a class="el" href="class_device_audio_sdl.html#a7">DeviceAudioSdl</a>. </td>
</tr>
</table>
<a class="anchor" name="a9"></a><!-- doxytag: member=<DeviceAudio::soundLoop> ref=<a9> args=<(unsigned int sample, float volumeL=1.0f, float volumeR=1.0f, float disparity=0.0f, float pitch=1.0f)=0> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual unsigned int DeviceAudio::soundLoop </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">unsigned int&nbsp;</td>
<td class="mdname" nowrap> <em>sample</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float&nbsp;</td>
<td class="mdname" nowrap> <em>volumeL</em> = <code>1.0f</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float&nbsp;</td>
<td class="mdname" nowrap> <em>volumeR</em> = <code>1.0f</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float&nbsp;</td>
<td class="mdname" nowrap> <em>disparity</em> = <code>0.0f</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float&nbsp;</td>
<td class="mdname" nowrap> <em>pitch</em> = <code>1.0f</code></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [pure virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
plays a specified sound sample continuously and sets its parameters
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>sample</em>&nbsp;</td><td>handle of a previously loaded sample </td></tr>
<tr><td valign="top"></td><td valign="top"><em>volumeL</em>&nbsp;</td><td>(optional) left volume </td></tr>
<tr><td valign="top"></td><td valign="top"><em>volumeR</em>&nbsp;</td><td>(optional) right volume </td></tr>
<tr><td valign="top"></td><td valign="top"><em>disparity</em>&nbsp;</td><td>(optional) time difference between left and right channel in seconds. Use negative values to specify a delay for the left channel, positive for the right. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>pitch</em>&nbsp;</td><td>(optional) pitch factor for playback. 0.5 corresponds to one octave below, 2.0 to one above the original sample. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>a handle to the currently played sound or -1 in case of error </dd></dl>
<p>
Implemented in <a class="el" href="class_device_audio_rt.html#a4">DeviceAudioRt</a>, and <a class="el" href="class_device_audio_sdl.html#a3">DeviceAudioSdl</a>. </td>
</tr>
</table>
<a class="anchor" name="a8"></a><!-- doxytag: member=<DeviceAudio::soundPlay> ref=<a8> args=<(unsigned int sample, float volumeL=1.0f, float volumeR=1.0f, float disparity=0.0f, float pitch=1.0f)=0> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual unsigned int DeviceAudio::soundPlay </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">unsigned int&nbsp;</td>
<td class="mdname" nowrap> <em>sample</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float&nbsp;</td>
<td class="mdname" nowrap> <em>volumeL</em> = <code>1.0f</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float&nbsp;</td>
<td class="mdname" nowrap> <em>volumeR</em> = <code>1.0f</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float&nbsp;</td>
<td class="mdname" nowrap> <em>disparity</em> = <code>0.0f</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float&nbsp;</td>
<td class="mdname" nowrap> <em>pitch</em> = <code>1.0f</code></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [pure virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
plays a specified sound sample once and sets its parameters
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>sample</em>&nbsp;</td><td>handle of a previously loaded sample </td></tr>
<tr><td valign="top"></td><td valign="top"><em>volumeL</em>&nbsp;</td><td>(optional) left volume </td></tr>
<tr><td valign="top"></td><td valign="top"><em>volumeR</em>&nbsp;</td><td>(optional) right volume </td></tr>
<tr><td valign="top"></td><td valign="top"><em>disparity</em>&nbsp;</td><td>(optional) time difference between left and right channel in seconds. Use negative values to specify a delay for the left channel, positive for the right. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>pitch</em>&nbsp;</td><td>(optional) pitch factor for playback. 0.5 corresponds to one octave below, 2.0 to one above the original sample. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>a handle to the currently played sound or -1 in case of error </dd></dl>
<p>
Implemented in <a class="el" href="class_device_audio_rt.html#a3">DeviceAudioRt</a>, and <a class="el" href="class_device_audio_sdl.html#a2">DeviceAudioSdl</a>. </td>
</tr>
</table>
<a class="anchor" name="a12"></a><!-- doxytag: member=<DeviceAudio::soundStop> ref=<a12> args=<()=0> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual void DeviceAudio::soundStop </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [pure virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
stops all sounds immediately
<p>
<p>
Implemented in <a class="el" href="class_device_audio_rt.html#a7">DeviceAudioRt</a>, and <a class="el" href="class_device_audio_sdl.html#a6">DeviceAudioSdl</a>. </td>
</tr>
</table>
<a class="anchor" name="a11"></a><!-- doxytag: member=<DeviceAudio::soundStop> ref=<a11> args=<(unsigned int sound)=0> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual bool DeviceAudio::soundStop </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">unsigned int&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>sound</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [pure virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
stops a specified sound immediately
<p>
<p>
Implemented in <a class="el" href="class_device_audio_rt.html#a6">DeviceAudioRt</a>, and <a class="el" href="class_device_audio_sdl.html#a5">DeviceAudioSdl</a>. </td>
</tr>
</table>
<a class="anchor" name="a10"></a><!-- doxytag: member=<DeviceAudio::soundUpdate> ref=<a10> args=<(unsigned int sound, float volumeL, float volumeR, float disparity=0.0f, float pitch=1.0f)=0> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual bool DeviceAudio::soundUpdate </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">unsigned int&nbsp;</td>
<td class="mdname" nowrap> <em>sound</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float&nbsp;</td>
<td class="mdname" nowrap> <em>volumeL</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float&nbsp;</td>
<td class="mdname" nowrap> <em>volumeR</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float&nbsp;</td>
<td class="mdname" nowrap> <em>disparity</em> = <code>0.0f</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float&nbsp;</td>
<td class="mdname" nowrap> <em>pitch</em> = <code>1.0f</code></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [pure virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
updates parameters of a specified sound
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>sound</em>&nbsp;</td><td>handle of a currently active sound </td></tr>
<tr><td valign="top"></td><td valign="top"><em>volumeL</em>&nbsp;</td><td>left volume </td></tr>
<tr><td valign="top"></td><td valign="top"><em>volumeR</em>&nbsp;</td><td>right volume </td></tr>
<tr><td valign="top"></td><td valign="top"><em>disparity</em>&nbsp;</td><td>(optional) time difference between left and right channel in seconds. Use negative values to specify a delay for the left channel, positive for the right. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>pitch</em>&nbsp;</td><td>(optional) pitch factor for playback. 0.5 corresponds to one octave below, 2.0 to one above the original sample. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>true in case the parameters have been updated successfully </dd></dl>
<p>
Implemented in <a class="el" href="class_device_audio_rt.html#a5">DeviceAudioRt</a>, and <a class="el" href="class_device_audio_sdl.html#a4">DeviceAudioSdl</a>. </td>
</tr>
</table>
<a class="anchor" name="a1"></a><!-- doxytag: member=<DeviceAudio::volume> ref=<a1> args=<(float leftAndRight)> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void DeviceAudio::volume </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">float&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>leftAndRight</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
sets master volume
<p>
</td>
</tr>
</table>
<a class="anchor" name="a0"></a><!-- doxytag: member=<DeviceAudio::volume> ref=<a0> args=<(float left, float right)> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void DeviceAudio::volume </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">float&nbsp;</td>
<td class="mdname" nowrap> <em>left</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float&nbsp;</td>
<td class="mdname" nowrap> <em>right</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
sets master volume
<p>
</td>
</tr>
</table>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="p0"></a><!-- doxytag: member=<DeviceAudio::m_freqOut> ref=<p0> args=<> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">unsigned int <a class="el" href="class_device_audio.html#p0">DeviceAudio::m_freqOut</a><code> [protected]</code> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
stores output stream frequency
<p>
</td>
</tr>
</table>
<a class="anchor" name="p1"></a><!-- doxytag: member=<DeviceAudio::m_volL> ref=<p1> args=<> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">float <a class="el" href="class_device_audio.html#p1">DeviceAudio::m_volL</a><code> [protected]</code> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
stores left master volume
<p>
</td>
</tr>
</table>
<a class="anchor" name="p2"></a><!-- doxytag: member=<DeviceAudio::m_volR> ref=<p2> args=<> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">float <a class="el" href="class_device_audio.html#p2">DeviceAudio::m_volR</a><code> [protected]</code> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
stores right master volume
<p>
</td>
</tr>
</table>
<a class="anchor" name="p3"></a><!-- doxytag: member=<DeviceAudio::mm_loader> ref=<p3> args=<> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">std::map&lt;std::string, <a class="el" href="class_audio_sample.html">AudioSample</a> * (*)(const std::string &amp;)&gt; <a class="el" href="class_device_audio.html#p3">DeviceAudio::mm_loader</a><code> [protected]</code> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
map associating suffixes to loader functions
<p>
</td>
</tr>
</table>
<a class="anchor" name="t0"></a><!-- doxytag: member=<DeviceAudio::s_instance> ref=<t0> args=<> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"><a class="el" href="class_device_audio.html">DeviceAudio</a>* <a class="el" href="class_device_audio.html#t0">DeviceAudio::s_instance</a><code> [static, protected]</code> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
pointer to singleton
<p>
</td>
</tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="pro_audio_8h-source.html">proAudio.h</a></ul>
<div style="border-width: 1px; border-top-color: gray; border-top-style: solid; margin: 2em 0 0 0;">
<table cols="2" width="100%" border="0"><tr>
<td style = "text-align: left; font-size: 75%; padding: 0em 2em;">
&copy; 2009-02-04 by Gerald Franz, www.viremo.de
</td>
<td style = "text-align: right; font-size: 75%; padding: 0em 2em;">
<a href="../impressum.html">impressum</a>
</td>
</tr></table>
</div>
</body>
</html>