1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 <link rel="stylesheet" href="../../../../css/manpage.css" type="text/css" /> 7 <style type="text/css"><!-- 8 span.static_style 9 { 10 font-size : 8pt; 11 color : white; 12 font-weight : bold; 13 background : #44f; 14 border-left : solid 1px #aaf; 15 border-top : solid 1px #aaf; 16 border-right : solid 1px #00c; 17 border-bottom : solid 1px #00c; 18 padding-left : 2px; 19 padding-right : 2px; 20 } 21 22 span.virtual_style 23 { 24 font-size : 8pt; 25 color : white; 26 font-weight : bold; 27 background : #0a0; 28 border-left : solid 1px #0f0; 29 border-top : solid 1px #0f0; 30 border-right : solid 1px #060; 31 border-bottom : solid 1px #060; 32 padding-left : 2px; 33 padding-right : 2px; 34 } 35 36 span.protected_style 37 { 38 font-size : 8pt; 39 color : white; 40 font-weight : bold; 41 background : #444; 42 border-left : solid 1px #ccc; 43 border-top : solid 1px #ccc; 44 border-right : solid 1px #222; 45 border-bottom : solid 1px #222; 46 padding-left : 2px; 47 padding-right : 2px; 48 } 49 --></style> 50<title>nn::snd::CTR::WaveBuffer</title> 51 </head> 52 <body> 53<h1><CODE>nn::snd::CTR::WaveBuffer</CODE> Structure</h1> 54<h2>Syntax</h2> 55 <div class="section"> 56 <pre class="definition">struct WaveBuffer 57{ 58 const void * bufferAddress; 59 s32 sampleLength; 60 const <a href="../../../../nn/snd/CTR/AdpcmContext/Overview.html">AdpcmContext</a> * pAdpcmContext; 61 uptr userParam; 62 bool loopFlag; 63 <a href="../../../../nn/snd/CTR/WaveBuffer/Status.html">Status</a> status; 64 u16 bufferId; 65 struct <a href="../../../../nn/snd/CTR/WaveBuffer/Overview.html">WaveBuffer</a> * next; 66}; 67</pre> 68 </div> 69<h2>Description</h2> 70 <div class="section"> 71<p>Structure that stores information about a buffer storing sample data.</p><p> 72Before using a <CODE>WaveBuffer</CODE> structure, always initialize it by calling the <CODE>nn::snd::CTR::InitializeWaveBuffer</CODE> function. After initialization, set the sample address and size, and if necessary set a pointer to the ADPCM context. Then call the <CODE>nn::snd::CTR::Voice::AppendWaveBuffer</CODE> function to register the buffer information to a voice. 73 </p><p> 74There are some restrictions on buffer addresses that are registered. See the <CODE>nn::snd::CTR::Voice::AppendWaveBuffer</CODE> function reference for details. 75 </p><p> 76The <SPAN class="argument">pAdpcmContext</SPAN> member is only used for adpcm playback. <SPAN class="argument">pAdpcmContext</SPAN> must be specified for the first <CODE>WaveBuffer</CODE> appended to the voice used for adpcm playback. When <SPAN class="argument">pAdpcmContext</SPAN> is <CODE>NULL</CODE> for any <CODE>WaveBuffer</CODE> appended later, the context is not updated when buffer jumps occur (stream playback). 77 </p><p> 78Use <SPAN class="argument">status</SPAN> to check the status of a buffer after it has been registered. See the <CODE>nn::snd::CTR::WaveBuffer::Status</CODE> enumerated type for how <SPAN class="argument">status</SPAN> values correspond to the buffer status. 79 </p></div> 80 <a name="enum" id="enum"> 81<h2>Enumerated Types</h2> 82 <div class="section"> 83 <table class="members"> 84 <tr> 85 <td width="100"> </td> 86 <th> 87<a href="../../../../nn/snd/CTR/WaveBuffer/Status.html"><CODE>Status</CODE></a> 88 </th> 89<td>An enumerated type that indicates the buffer state.</td> 90 </tr> </table> 91 </div> 92 </a> <a name="variable" id="variable"> 93<h2>Member Variables</h2> 94 <div class="section"> 95 <table class="members"> 96 <tr> 97 <td width="100"> </td> 98 <th> 99<span class="argument">bufferAddress</span> 100 </th> 101<td>Address of the storage location of the sample data. Required. Do not change this after registering to a voice.</td> 102 </tr> 103 <tr> 104 <td width="100"> </td> 105 <th> 106<span class="argument">sampleLength</span> 107 </th> 108<td>Length of samples within the buffer. Required. Do not change this after registering to a voice.</td> 109 </tr> 110 <tr> 111 <td width="100"> </td> 112 <th> 113<span class="argument">pAdpcmContext</span> 114 </th> 115<td>ADPCM context address. After registering to a voice, do not change this until after buffer playback has finished.</td> 116 </tr> 117 <tr> 118 <td width="100"> </td> 119 <th> 120<span class="argument">userParam</span> 121 </th> 122<td>User parameter. Optional.</td> 123 </tr> 124 <tr> 125 <td width="100"> </td> 126 <th> 127<span class="argument">loopFlag</span> 128 </th> 129<td>Loop flag. Optional.</td> 130 </tr> 131 <tr> 132 <td width="100"> </td> 133 <th> 134<span class="argument">status</span> 135 </th> 136<td>Buffer status. Used by the library. Do not change.</td> 137 </tr> 138 <tr> 139 <td width="100"> </td> 140 <th> 141<span class="argument">bufferId</span> 142 </th> 143<td>ID used for managing the buffer. Used by the library. Do not change.</td> 144 </tr> 145 <tr> 146 <td width="100"> </td> 147 <th> 148<span class="argument">next</span> 149 </th> 150<td>Address of the next buffer structure. Used by the library. Do not change.</td> 151 </tr> </table> 152 </div> 153 </a> <a name="function" id="function"> 154<h2>Member Functions</h2> 155 <div class="section"> 156 <table class="members"> 157 <tr> 158 <td width="100"> </td> 159 <th> 160<a href="../../../../nn/snd/CTR/WaveBuffer/WaveBuffer.html"><CODE>WaveBuffer</CODE></a> 161 </th> 162<td>Constructor.</td> 163 </tr> </table> 164 </div> 165 </a> 166<h2>Revision History</h2> 167 <div class="section"> 168 <dl class="history"> 169 <dt>2010/07/22</dt> 170<dd>Added a description of adpcm stream playback.<br /> 171 </dd> 172 <dt>2010/01/29</dt> 173<dd>Initial version.<br /> 174 </dd> 175 </dl> 176 </div> 177 <hr><p>CONFIDENTIAL</p></body> 178</html>