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>nw::snd::SoundHandle</title> 51 </head> 52 <body> 53 <h1>nw::snd::SoundHandle Class</h1> 54 <div class="section"> 55 <b>Header file: </b>nw/snd/snd_SoundHandle.h</div> 56 <h2>Syntax</h2> 57 <div class="section"> 58 <pre class="definition">class SoundHandle</pre> 59 </div> 60 <h2>Description</h2> 61 <div class="section"> 62 <p>A handle class used to control sounds that are played back.</p><p>To associate a sound handle with a sound, call <a href="../../../nw/snd/SoundStartable/PrepareSound.html"><CODE>SoundArchivePlayer::PrepareSound</CODE></a> or <a href="../../../nw/snd/SoundStartable/StartSound.html"><CODE>SoundArchivePlayer::StartSound</CODE></a>.</p><p>If the handle is already associated with another sound, this association is removed, and it is newly associated with the sound to be played back.</p><p>The association between the handle and the sound is removed, and that handle can no longer control that sound in the following situations:</p><p>- Playback stops at the end of the sound. <br />- <a href="../../../nw/snd/SoundHandle/Stop.html"><CODE>Stop</CODE></a> is called at fade frame 0. <br />- <a href="../../../nw/snd/SoundHandle/Stop.html"><CODE>Stop</CODE></a> is called when one or more fade frames have been specified and playback stops after only that number of frames has elapsed. <br />- <a href="../../../nw/snd/SoundHandle/DetachSound.html"><CODE>SoundHandle::DetachSound</CODE></a> is called explicitly.</p><p>As a result, you can check whether a sound has stopped after being played through to the end by monitoring <a href="../../../nw/snd/SoundHandle/IsAttachedSound.html"><CODE>IsAttachedSound</CODE></a> each frame. However, you must take into consideration the effect of sounds that were stopped by calls to <a href="../../../nw/snd/SoundHandle/Stop.html"><CODE>Stop</CODE></a>, explicit calls to <a href="../../../nw/snd/SoundHandle/DetachSound.html"><CODE>DetachSound</CODE></a>, or determinations made about player priorities.</p><p>For determinations made about player priorities, refer to the "Priority Operations" chapter of the <I>Sound System Manual</I>.</p><p>There are three types of sounds: sequence sounds, stream sounds, and wave sounds. The <a href="../../../nw/snd/SoundHandle/Overview.html"><CODE>SoundHandle</CODE></a> class can be used to handle operations that are common to all these sounds.</p><p>The <a href="../../../nw/snd/SequenceSoundHandle/Overview.html"><CODE>SequenceSoundHandle</CODE></a>, <a href="../../../nw/snd/StreamSoundHandle/Overview.html"><CODE>StreamSoundHandle</CODE></a>, and <a href="../../../nw/snd/WaveSoundHandle/Overview.html"><CODE>WaveSoundHandle</CODE></a> classes provide operations specific to each sound type that cannot be handled with the <a href="../../../nw/snd/SoundHandle/Overview.html"><CODE>SoundHandle</CODE></a> class.</p></div> 63 <a name="function" id="function"> 64 <h2>Member Functions</h2> 65 <div class="section"> 66 <table class="members"> 67 <tr> 68 <th class="category" colspan="3">Constructors/Destructors</th> 69 </tr> 70 <tr> 71 <td width="100"> </td> 72 <th> 73 <a href="../../../nw/snd/SoundHandle/SoundHandle.html">SoundHandle</a> 74 </th> 75 <td>Constructor.</td> 76 </tr> 77 <tr> 78 <td width="100"> </td> 79 <th> 80 <a href="../../../nw/snd/SoundHandle/~SoundHandle.html">~SoundHandle</a> 81 </th> 82 <td>Destructor.</td> 83 </tr> 84 <tr> 85 <th class="category" colspan="3">Play, Stop, Pause, Resume</th> 86 </tr> 87 <tr> 88 <td width="100"> </td> 89 <th> 90 <a href="../../../nw/snd/SoundHandle/StartPrepared.html">StartPrepared</a> 91 </th> 92 <td>Plays the sound whose preparation for playback has completed.</td> 93 </tr> 94 <tr> 95 <td width="100"> </td> 96 <th> 97 <a href="../../../nw/snd/SoundHandle/Stop.html"><CODE>Stop</CODE></a> 98 </th> 99 <td>Stops the sound.</td> 100 </tr> 101 <tr> 102 <td width="100"> </td> 103 <th> 104 <a href="../../../nw/snd/SoundHandle/Pause.html">Pause</a> 105 </th> 106 <td>Pauses or restarts a sound.</td> 107 </tr> 108 <tr> 109 <td width="100"> </td> 110 <th> 111 <a href="../../../nw/snd/SoundHandle/IsPrepared.html">IsPrepared</a> 112 </th> 113 <td>Checks whether preparation for sound playback is complete.</td> 114 </tr> 115 <tr> 116 <td width="100"> </td> 117 <th> 118 <a href="../../../nw/snd/SoundHandle/IsPause.html">IsPause</a> 119 </th> 120 <td>Checks whether the sound is currently paused.</td> 121 </tr> 122 <tr> 123 <td width="100"> </td> 124 <th> 125 <a href="../../../nw/snd/SoundHandle/FadeIn.html">FadeIn</a> 126 </th> 127 <td>Fades in the sound when playback starts.</td> 128 </tr> 129 <tr> 130 <td width="100"> </td> 131 <th> 132 <a href="../../../nw/snd/SoundHandle/GetRemainingFadeFrames.html">GetRemainingFadeFrames</a> 133 </th> 134 <td>Obtains the number of frames that remain until the fade-in or fade-out completes.</td> 135 </tr> 136 <tr> 137 <td width="100"> </td> 138 <th> 139 <a href="../../../nw/snd/SoundHandle/GetRemainingPauseFadeFrames.html">GetRemainingPauseFadeFrames</a> 140 </th> 141 <td>Obtains the number of remaining frames until the fade completes when the system is paused.</td> 142 </tr> 143 <tr> 144 <th class="category" colspan="3">Parameters</th> 145 </tr> 146 <tr> 147 <td width="100"> </td> 148 <th> 149 <a href="../../../nw/snd/SoundHandle/SetVolume.html">SetVolume</a> 150 </th> 151 <td>Changes the volume of the sound.</td> 152 </tr> 153 <tr> 154 <td width="100"> </td> 155 <th> 156 <a href="../../../nw/snd/SoundHandle/SetPitch.html">SetPitch</a> 157 </th> 158 <td>Changes the pitch of the sound.</td> 159 </tr> 160 <tr> 161 <td width="100"> </td> 162 <th> 163 <a href="../../../nw/snd/SoundHandle/SetPan.html">SetPan</a> 164 </th> 165 <td>Changes the pan (right/left location) of the sound.</td> 166 </tr> 167 <tr> 168 <td width="100"> </td> 169 <th> 170 <a href="../../../nw/snd/SoundHandle/SetSurroundPan.html">SetSurroundPan</a> 171 </th> 172 <td>Changes the surround pan (front-to-back location) of the sound.</td> 173 </tr> 174 <tr> 175 <td width="100"> </td> 176 <th> 177 <a href="../../../nw/snd/SoundHandle/SetLpfFreq.html">SetLpfFreq</a> 178 </th> 179 <td>Changes the low pass filter cutoff value of the sound.</td> 180 </tr> 181 <tr> 182 <td width="100"> </td> 183 <th> 184 <a href="../../../nw/snd/SoundHandle/SetBiquadFilter.html">SetBiquadFilter</a> 185 </th> 186 <td>Changes the biquad filter setting for sound.</td> 187 </tr> 188 <tr> 189 <td width="100"> </td> 190 <th> 191 <a href="../../../nw/snd/SoundHandle/SetPlayerPriority.html">SetPlayerPriority</a> 192 </th> 193 <td>Changes the player priority.</td> 194 </tr> 195 <tr> 196 <th class="category" colspan="3">Output Parameters</th> 197 </tr> 198 <tr> 199 <td width="100"> </td> 200 <th> 201 <a href="../../../nw/snd/SoundHandle/SetMainSend.html">SetMainSend</a> 202 </th> 203 <td>Changes the main send volume of the sound.</td> 204 </tr> 205 <tr> 206 <td width="100"> </td> 207 <th> 208 <a href="../../../nw/snd/SoundHandle/SetFxSend.html">SetFxSend</a> 209 </th> 210 <td>Changes the effect send volume of the sound.</td> 211 </tr> 212 <tr> 213 <th class="category" colspan="3">Handle Operations</th> 214 </tr> 215 <tr> 216 <td width="100"> </td> 217 <th> 218 <a href="../../../nw/snd/SoundHandle/IsAttachedSound.html">IsAttachedSound</a> 219 </th> 220 <td>Checks whether there is a sound associated with the handle.</td> 221 </tr> 222 <tr> 223 <td width="100"> </td> 224 <th> 225 <a href="../../../nw/snd/SoundHandle/DetachSound.html">DetachSound</a> 226 </th> 227 <td>Frees sounds from handles.</td> 228 </tr> 229 <tr> 230 <td width="100"> </td> 231 <th> 232 <a href="../../../nw/snd/SoundHandle/SetId.html">SetId</a> 233 </th> 234 <td>Sets the ID of a sound.</td> 235 </tr> 236 <tr> 237 <td width="100"> </td> 238 <th> 239 <a href="../../../nw/snd/SoundHandle/GetId.html"><CODE>GetId</CODE></a> 240 </th> 241 <td>Obtains the ID of a sound.</td> 242 </tr> </table> 243 </div> 244 </a> 245 <h2>See Also</h2> 246 <div class="section"> 247 <p class="reference"><a href="../../../nw/snd/SoundArchivePlayer/Overview.html"><CODE>SoundArchivePlayer</CODE></a> Class<br /><a href="../../../nw/snd/SequenceSoundHandle/Overview.html"><CODE>SequenceSoundHandle</CODE></a> Class<br /><a href="../../../nw/snd/StreamSoundHandle/Overview.html"><CODE>StreamSoundHandle</CODE></a> Class<br /><a href="../../../nw/snd/WaveSoundHandle/Overview.html"><CODE>WaveSoundHandle</CODE></a> Class<br /> </p> 248 </div> 249 <h2>Revision History</h2> 250 <div class="section"> 251 <dl class="history"> 252 <dt>2010/04/28</dt> 253 <dd>Added the conditions under which handles and sounds will cease to be associated. Added information about how to determine if a sound has played through to completion.<br /> 254 </dd> 255 <dt>2010/01/25</dt> 256 <dd>Added information about the <CODE>SequenceSoundHandle</CODE>, <CODE>StreamSoundHandle</CODE>, and <CODE>WaveSoundHandle</CODE> classes.<br /> 257 </dd> 258 <dt>2010/01/15</dt> 259 <dd>Initial version.<br /> 260 </dd> 261 </dl> 262 </div> 263 <hr><p>CONFIDENTIAL</p></body> 264</html>