summaryrefslogtreecommitdiff
path: root/doc/html/SoundStream_8hpp-source.htm
diff options
context:
space:
mode:
authorChristoph Egger <Christoph.Egger@gmx.de>2009-01-10 16:57:24 +0100
committerChristoph Egger <Christoph.Egger@gmx.de>2009-01-10 16:57:24 +0100
commit9f9ee9c9f37ae026eb06e897a313aa26f68bf612 (patch)
treeb25b7f4dc4fa8958ee78fa0db70b77a2ad4466f6 /doc/html/SoundStream_8hpp-source.htm
parentbc4a35d2daf373cbf5b957234447ba80abd25eb8 (diff)
Imported Upstream version 1.4
Diffstat (limited to 'doc/html/SoundStream_8hpp-source.htm')
-rwxr-xr-xdoc/html/SoundStream_8hpp-source.htm143
1 files changed, 143 insertions, 0 deletions
diff --git a/doc/html/SoundStream_8hpp-source.htm b/doc/html/SoundStream_8hpp-source.htm
new file mode 100755
index 0000000..a374659
--- /dev/null
+++ b/doc/html/SoundStream_8hpp-source.htm
@@ -0,0 +1,143 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+ <head>
+ <title>SFML - Simple and Fast Multimedia Library</title>
+ <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
+ <link href="doxygen.css" rel="stylesheet" type="text/css" />
+ <link href="tabs.css" rel="stylesheet" type="text/css" />
+ </head>
+ <body>
+ <div id="logo">
+ <img src="./logo.jpg" width="770" height="200" title="SFML home" alt="SFML logo" />
+ </div>
+<!-- Generated by Doxygen 1.5.2 -->
+<div class="tabs">
+ <ul>
+ <li><a href="index.htm"><span>Main&nbsp;Page</span></a></li>
+ <li><a href="namespaces.htm"><span>Namespaces</span></a></li>
+ <li><a href="classes.htm"><span>Classes</span></a></li>
+ <li class="current"><a href="files.htm"><span>Files</span></a></li>
+ </ul>
+</div>
+<h1>SoundStream.hpp</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001
+<a name="l00002"></a>00002 <span class="comment">//</span>
+<a name="l00003"></a>00003 <span class="comment">// SFML - Simple and Fast Multimedia Library</span>
+<a name="l00004"></a>00004 <span class="comment">// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)</span>
+<a name="l00005"></a>00005 <span class="comment">//</span>
+<a name="l00006"></a>00006 <span class="comment">// This software is provided 'as-is', without any express or implied warranty.</span>
+<a name="l00007"></a>00007 <span class="comment">// In no event will the authors be held liable for any damages arising from the use of this software.</span>
+<a name="l00008"></a>00008 <span class="comment">//</span>
+<a name="l00009"></a>00009 <span class="comment">// Permission is granted to anyone to use this software for any purpose,</span>
+<a name="l00010"></a>00010 <span class="comment">// including commercial applications, and to alter it and redistribute it freely,</span>
+<a name="l00011"></a>00011 <span class="comment">// subject to the following restrictions:</span>
+<a name="l00012"></a>00012 <span class="comment">//</span>
+<a name="l00013"></a>00013 <span class="comment">// 1. The origin of this software must not be misrepresented;</span>
+<a name="l00014"></a>00014 <span class="comment">// you must not claim that you wrote the original software.</span>
+<a name="l00015"></a>00015 <span class="comment">// If you use this software in a product, an acknowledgment</span>
+<a name="l00016"></a>00016 <span class="comment">// in the product documentation would be appreciated but is not required.</span>
+<a name="l00017"></a>00017 <span class="comment">//</span>
+<a name="l00018"></a>00018 <span class="comment">// 2. Altered source versions must be plainly marked as such,</span>
+<a name="l00019"></a>00019 <span class="comment">// and must not be misrepresented as being the original software.</span>
+<a name="l00020"></a>00020 <span class="comment">//</span>
+<a name="l00021"></a>00021 <span class="comment">// 3. This notice may not be removed or altered from any source distribution.</span>
+<a name="l00022"></a>00022 <span class="comment">//</span>
+<a name="l00024"></a>00024 <span class="comment"></span>
+<a name="l00025"></a>00025 <span class="preprocessor">#ifndef SFML_SOUNDSTREAM_HPP</span>
+<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#define SFML_SOUNDSTREAM_HPP</span>
+<a name="l00027"></a>00027 <span class="preprocessor"></span>
+<a name="l00029"></a>00029 <span class="comment">// Headers</span>
+<a name="l00031"></a>00031 <span class="comment"></span><span class="preprocessor">#include &lt;SFML/Audio/Sound.hpp&gt;</span>
+<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;SFML/System/Thread.hpp&gt;</span>
+<a name="l00033"></a>00033 <span class="preprocessor">#include &lt;cstdlib&gt;</span>
+<a name="l00034"></a>00034
+<a name="l00035"></a>00035
+<a name="l00036"></a>00036 <span class="keyword">namespace </span>sf
+<a name="l00037"></a>00037 {
+<a name="l00044"></a><a class="code" href="classsf_1_1SoundStream.htm">00044</a> <span class="keyword">class </span>SFML_API SoundStream : <span class="keyword">private</span> <a class="code" href="classsf_1_1Thread.htm" title="Thread defines an easy way to manipulate a thread.">Thread</a>, <span class="keyword">private</span> <a class="code" href="classsf_1_1Sound.htm" title="Sound defines the properties of a sound such as position, volume, pitch, etc.">Sound</a>
+<a name="l00045"></a>00045 {
+<a name="l00046"></a>00046 <span class="keyword">public</span> :
+<a name="l00047"></a>00047
+<a name="l00048"></a>00048 <span class="keyword">using</span> <a class="code" href="classsf_1_1Sound.htm#28ad2186cde78fed2c79c867b9622195" title="Enumeration of the sound states.">Sound::Status</a>;
+<a name="l00049"></a>00049 <span class="keyword">using</span> <a class="code" href="classsf_1_1Sound.htm#28ad2186cde78fed2c79c867b962219539fd53aa83db9189ca2fff82e0553cf9" title="Sound is not playing.">Sound::Stopped</a>;
+<a name="l00050"></a>00050 <span class="keyword">using</span> <a class="code" href="classsf_1_1Sound.htm#28ad2186cde78fed2c79c867b9622195c9fedbd48103548431e7851d16be5f4f" title="Sound is paused.">Sound::Paused</a>;
+<a name="l00051"></a>00051 <span class="keyword">using</span> <a class="code" href="classsf_1_1Sound.htm#28ad2186cde78fed2c79c867b962219516657b221888cf11e2a076f5b2783288" title="Sound is playing.">Sound::Playing</a>;
+<a name="l00052"></a>00052 <span class="keyword">using</span> <a class="code" href="classsf_1_1Sound.htm#6a712910ac1340f32e3ec3a04295ebd3" title="Pause the sound.">Sound::Pause</a>;
+<a name="l00053"></a>00053 <span class="keyword">using</span> <a class="code" href="classsf_1_1Sound.htm#f93301feb88770789ba7cd993c9dd3a0" title="Set the sound pitch.">Sound::SetPitch</a>;
+<a name="l00054"></a>00054 <span class="keyword">using</span> <a class="code" href="classsf_1_1Sound.htm#1536095045923a2332dd9eed6bf8e96a" title="Set the sound volume.">Sound::SetVolume</a>;
+<a name="l00055"></a>00055 <span class="keyword">using</span> <a class="code" href="classsf_1_1Sound.htm#b445e8738218525d8dd067628bc70c78" title="Set the sound position (take 3 values).">Sound::SetPosition</a>;
+<a name="l00056"></a>00056 <span class="keyword">using</span> <a class="code" href="classsf_1_1Sound.htm#0a545d8dca68d85a03390f6da7c446a9" title="Set the minimum distance - closer than this distance, the listener will hear the...">Sound::SetMinDistance</a>;
+<a name="l00057"></a>00057 <span class="keyword">using</span> <a class="code" href="classsf_1_1Sound.htm#c3743f1fb53bf9818fbab6e9220bd7b9" title="Set the attenuation factor - the higher the attenuation, the more the sound will...">Sound::SetAttenuation</a>;
+<a name="l00058"></a>00058 <span class="keyword">using</span> <a class="code" href="classsf_1_1Sound.htm#b591af704d910f620343685ce3916c80" title="Get the pitch.">Sound::GetPitch</a>;
+<a name="l00059"></a>00059 <span class="keyword">using</span> <a class="code" href="classsf_1_1Sound.htm#6990c8406bdb13d82d13d662a1b7423e" title="Get the volume.">Sound::GetVolume</a>;
+<a name="l00060"></a>00060 <span class="keyword">using</span> <a class="code" href="classsf_1_1Sound.htm#9462818ee2ff3318648c416dd6430823" title="Get the sound position.">Sound::GetPosition</a>;
+<a name="l00061"></a>00061 <span class="keyword">using</span> <a class="code" href="classsf_1_1Sound.htm#e4c1cc0b8ff482bf1b834ac4b7b1afd7" title="Get the minimum distance.">Sound::GetMinDistance</a>;
+<a name="l00062"></a>00062 <span class="keyword">using</span> <a class="code" href="classsf_1_1Sound.htm#7162ae32e4d530a4c5f93a1297c91440" title="Get the attenuation factor.">Sound::GetAttenuation</a>;
+<a name="l00063"></a>00063
+<a name="l00067"></a><a class="code" href="structsf_1_1SoundStream_1_1Chunk.htm">00067</a> <span class="keyword">struct </span><a class="code" href="structsf_1_1SoundStream_1_1Chunk.htm" title="Structure defining a chunk of audio data to stream.">Chunk</a>
+<a name="l00068"></a>00068 {
+<a name="l00069"></a><a class="code" href="structsf_1_1SoundStream_1_1Chunk.htm#c7a44423bcd7cf2c451f3bd1e00b6a9f">00069</a> <span class="keyword">const</span> Int16* Samples;
+<a name="l00070"></a><a class="code" href="structsf_1_1SoundStream_1_1Chunk.htm#a5eb3db49e38752d27f7d7246907c5af">00070</a> std::size_t NbSamples;
+<a name="l00071"></a>00071 };
+<a name="l00072"></a>00072
+<a name="l00077"></a>00077 <span class="keyword">virtual</span> ~SoundStream();
+<a name="l00078"></a>00078
+<a name="l00083"></a>00083 <span class="keywordtype">void</span> Play();
+<a name="l00084"></a>00084
+<a name="l00089"></a>00089 <span class="keywordtype">void</span> Stop();
+<a name="l00090"></a>00090
+<a name="l00097"></a>00097 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> GetChannelsCount() <span class="keyword">const</span>;
+<a name="l00098"></a>00098
+<a name="l00105"></a>00105 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> GetSampleRate() <span class="keyword">const</span>;
+<a name="l00106"></a>00106
+<a name="l00113"></a>00113 <a class="code" href="classsf_1_1Sound.htm#28ad2186cde78fed2c79c867b9622195" title="Enumeration of the sound states.">Status</a> GetStatus() <span class="keyword">const</span>;
+<a name="l00114"></a>00114
+<a name="l00121"></a>00121 <span class="keywordtype">float</span> GetPlayingOffset() <span class="keyword">const</span>;
+<a name="l00122"></a>00122
+<a name="l00130"></a>00130 <span class="keywordtype">void</span> SetLoop(<span class="keywordtype">bool</span> Loop);
+<a name="l00131"></a>00131
+<a name="l00138"></a>00138 <span class="keywordtype">bool</span> GetLoop() <span class="keyword">const</span>;
+<a name="l00139"></a>00139
+<a name="l00140"></a>00140 <span class="keyword">protected</span> :
+<a name="l00141"></a>00141
+<a name="l00146"></a>00146 SoundStream();
+<a name="l00147"></a>00147
+<a name="l00155"></a>00155 <span class="keywordtype">void</span> Initialize(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ChannelsCount, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> SampleRate);
+<a name="l00156"></a>00156
+<a name="l00157"></a>00157 <span class="keyword">private</span> :
+<a name="l00158"></a>00158
+<a name="l00163"></a>00163 <span class="keyword">virtual</span> <span class="keywordtype">void</span> Run();
+<a name="l00164"></a>00164
+<a name="l00171"></a>00171 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> OnStart();
+<a name="l00172"></a>00172
+<a name="l00181"></a>00181 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> OnGetData(<a class="code" href="structsf_1_1SoundStream_1_1Chunk.htm" title="Structure defining a chunk of audio data to stream.">Chunk</a>&amp; Data) = 0;
+<a name="l00182"></a>00182
+<a name="l00192"></a>00192 <span class="keywordtype">bool</span> FillAndPushBuffer(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> Buffer);
+<a name="l00193"></a>00193
+<a name="l00200"></a>00200 <span class="keywordtype">bool</span> FillQueue();
+<a name="l00201"></a>00201
+<a name="l00206"></a>00206 <span class="keywordtype">void</span> ClearQueue();
+<a name="l00207"></a>00207
+<a name="l00208"></a>00208 <span class="keyword">enum</span> {BuffersCount = 3};
+<a name="l00209"></a>00209
+<a name="l00211"></a>00211 <span class="comment">// Member data</span>
+<a name="l00213"></a>00213 <span class="comment"></span> <span class="keywordtype">bool</span> myIsStreaming;
+<a name="l00214"></a>00214 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> myBuffers[BuffersCount];
+<a name="l00215"></a>00215 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> myChannelsCount;
+<a name="l00216"></a>00216 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> mySampleRate;
+<a name="l00217"></a>00217 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> myFormat;
+<a name="l00218"></a>00218 <span class="keywordtype">bool</span> myLoop;
+<a name="l00219"></a>00219 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> mySamplesProcessed;
+<a name="l00220"></a>00220 };
+<a name="l00221"></a>00221
+<a name="l00222"></a>00222 } <span class="comment">// namespace sf</span>
+<a name="l00223"></a>00223
+<a name="l00224"></a>00224
+<a name="l00225"></a>00225 <span class="preprocessor">#endif // SFML_SOUNDSTREAM_HPP</span>
+</pre></div>
+ <p id="footer">
+ &nbsp;::&nbsp; Copyright &copy; 2007-2008 Laurent Gomila, all rights reserved &nbsp;::&nbsp;
+ Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.5.2</a> &nbsp;::&nbsp;
+ </p>
+
+ </body>
+</html>