Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 6547eb8411a104bc398ae983b959fd62 > files > 10

libSDL_sound-devel-1.0.3-5mdv2010.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>SDL_sound: SDL_sound.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.9 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<h1>SDL_sound.h</h1><a href="SDL__sound_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00003"></a>00003 <span class="comment">/*</span>
<a name="l00004"></a>00004 <span class="comment"> * SDL_sound -- An abstract sound format decoding API.</span>
<a name="l00005"></a>00005 <span class="comment"> * Copyright (C) 2001  Ryan C. Gordon.</span>
<a name="l00006"></a>00006 <span class="comment"> *</span>
<a name="l00007"></a>00007 <span class="comment"> * This library is free software; you can redistribute it and/or</span>
<a name="l00008"></a>00008 <span class="comment"> * modify it under the terms of the GNU Lesser General Public</span>
<a name="l00009"></a>00009 <span class="comment"> * License as published by the Free Software Foundation; either</span>
<a name="l00010"></a>00010 <span class="comment"> * version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00011"></a>00011 <span class="comment"> *</span>
<a name="l00012"></a>00012 <span class="comment"> * This library is distributed in the hope that it will be useful,</span>
<a name="l00013"></a>00013 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00014"></a>00014 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</span>
<a name="l00015"></a>00015 <span class="comment"> * Lesser General Public License for more details.</span>
<a name="l00016"></a>00016 <span class="comment"> *</span>
<a name="l00017"></a>00017 <span class="comment"> * You should have received a copy of the GNU Lesser General Public</span>
<a name="l00018"></a>00018 <span class="comment"> * License along with this library; if not, write to the Free Software</span>
<a name="l00019"></a>00019 <span class="comment"> * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA</span>
<a name="l00020"></a>00020 <span class="comment"> */</span>
<a name="l00021"></a>00021 
<a name="l00064"></a>00064 <span class="preprocessor">#ifndef _INCLUDE_SDL_SOUND_H_</span>
<a name="l00065"></a>00065 <span class="preprocessor"></span><span class="preprocessor">#define _INCLUDE_SDL_SOUND_H_</span>
<a name="l00066"></a>00066 <span class="preprocessor"></span>
<a name="l00067"></a>00067 <span class="preprocessor">#include "SDL.h"</span>
<a name="l00068"></a>00068 <span class="preprocessor">#include "SDL_endian.h"</span>
<a name="l00069"></a>00069 
<a name="l00070"></a>00070 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00071"></a>00071 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
<a name="l00072"></a>00072 <span class="preprocessor">#endif</span>
<a name="l00073"></a>00073 <span class="preprocessor"></span>
<a name="l00074"></a>00074 <span class="preprocessor">#ifndef DOXYGEN_SHOULD_IGNORE_THIS</span>
<a name="l00075"></a>00075 <span class="preprocessor"></span>
<a name="l00076"></a>00076 <span class="preprocessor">#ifndef SDLCALL  </span><span class="comment">/* may not be defined with older SDL releases. */</span>
<a name="l00077"></a>00077 <span class="preprocessor">#define SDLCALL</span>
<a name="l00078"></a>00078 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00079"></a>00079 <span class="preprocessor"></span>
<a name="l00080"></a>00080 <span class="preprocessor">#ifdef SDL_SOUND_DLL_EXPORTS</span>
<a name="l00081"></a>00081 <span class="preprocessor"></span><span class="preprocessor">#  define SNDDECLSPEC __declspec(dllexport)</span>
<a name="l00082"></a>00082 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00083"></a>00083 <span class="preprocessor"></span><span class="preprocessor">#  define SNDDECLSPEC</span>
<a name="l00084"></a>00084 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00085"></a>00085 <span class="preprocessor"></span>
<a name="l00086"></a>00086 <span class="preprocessor">#define SOUND_VER_MAJOR 1</span>
<a name="l00087"></a>00087 <span class="preprocessor"></span><span class="preprocessor">#define SOUND_VER_MINOR 0</span>
<a name="l00088"></a>00088 <span class="preprocessor"></span><span class="preprocessor">#define SOUND_VER_PATCH 3</span>
<a name="l00089"></a>00089 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00090"></a>00090 <span class="preprocessor"></span>
<a name="l00091"></a>00091 
<a name="l00107"></a><a class="code" href="SDL__sound_8h.html#bf2c8cef39e83f01531f0bf255bdc625">00107</a> <span class="keyword">typedef</span> <span class="keyword">enum</span>
<a name="l00108"></a>00108 {
<a name="l00109"></a><a class="code" href="SDL__sound_8h.html#bf2c8cef39e83f01531f0bf255bdc625192a6518e94eabf9cd5c45babc9635ee">00109</a>     <a class="code" href="SDL__sound_8h.html#bf2c8cef39e83f01531f0bf255bdc625192a6518e94eabf9cd5c45babc9635ee">SOUND_SAMPLEFLAG_NONE</a>    = 0,       
<a name="l00111"></a>00111         <span class="comment">/* these are set at sample creation time... */</span>
<a name="l00112"></a><a class="code" href="SDL__sound_8h.html#bf2c8cef39e83f01531f0bf255bdc625334d72e6e376dae44baa66746398bbaa">00112</a>     <a class="code" href="SDL__sound_8h.html#bf2c8cef39e83f01531f0bf255bdc625334d72e6e376dae44baa66746398bbaa">SOUND_SAMPLEFLAG_CANSEEK</a> = 1,       
<a name="l00114"></a>00114         <span class="comment">/* these are set during decoding... */</span>
<a name="l00115"></a><a class="code" href="SDL__sound_8h.html#bf2c8cef39e83f01531f0bf255bdc625e0b562eebb0bf6cdf3da87eb1b4914be">00115</a>     <a class="code" href="SDL__sound_8h.html#bf2c8cef39e83f01531f0bf255bdc625e0b562eebb0bf6cdf3da87eb1b4914be">SOUND_SAMPLEFLAG_EOF</a>     = 1 &lt;&lt; 29, 
<a name="l00116"></a><a class="code" href="SDL__sound_8h.html#bf2c8cef39e83f01531f0bf255bdc6255d6c02e3276932f2217ee09a51eed65f">00116</a>     <a class="code" href="SDL__sound_8h.html#bf2c8cef39e83f01531f0bf255bdc6255d6c02e3276932f2217ee09a51eed65f">SOUND_SAMPLEFLAG_ERROR</a>   = 1 &lt;&lt; 30, 
<a name="l00117"></a><a class="code" href="SDL__sound_8h.html#bf2c8cef39e83f01531f0bf255bdc625b269a22d877556f5569dc737ad984e1a">00117</a>     <a class="code" href="SDL__sound_8h.html#bf2c8cef39e83f01531f0bf255bdc625b269a22d877556f5569dc737ad984e1a">SOUND_SAMPLEFLAG_EAGAIN</a>  = 1 &lt;&lt; 31  
<a name="l00118"></a>00118 } <a class="code" href="SDL__sound_8h.html#bf2c8cef39e83f01531f0bf255bdc625" title="Flags that are used in a Sound_Sample to show various states.">Sound_SampleFlags</a>;
<a name="l00119"></a>00119 
<a name="l00120"></a>00120 
<a name="l00133"></a><a class="code" href="structSound__AudioInfo.html">00133</a> <span class="keyword">typedef</span> <span class="keyword">struct</span>
<a name="l00134"></a>00134 {
<a name="l00135"></a><a class="code" href="structSound__AudioInfo.html#fc1f02fd774a0e1d35109360496390eb">00135</a>     Uint16 format;  
<a name="l00136"></a><a class="code" href="structSound__AudioInfo.html#2a7fe880d009e698eb0d52cde3ddfc80">00136</a>     Uint8 channels; 
<a name="l00137"></a><a class="code" href="structSound__AudioInfo.html#bc8310e37ae527e5d92e675655d944ee">00137</a>     Uint32 rate;    
<a name="l00138"></a>00138 } <a class="code" href="structSound__AudioInfo.html" title="Information about an existing sample&amp;#39;s format.">Sound_AudioInfo</a>;
<a name="l00139"></a>00139 
<a name="l00140"></a>00140 
<a name="l00160"></a><a class="code" href="structSound__DecoderInfo.html">00160</a> <span class="keyword">typedef</span> <span class="keyword">struct</span>
<a name="l00161"></a>00161 {
<a name="l00162"></a><a class="code" href="structSound__DecoderInfo.html#9f11db9acb555302fd84509198683e2a">00162</a>     <span class="keyword">const</span> <span class="keywordtype">char</span> **extensions; 
<a name="l00163"></a><a class="code" href="structSound__DecoderInfo.html#c1241b30e4121aedd4286351b27f93d5">00163</a>     <span class="keyword">const</span> <span class="keywordtype">char</span> *description; 
<a name="l00164"></a><a class="code" href="structSound__DecoderInfo.html#1d3c5d5d46b0f5e5026944002e1d6e36">00164</a>     <span class="keyword">const</span> <span class="keywordtype">char</span> *author;      
<a name="l00165"></a><a class="code" href="structSound__DecoderInfo.html#a983be8195cd74f7dcaab2f4788309fb">00165</a>     <span class="keyword">const</span> <span class="keywordtype">char</span> *url;         
<a name="l00166"></a>00166 } <a class="code" href="structSound__DecoderInfo.html" title="Information about available soudn decoders.">Sound_DecoderInfo</a>;
<a name="l00167"></a>00167 
<a name="l00168"></a>00168 
<a name="l00169"></a>00169 
<a name="l00179"></a><a class="code" href="structSound__Sample.html">00179</a> <span class="keyword">typedef</span> <span class="keyword">struct</span>
<a name="l00180"></a>00180 {
<a name="l00181"></a><a class="code" href="structSound__Sample.html#f9b14d108498631919187832d74efa11">00181</a>     <span class="keywordtype">void</span> *opaque;  
<a name="l00182"></a><a class="code" href="structSound__Sample.html#03ef7710992520e65edacc9ad694b034">00182</a>     <span class="keyword">const</span> <a class="code" href="structSound__DecoderInfo.html" title="Information about available soudn decoders.">Sound_DecoderInfo</a> *decoder;  
<a name="l00183"></a><a class="code" href="structSound__Sample.html#ca3059080501599b2fef90032122108d">00183</a>     <a class="code" href="structSound__AudioInfo.html" title="Information about an existing sample&amp;#39;s format.">Sound_AudioInfo</a> desired;  
<a name="l00184"></a><a class="code" href="structSound__Sample.html#4862ebaacdb0d4ec3aa3f7874ef2b903">00184</a>     <a class="code" href="structSound__AudioInfo.html" title="Information about an existing sample&amp;#39;s format.">Sound_AudioInfo</a> actual;  
<a name="l00185"></a><a class="code" href="structSound__Sample.html#160959b8f33b039d54e6a64452d3d9e7">00185</a>     <span class="keywordtype">void</span> *buffer;  
<a name="l00186"></a><a class="code" href="structSound__Sample.html#7bd0273a97a4044e8dbf2bbba36ca176">00186</a>     Uint32 buffer_size;  
<a name="l00187"></a><a class="code" href="structSound__Sample.html#0aa7f52ce553407fdff6947b50626b2b">00187</a>     <a class="code" href="SDL__sound_8h.html#bf2c8cef39e83f01531f0bf255bdc625" title="Flags that are used in a Sound_Sample to show various states.">Sound_SampleFlags</a> flags;  
<a name="l00188"></a>00188 } <a class="code" href="structSound__Sample.html" title="Represents sound data in the process of being decoded.">Sound_Sample</a>;
<a name="l00189"></a>00189 
<a name="l00190"></a>00190 
<a name="l00204"></a><a class="code" href="structSound__Version.html">00204</a> <span class="keyword">typedef</span> <span class="keyword">struct</span>
<a name="l00205"></a>00205 {
<a name="l00206"></a><a class="code" href="structSound__Version.html#68ed43edb6114f117edd45084baae1b4">00206</a>     <span class="keywordtype">int</span> major; 
<a name="l00207"></a><a class="code" href="structSound__Version.html#095420931df560c545e0cf0d6fecf56a">00207</a>     <span class="keywordtype">int</span> minor; 
<a name="l00208"></a><a class="code" href="structSound__Version.html#7ebc29f83c1a812ee24b556ad6dfc1f4">00208</a>     <span class="keywordtype">int</span> patch; 
<a name="l00209"></a>00209 } <a class="code" href="structSound__Version.html" title="Information the version of SDL_sound in use.">Sound_Version</a>;
<a name="l00210"></a>00210 
<a name="l00211"></a>00211 
<a name="l00212"></a>00212 <span class="comment">/* functions and macros... */</span>
<a name="l00213"></a>00213 
<a name="l00230"></a><a class="code" href="SDL__sound_8h.html#059b1c022acec0abbdab4a981b6e8e7d">00230</a> <span class="preprocessor">#define SOUND_VERSION(x) \</span>
<a name="l00231"></a>00231 <span class="preprocessor">{ \</span>
<a name="l00232"></a>00232 <span class="preprocessor">    (x)-&gt;major = SOUND_VER_MAJOR; \</span>
<a name="l00233"></a>00233 <span class="preprocessor">    (x)-&gt;minor = SOUND_VER_MINOR; \</span>
<a name="l00234"></a>00234 <span class="preprocessor">    (x)-&gt;patch = SOUND_VER_PATCH; \</span>
<a name="l00235"></a>00235 <span class="preprocessor">}</span>
<a name="l00236"></a>00236 <span class="preprocessor"></span>
<a name="l00237"></a>00237 
<a name="l00267"></a>00267 SNDDECLSPEC <span class="keywordtype">void</span> SDLCALL <a class="code" href="SDL__sound_8h.html#bda6027ae5b226e626a9e1ea1f6e626c" title="Get the version of SDL_sound that is linked against your program.">Sound_GetLinkedVersion</a>(<a class="code" href="structSound__Version.html" title="Information the version of SDL_sound in use.">Sound_Version</a> *ver);
<a name="l00268"></a>00268 
<a name="l00269"></a>00269 
<a name="l00285"></a>00285 SNDDECLSPEC <span class="keywordtype">int</span> SDLCALL <a class="code" href="SDL__sound_8h.html#44e4cafdb81fc9f9135796bcfd3fb44f" title="Initialize SDL_sound.">Sound_Init</a>(<span class="keywordtype">void</span>);
<a name="l00286"></a>00286 
<a name="l00287"></a>00287 
<a name="l00310"></a>00310 SNDDECLSPEC <span class="keywordtype">int</span> SDLCALL <a class="code" href="SDL__sound_8h.html#94408f49764dc122b0fad0397dccc941" title="Shutdown SDL_sound.">Sound_Quit</a>(<span class="keywordtype">void</span>);
<a name="l00311"></a>00311 
<a name="l00312"></a>00312 
<a name="l00345"></a>00345 SNDDECLSPEC <span class="keyword">const</span> <a class="code" href="structSound__DecoderInfo.html" title="Information about available soudn decoders.">Sound_DecoderInfo</a> ** SDLCALL <a class="code" href="SDL__sound_8h.html#bbae3fccdec9fad347aa71a29bd4f074" title="Get a list of sound formats supported by this version of SDL_sound.">Sound_AvailableDecoders</a>(<span class="keywordtype">void</span>);
<a name="l00346"></a>00346 
<a name="l00347"></a>00347 
<a name="l00363"></a>00363 SNDDECLSPEC <span class="keyword">const</span> <span class="keywordtype">char</span> * SDLCALL <a class="code" href="SDL__sound_8h.html#db99dd3e7266c234e437bebf3be9e061" title="Get the last SDL_sound error message as a null-terminated string.">Sound_GetError</a>(<span class="keywordtype">void</span>);
<a name="l00364"></a>00364 
<a name="l00365"></a>00365 
<a name="l00374"></a>00374 SNDDECLSPEC <span class="keywordtype">void</span> SDLCALL <a class="code" href="SDL__sound_8h.html#7c0a82fc646c5b819b8d0e81bea029fb" title="Clear the current error message.">Sound_ClearError</a>(<span class="keywordtype">void</span>);
<a name="l00375"></a>00375 
<a name="l00376"></a>00376 
<a name="l00449"></a>00449 SNDDECLSPEC <a class="code" href="structSound__Sample.html" title="Represents sound data in the process of being decoded.">Sound_Sample</a> * SDLCALL <a class="code" href="SDL__sound_8h.html#10b9c44cc1cc2ff8a93977b43870cb53" title="Start decoding a new sound sample.">Sound_NewSample</a>(SDL_RWops *rw,
<a name="l00450"></a>00450                                                    <span class="keyword">const</span> <span class="keywordtype">char</span> *ext,
<a name="l00451"></a>00451                                                    <a class="code" href="structSound__AudioInfo.html" title="Information about an existing sample&amp;#39;s format.">Sound_AudioInfo</a> *desired,
<a name="l00452"></a>00452                                                    Uint32 bufferSize);
<a name="l00453"></a>00453 
<a name="l00481"></a>00481 SNDDECLSPEC <a class="code" href="structSound__Sample.html" title="Represents sound data in the process of being decoded.">Sound_Sample</a> * SDLCALL <a class="code" href="SDL__sound_8h.html#0869896a4bb39ee002257aa1cb3c39ec" title="Start decoding a new sound sample from a file on disk.">Sound_NewSampleFromFile</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *fname,
<a name="l00482"></a>00482                                                       <a class="code" href="structSound__AudioInfo.html" title="Information about an existing sample&amp;#39;s format.">Sound_AudioInfo</a> *desired,
<a name="l00483"></a>00483                                                       Uint32 bufferSize);
<a name="l00484"></a>00484 
<a name="l00499"></a>00499 SNDDECLSPEC <span class="keywordtype">void</span> SDLCALL <a class="code" href="SDL__sound_8h.html#7f16cbb883e57b772bae0507ac4d5488" title="Dispose of a Sound_Sample.">Sound_FreeSample</a>(<a class="code" href="structSound__Sample.html" title="Represents sound data in the process of being decoded.">Sound_Sample</a> *sample);
<a name="l00500"></a>00500 
<a name="l00501"></a>00501 
<a name="l00527"></a>00527 SNDDECLSPEC <span class="keywordtype">int</span> SDLCALL <a class="code" href="SDL__sound_8h.html#c09076aa2bdc14d08130e25a6915279d" title="Change the current buffer size for a sample.">Sound_SetBufferSize</a>(<a class="code" href="structSound__Sample.html" title="Represents sound data in the process of being decoded.">Sound_Sample</a> *sample,
<a name="l00528"></a>00528                                             Uint32 new_size);
<a name="l00529"></a>00529 
<a name="l00530"></a>00530 
<a name="l00550"></a>00550 SNDDECLSPEC Uint32 SDLCALL <a class="code" href="SDL__sound_8h.html#6dbdf33dc4bc6b832fec2f4ffe5d546e" title="Decode more of the sound data in a Sound_Sample.">Sound_Decode</a>(<a class="code" href="structSound__Sample.html" title="Represents sound data in the process of being decoded.">Sound_Sample</a> *sample);
<a name="l00551"></a>00551 
<a name="l00552"></a>00552 
<a name="l00586"></a>00586 SNDDECLSPEC Uint32 SDLCALL <a class="code" href="SDL__sound_8h.html#07f8d77bb5449be3707625f58de1aba7" title="Decode the remainder of the sound data in a Sound_Sample.">Sound_DecodeAll</a>(<a class="code" href="structSound__Sample.html" title="Represents sound data in the process of being decoded.">Sound_Sample</a> *sample);
<a name="l00587"></a>00587 
<a name="l00588"></a>00588 
<a name="l00620"></a>00620 SNDDECLSPEC <span class="keywordtype">int</span> SDLCALL <a class="code" href="SDL__sound_8h.html#720f92a75c0340c879c945ec3e9fdf70" title="Rewind a sample to the start.">Sound_Rewind</a>(<a class="code" href="structSound__Sample.html" title="Represents sound data in the process of being decoded.">Sound_Sample</a> *sample);
<a name="l00621"></a>00621 
<a name="l00622"></a>00622 
<a name="l00665"></a>00665 SNDDECLSPEC <span class="keywordtype">int</span> SDLCALL <a class="code" href="SDL__sound_8h.html#d8b48e7fdb78c95e7ff88cea097af18b" title="Seek to a different point in a sample.">Sound_Seek</a>(<a class="code" href="structSound__Sample.html" title="Represents sound data in the process of being decoded.">Sound_Sample</a> *sample, Uint32 ms);
<a name="l00666"></a>00666 
<a name="l00667"></a>00667 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00668"></a>00668 <span class="preprocessor"></span>}
<a name="l00669"></a>00669 <span class="preprocessor">#endif</span>
<a name="l00670"></a>00670 <span class="preprocessor"></span>
<a name="l00671"></a>00671 <span class="preprocessor">#endif  </span><span class="comment">/* !defined _INCLUDE_SDL_SOUND_H_ */</span>
<a name="l00672"></a>00672 
<a name="l00673"></a>00673 <span class="comment">/* end of SDL_sound.h ... */</span>
<a name="l00674"></a>00674 
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Thu Oct 1 23:26:48 2009 for SDL_sound by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
</body>
</html>