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<title>SetState</title> 8 </head> 9 <body> 10<h1><CODE>nn::snd::CTR::Voice::SetState</CODE> Member Function</h1> 11<h2>Syntax</h2> 12 <div class="section"> 13 <pre class="definition"> 14void SetState( 15 <a href="../../../../nn/snd/CTR/Voice/State.html">State</a> state 16); 17</pre> 18 </div> 19<h2>Arguments</h2> 20 <div class="section"> 21 <table class="arguments"> 22 <thead> 23 <tr> 24 <td width="15" /> 25<th>Name</th> 26<td>Description</td> 27 </tr> 28 </thead> 29 <tr> 30<td>in</td> 31<th>state</th> 32<td>State</td> 33 </tr> </table> 34 </div> 35<h2>Return Values</h2> 36 <div class="section"> 37None. 38 </div> 39<h2>Description</h2> 40 <div class="section"> 41<p>Sets the current state of a voice.</p><p> 42If you specify a value of <CODE>STATE_PLAY</CODE>, the voice transitions to the "playback instruction received" state (note that this is a playback <I>instruction</I>; the voice is not necessarily played back). If a buffer has been registered through <CODE>nn::snd::CTR::Voice::AppendWaveBuffer</CODE>, playback starts immediately. If a sound source buffer has not been registered, nothing happens until one is. Playback starts immediately once a buffer is registered. Once you finish playing all of the sound source buffers, the "playback instruction received" state is maintained but nothing happens. 43 </p><p> 44Voices are played back in descending priority order, so some voices may not be played back depending on the priorities and the processor load. 45 </p><p> 46If you specify a value of <CODE>STATE_STOP</CODE>, playback stops. All registered buffers are changed to the "playback complete" state. 47 </p><p> 48If you specify a value of <CODE>STATE_PAUSE</CODE>, playback is paused. The buffer state is maintained. To resume playback, call <CODE>nn::snd::CTR::Voice::SetState</CODE> with <CODE>STATE_PLAY</CODE> as an argument. Playback resumes where it was paused. 49 </p><p> 50The <SPAN class="argument">state</SPAN> for the <CODE>Voice</CODE> class only changes when it is set by the user. For example, even if playback has ended for a <CODE>WaveBuffer</CODE> added by the <CODE>nn::snd::CTR::Voice::AppendWaveBuffer</CODE> function, <SPAN class="argument">state</SPAN> remains at <CODE>STATE_PLAY</CODE>; you can restart playback by appending another <CODE>WaveBuffer</CODE>. Use the <CODE>nn::snd::CTR::Voice::IsPlaying</CODE> function to determine whether a <CODE>Voice</CODE> is actually being played back. 51 </p></div> 52<h2>Revision History</h2> 53 <div class="section"> 54 <dl class="history"> 55 <dt>2010/08/24</dt> 56<dd>Added an explanation of state transitions. 57 </dd> 58 <dt>2010/02/02</dt> 59<dd>Initial version.<br /> 60 </dd> 61 </dl> 62 </div> 63 <hr><p>CONFIDENTIAL</p></body> 64</html>