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      span.virtual_style
22      {
23        font-size			 : 8pt;
24        color				 : white;
25        font-weight			: bold;
26        background			: #0a0;
27        border-left			: solid 1px #0f0;
28        border-top			: solid 1px #0f0;
29        border-right		: solid 1px #060;
30        border-bottom		: solid 1px #060;
31        padding-left		: 2px;
32        padding-right		: 2px;
33      }
34      span.protected_style
35      {
36        font-size			 : 8pt;
37        color				 : white;
38        font-weight			: bold;
39        background			: #444;
40        border-left			: solid 1px #ccc;
41        border-top			: solid 1px #ccc;
42        border-right		: solid 1px #222;
43        border-bottom		: solid 1px #222;
44        padding-left		: 2px;
45        padding-right		: 2px;
46      }
47        --></style>
48<title>nn::snd::CTR::WaveBuffer</title>
49  </head>
50  <body>
51<h1><CODE>nn::snd::CTR::WaveBuffer</CODE> Structure</h1>
52<h2>Syntax</h2>
53    <div class="section">
54      <pre class="definition">struct WaveBuffer
55{
56   const void * bufferAddress;
57   s32 sampleLength;
58   const <a href="../../../../nn/snd/CTR/AdpcmContext/Overview.html">AdpcmContext</a> * pAdpcmContext;
59   uptr userParam;
60   bool loopFlag;
61   <a href="../../../../nn/snd/CTR/WaveBuffer/Status.html">Status</a> status;
62   u16 bufferId;
63   struct <a href="../../../../nn/snd/CTR/WaveBuffer/Overview.html">WaveBuffer</a> * next;
64};
65</pre>
66    </div>
67<h2>Description</h2>
68    <div class="section">
69<p>Structure that stores information about a buffer storing sample data.</p><p>
70Before 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.
71          </p><p>
72There are some restrictions on buffer addresses that are registered. See the <CODE>nn::snd::CTR::Voice::AppendWaveBuffer</CODE> function reference for details.
73          </p><p>
74The <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).
75          </p><p>
76Use <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.
77          </p></div>
78    <a name="enum" id="enum">
79<h2>Enumerated Types</h2>
80      <div class="section">
81        <table class="members">
82          <tr>
83            <td width="100"> </td>
84            <th>
85<a href="../../../../nn/snd/CTR/WaveBuffer/Status.html"><CODE>Status</CODE></a>
86            </th>
87<td>An enumerated type that indicates the buffer state.</td>
88          </tr> </table>
89      </div>
90    </a> <a name="variable" id="variable">
91<h2>Member Variables</h2>
92      <div class="section">
93        <table class="members">
94          <tr>
95            <td width="100"> </td>
96            <th>
97<span class="argument">bufferAddress</span>
98            </th>
99<td>Address of the storage location of the sample data. Required. Do not change this after registering to a voice.</td>
100          </tr>
101          <tr>
102            <td width="100"> </td>
103            <th>
104<span class="argument">sampleLength</span>
105            </th>
106<td>Length of samples within the buffer. Required. Do not change this after registering to a voice.</td>
107          </tr>
108          <tr>
109            <td width="100"> </td>
110            <th>
111<span class="argument">pAdpcmContext</span>
112            </th>
113<td>ADPCM context address. After registering to a voice, do not change this until after buffer playback has finished.</td>
114          </tr>
115          <tr>
116            <td width="100"> </td>
117            <th>
118<span class="argument">userParam</span>
119            </th>
120<td>User parameter. Optional.</td>
121          </tr>
122          <tr>
123            <td width="100"> </td>
124            <th>
125<span class="argument">loopFlag</span>
126            </th>
127<td>Loop flag. Optional.</td>
128          </tr>
129          <tr>
130            <td width="100"> </td>
131            <th>
132<span class="argument">status</span>
133            </th>
134<td>Buffer status. Used by the library. Do not change.</td>
135          </tr>
136          <tr>
137            <td width="100"> </td>
138            <th>
139<span class="argument">bufferId</span>
140            </th>
141<td>ID used for managing the buffer. Used by the library. Do not change.</td>
142          </tr>
143          <tr>
144            <td width="100"> </td>
145            <th>
146<span class="argument">next</span>
147            </th>
148<td>Address of the next buffer structure. Used by the library. Do not change.</td>
149          </tr> </table>
150      </div>
151    </a> <a name="function" id="function">
152<h2>Member Functions</h2>
153      <div class="section">
154        <table class="members">
155          <tr>
156            <td width="100">  </td>
157            <th>
158<a href="../../../../nn/snd/CTR/WaveBuffer/WaveBuffer.html"><CODE>WaveBuffer</CODE></a>
159            </th>
160<td>Constructor.</td>
161          </tr> </table>
162      </div>
163    </a>
164<h2>Revision History</h2>
165    <div class="section">
166      <dl class="history">
167        <dt>2010/07/22</dt>
168<dd>Added a description of adpcm stream playback.<br />
169        </dd>
170        <dt>2010/01/29</dt>
171<dd>Initial version.<br />
172        </dd>
173      </dl>
174    </div>
175  <hr><p>CONFIDENTIAL</p></body>
176</html>
177