aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/a02418.html
blob: ff84e067d2da56d5f9cf0ef766ffeeade777e2bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>NeL:  TemplateNLSOUND::CContextSoundContainer&lt; NbJoker, UseRandom, Shift &gt; class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex">  <form class="search" action="search.php" method="get">
<a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a>  | <span class="search"><u>S</u>earch&nbsp;for&nbsp;<input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div>
<h1>NLSOUND::CContextSoundContainer&lt; NbJoker, UseRandom, Shift &gt; Class Template Reference</h1><code>#include &lt;<a class="el" href="a05612.html">context_sound.h</a>&gt;</code>
<p>
<p>Inheritance diagram for NLSOUND::CContextSoundContainer&lt; NbJoker, UseRandom, Shift &gt;:
<p><center><img src="a02418.png" usemap="#NLSOUND::CContextSoundContainer< NbJoker, UseRandom, Shift >_map" border="0" alt=""></center>
<map name="NLSOUND::CContextSoundContainer< NbJoker, UseRandom, Shift >_map">
<area href="a03849.html" alt="NLSOUND::IContextSoundContainer" shape="rect" coords="0,0,401,24">
</map>
<h3>template&lt;uint NbJoker, bool UseRandom, uint Shift = 5&gt;<br>
 class NLSOUND::CContextSoundContainer&lt; NbJoker, UseRandom, Shift &gt;</h3>

<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Private Types</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>enum &nbsp;</td><td class="memItemRight" valign=bottom>{ <a class="el" href="a02418.html#NLSOUND_1_1CContextSoundContainery0NLSOUND_1_1CContextSoundContainery1">JOKER_ARRAY_SIZE</a> =  (NbJoker == 0 ? 1 : NbJoker)
 }</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>typedef std::hash_map&lt; <a class="el" href="a02415.html">CContextMatcher</a>&lt;<br>
 NbJoker, UseRandom, Shift &gt;,<br>
 <a class="el" href="a02246.html">CSound</a> *, <a class="el" href="a02415.html">CContextMatcher</a>&lt;<br>
 NbJoker, UseRandom, Shift <br>
&gt;::CHash &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02418.html#NLSOUND_1_1CContextSoundContainery2">THashContextSound</a></td></tr>

<tr><td colspan=2><br><h2>Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02418.html#NLSOUND_1_1CContextSoundContainerd0">addSound</a> (<a class="el" href="a02246.html">CSound</a> *sound, const std::string &amp;baseName)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>virtual float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02418.html#NLSOUND_1_1CContextSoundContainerd1">getMaxDistance</a> () const </td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>virtual <a class="el" href="a02246.html">CSound</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02418.html#NLSOUND_1_1CContextSoundContainerd2">getSound</a> (const <a class="el" href="a03417.html">CSoundContext</a> &amp;context, <a class="el" href="a04558.html#a11">uint32</a> randomValue)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02418.html#NLSOUND_1_1CContextSoundContainerd3">getSoundList</a> (std::vector&lt; std::pair&lt; std::string, <a class="el" href="a02246.html">CSound</a> * &gt; &gt; &amp;subsounds) const </td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02418.html#NLSOUND_1_1CContextSoundContainerd4">init</a> (<a class="el" href="a04558.html#a15">uint</a> *contextArgsIndex)</td></tr>

<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a11">uint32</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02418.html#NLSOUND_1_1CContextSoundContainerr0">_ContextArgsIndex</a> [JOKER_ARRAY_SIZE]</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02418.html#NLSOUND_1_1CContextSoundContainery2">THashContextSound</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02418.html#NLSOUND_1_1CContextSoundContainerr1">_ContextSounds</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02418.html#NLSOUND_1_1CContextSoundContainerr2">_MaxDist</a></td></tr>

</table>
<hr><h2>Member Typedef Documentation</h2>
<a class="anchor" name="NLSOUND_1_1CContextSoundContainery2" doxytag="NLSOUND::CContextSoundContainer::THashContextSound" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" colspan="4">
template&lt;uint NbJoker, bool UseRandom, uint Shift = 5&gt; </td>
        </tr>
        <tr>
          <td class="md" nowrap valign="top"> typedef std::hash_map&lt;<a class="el" href="a02415.html">CContextMatcher</a>&lt;NbJoker, UseRandom, Shift&gt;, <a class="el" href="a02246.html">CSound</a> *, <a class="el" href="a02415.html">CContextMatcher</a>&lt;NbJoker, UseRandom, Shift&gt;::CHash&gt; <a class="el" href="a02418.html">NLSOUND::CContextSoundContainer</a>&lt; NbJoker, UseRandom, Shift &gt;::<a class="el" href="a02418.html#NLSOUND_1_1CContextSoundContainery2">THashContextSound</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a05612.html#l00123">123</a> of file <a class="el" href="a05612.html">context_sound.h</a>.    </td>
  </tr>
</table>
<hr><h2>Member Enumeration Documentation</h2>
<a class="anchor" name="NLSOUND_1_1CContextSoundContainery0" doxytag="NLSOUND::CContextSoundContainer::@60" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" colspan="4">
template&lt;uint NbJoker, bool UseRandom, uint Shift = 5&gt; </td>
        </tr>
        <tr>
          <td class="md" nowrap valign="top"> anonymous enum<code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
<dl compact><dt><b>Enumeration values: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em><a class="anchor" name="NLSOUND_1_1CContextSoundContainery0NLSOUND_1_1CContextSoundContainery1" doxytag="JOKER_ARRAY_SIZE" ></a>JOKER_ARRAY_SIZE</em>&nbsp;</td><td>
</td></tr>
</table>
</dl>

<p>
Definition at line <a class="el" href="a05612.html#l00117">117</a> of file <a class="el" href="a05612.html">context_sound.h</a>.
<p>
<div class="fragment"><pre>00118         {
00119                 <span class="comment">// Size of array : special case for 0 joker because we can't declare array of 0 elements</span>
00120                 <a class="code" href="a02418.html#NLSOUND_1_1CContextSoundContainery0NLSOUND_1_1CContextSoundContainery1">JOKER_ARRAY_SIZE</a> = (NbJoker == 0 ? 1 : NbJoker)
00121         };
</pre></div>    </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="NLSOUND_1_1CContextSoundContainerd0" doxytag="NLSOUND::CContextSoundContainer::addSound" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" colspan="4">
template&lt;uint NbJoker, bool UseRandom, uint Shift = 5&gt; </td>
        </tr>
        <tr>
          <td class="md" nowrap valign="top"> virtual void <a class="el" href="a02418.html">NLSOUND::CContextSoundContainer</a>&lt; NbJoker, UseRandom, Shift &gt;::addSound </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a02246.html">CSound</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>sound</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const std::string &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>baseName</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [inline, private, virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Implements <a class="el" href="a03849.html#NLSOUND_1_1IContextSoundContainera0">NLSOUND::IContextSoundContainer</a>.
<p>
Definition at line <a class="el" href="a05612.html#l00136">136</a> of file <a class="el" href="a05612.html">context_sound.h</a>.
<p>
References <a class="el" href="a05612.html#l00274">NLSOUND::CContextSoundContainer&lt; NbJoker, UseRandom, Shift &gt;::_ContextSounds</a>, <a class="el" href="a06407.html#l00110">NLSOUND::CSound::getMaxDistance()</a>, <a class="el" href="a06407.html#l00108">NLSOUND::CSound::getName()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05622.html#l00101">nldebug</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00100">uint32</a>.
<p>
<div class="fragment"><pre>00137         {
00138                 <span class="keyword">const</span> std::string &amp;patternName = CStringMapper::unmap(sound-&gt;getName());
00139                 <a class="code" href="a04199.html#a6">nlassert</a>(patternName.size() &gt;= baseName.size());
00140 
00141                 std::string arg;
00142                 <a class="code" href="a04558.html#a11">uint32</a>          args[<a class="code" href="a02418.html#NLSOUND_1_1CContextSoundContainery0NLSOUND_1_1CContextSoundContainery1">JOKER_ARRAY_SIZE</a>];
00143 
00144                 <a class="code" href="a02418.html#NLSOUND_1_1CContextSoundContainerr2">_MaxDist</a> = std::max(sound-&gt;getMaxDistance(), <a class="code" href="a02418.html#NLSOUND_1_1CContextSoundContainerr2">_MaxDist</a>);
00145 
00146                 <span class="comment">// extract the context values</span>
00147                 std::string::const_iterator     first(patternName.begin() + baseName.size()), last(patternName.end());
00148 <span class="comment">//              std::string::const_iterator     first2(baseName.begin()), last2(baseName.end());</span>
00149                 <span class="comment">// 1st, skip the base name </span>
00150 <span class="comment">//              for (; first == first2; ++first, ++first2);</span>
00151 
00152                 <span class="comment">// 2nd, read all the joker values</span>
00153                 <a class="code" href="a04558.html#a15">uint</a> i;
00154                 <span class="keywordflow">for</span> ( i=0; i&lt;NbJoker &amp;&amp; first != last; ++first)
00155                 {
00156                         <span class="keywordflow">if</span> (isdigit(<span class="keywordtype">int</span>(*first)))
00157                         {
00158                                 arg += *first;
00159                         }
00160                         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!arg.empty())
00161                         {
00162                                 <span class="comment">// end of the argument.</span>
00163                                 args[i++] = atoi(arg.c_str());
00164                                 arg = <span class="stringliteral">""</span>;
00165                         }
00166                 }
00167                 <span class="comment">// read the potential last arg.</span>
00168                 <span class="keywordflow">if</span> (!arg.empty())
00169                 {
00170                         <span class="comment">// end of the argument.</span>
00171                         args[i++] = atoi(arg.c_str());
00172                         arg = <span class="stringliteral">""</span>;
00173                 }
00174 
00175                 <span class="keywordflow">if</span> (i != NbJoker)
00176                         <span class="keywordflow">return</span>;
00177                 <a class="code" href="a04199.html#a6">nlassert</a>(i==NbJoker);
00178 
00179                 <span class="keywordtype">int</span> randomValue;
00180                 <span class="keywordflow">if</span> (UseRandom)
00181                 {
00182                         <span class="keywordtype">bool</span> ok = <span class="keyword">false</span>;
00183                         <span class="comment">// 3rd, read the random value (if any)</span>
00184                         <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> i=0; first != last; ++first)
00185                         {
00186                                 <span class="keywordflow">if</span> (isdigit(<span class="keywordtype">int</span>(*first)))
00187                                 {
00188                                         arg += *first;
00189                                 }
00190                                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!arg.empty())
00191                                 {
00192                                         <a class="code" href="a04199.html#a6">nlassert</a> (ok == <span class="keyword">false</span>);
00193                                         <span class="comment">// end of the argument.</span>
00194                                         randomValue = atoi(arg.c_str());
00195                                         arg = <span class="stringliteral">""</span>;
00196                                         ok = <span class="keyword">true</span>;
00197                                 }
00198                         }
00199                         <span class="comment">// read the potential last arg.</span>
00200                         <span class="keywordflow">if</span> (!arg.empty())
00201                         {
00202                                 <a class="code" href="a04199.html#a6">nlassert</a> (ok == <span class="keyword">false</span>);
00203                                 <span class="comment">// end of the argument.</span>
00204                                 randomValue = atoi(arg.c_str());
00205                                 arg = <span class="stringliteral">""</span>;
00206                                 ok = <span class="keyword">true</span>;
00207                         }
00208                         <a class="code" href="a04199.html#a6">nlassert</a> (ok == <span class="keyword">true</span>);
00209 
00210                 }
00211                 <span class="keywordflow">else</span>
00212                 {
00213                         randomValue = 0;
00214                 }
00215                         
00216                 <span class="comment">// ok, now create the key and store the sound.</span>
00217                 CContextMatcher&lt;NbJoker, UseRandom, Shift&gt;      cm(args, randomValue);
00218 
00219 <span class="preprocessor">#ifdef _DEBUG</span>
00220 <span class="preprocessor"></span>                <span class="keywordtype">char</span> tmp[1024];
00221                 <span class="keywordtype">char</span> tmp2[1024];
00222 
00223                 <a class="code" href="a05378.html#a259">smprintf</a>(tmp, 1024, <span class="stringliteral">"Adding sound : %s, args = "</span>, patternName.c_str());
00224 
00225                 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> k=0; k&lt;NbJoker; ++k)
00226                 {
00227                         sprintf(tmp2, <span class="stringliteral">"%u"</span>, args[k]);
00228                         strcat(tmp, tmp2);
00229                 }
00230 
00231                 <a class="code" href="a04199.html#a0">nldebug</a>(tmp);
00232 
00233 <span class="preprocessor">#endif</span>
00234 <span class="preprocessor"></span>
00235                 std::pair&lt;THashContextSound::iterator, bool&gt;    ret;
00236                 ret = <a class="code" href="a02418.html#NLSOUND_1_1CContextSoundContainerr1">_ContextSounds</a>.insert(std::make_pair(cm, sound));
00237                 <span class="keywordflow">if</span> (!ret.second)
00238                 {
00239                         THashContextSound::iterator it = <a class="code" href="a02418.html#NLSOUND_1_1CContextSoundContainerr1">_ContextSounds</a>.find(cm);
00240                         <a class="code" href="a04199.html#a6">nlassert</a>(it != <a class="code" href="a02418.html#NLSOUND_1_1CContextSoundContainerr1">_ContextSounds</a>.end());
00241 
00242                         <a class="code" href="a04199.html#a2">nlwarning</a>(<span class="stringliteral">"Sound %s has the same context matcher as the sound %s"</span>, CStringMapper::unmap(sound-&gt;getName()).c_str(), CStringMapper::unmap(it-&gt;second-&gt;getName()).c_str());
00243                 }
00244         }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CContextSoundContainerd1" doxytag="NLSOUND::CContextSoundContainer::getMaxDistance" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" colspan="4">
template&lt;uint NbJoker, bool UseRandom, uint Shift = 5&gt; </td>
        </tr>
        <tr>
          <td class="md" nowrap valign="top"> virtual float <a class="el" href="a02418.html">NLSOUND::CContextSoundContainer</a>&lt; NbJoker, UseRandom, Shift &gt;::getMaxDistance </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const<code> [inline, private, virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Implements <a class="el" href="a03849.html#NLSOUND_1_1IContextSoundContainera1">NLSOUND::IContextSoundContainer</a>.
<p>
Definition at line <a class="el" href="a05612.html#l00131">131</a> of file <a class="el" href="a05612.html">context_sound.h</a>.
<p>
<div class="fragment"><pre>00132         {
00133                 <span class="keywordflow">return</span> <a class="code" href="a02418.html#NLSOUND_1_1CContextSoundContainerr2">_MaxDist</a>;
00134         }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CContextSoundContainerd2" doxytag="NLSOUND::CContextSoundContainer::getSound" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" colspan="4">
template&lt;uint NbJoker, bool UseRandom, uint Shift = 5&gt; </td>
        </tr>
        <tr>
          <td class="md" nowrap valign="top"> virtual <a class="el" href="a02246.html">CSound</a>* <a class="el" href="a02418.html">NLSOUND::CContextSoundContainer</a>&lt; NbJoker, UseRandom, Shift &gt;::getSound </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="a03417.html">CSoundContext</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>context</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a11">uint32</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>randomValue</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [inline, private, virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Implements <a class="el" href="a03849.html#NLSOUND_1_1IContextSoundContainera2">NLSOUND::IContextSoundContainer</a>.
<p>
Definition at line <a class="el" href="a05612.html#l00246">246</a> of file <a class="el" href="a05612.html">context_sound.h</a>.
<p>
References <a class="el" href="a05612.html#l00273">NLSOUND::CContextSoundContainer&lt; NbJoker, UseRandom, Shift &gt;::_ContextArgsIndex</a>, <a class="el" href="a05612.html#l00274">NLSOUND::CContextSoundContainer&lt; NbJoker, UseRandom, Shift &gt;::_ContextSounds</a>, <a class="el" href="a06630.html#l00059">NLSOUND::CSoundContext::Args</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00100">uint32</a>.
<p>
<div class="fragment"><pre>00247         {
00248                 <span class="comment">// create a key</span>
00249                 <a class="code" href="a04558.html#a11">uint32</a>          args[<a class="code" href="a02418.html#NLSOUND_1_1CContextSoundContainery0NLSOUND_1_1CContextSoundContainery1">JOKER_ARRAY_SIZE</a>];
00250                 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> i=0; i&lt;NbJoker; ++i)
00251                         args[i] = context.Args[<a class="code" href="a02418.html#NLSOUND_1_1CContextSoundContainerr0">_ContextArgsIndex</a>[i]];
00252 
00253                 CContextMatcher&lt;NbJoker, UseRandom, Shift&gt;      cm(args, randomValue);
00254 
00255                 THashContextSound::iterator it = <a class="code" href="a02418.html#NLSOUND_1_1CContextSoundContainerr1">_ContextSounds</a>.find(cm);
00256 
00257                 <span class="keywordflow">if</span> (it != <a class="code" href="a02418.html#NLSOUND_1_1CContextSoundContainerr1">_ContextSounds</a>.end())
00258                         <span class="keywordflow">return</span> it-&gt;second;
00259                 <span class="keywordflow">else</span>
00260                         <span class="keywordflow">return</span> 0;
00261         }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CContextSoundContainerd3" doxytag="NLSOUND::CContextSoundContainer::getSoundList" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" colspan="4">
template&lt;uint NbJoker, bool UseRandom, uint Shift = 5&gt; </td>
        </tr>
        <tr>
          <td class="md" nowrap valign="top"> void <a class="el" href="a02418.html">NLSOUND::CContextSoundContainer</a>&lt; NbJoker, UseRandom, Shift &gt;::getSoundList </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">std::vector&lt; std::pair&lt; std::string, <a class="el" href="a02246.html">CSound</a> * &gt; &gt; &amp;&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>subsounds</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const<code> [inline, private, virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Implements <a class="el" href="a03849.html#NLSOUND_1_1IContextSoundContainera3">NLSOUND::IContextSoundContainer</a>.
<p>
Definition at line <a class="el" href="a05612.html#l00263">263</a> of file <a class="el" href="a05612.html">context_sound.h</a>.
<p>
References <a class="el" href="a05612.html#l00274">NLSOUND::CContextSoundContainer&lt; NbJoker, UseRandom, Shift &gt;::_ContextSounds</a>.
<p>
<div class="fragment"><pre>00264         {
00265                 THashContextSound::const_iterator first(<a class="code" href="a02418.html#NLSOUND_1_1CContextSoundContainerr1">_ContextSounds</a>.begin()), last(<a class="code" href="a02418.html#NLSOUND_1_1CContextSoundContainerr1">_ContextSounds</a>.end());
00266                 <span class="keywordflow">for</span> (; first != last; ++first)
00267                 {
00268                         subsounds.push_back(std::make_pair(CStringMapper::unmap(first-&gt;second-&gt;getName()), first-&gt;second));
00269                 }
00270         }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CContextSoundContainerd4" doxytag="NLSOUND::CContextSoundContainer::init" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" colspan="4">
template&lt;uint NbJoker, bool UseRandom, uint Shift = 5&gt; </td>
        </tr>
        <tr>
          <td class="md" nowrap valign="top"> virtual void <a class="el" href="a02418.html">NLSOUND::CContextSoundContainer</a>&lt; NbJoker, UseRandom, Shift &gt;::init </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a> *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>contextArgsIndex</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [inline, private, virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Implements <a class="el" href="a03849.html#NLSOUND_1_1IContextSoundContainera4">NLSOUND::IContextSoundContainer</a>.
<p>
Definition at line <a class="el" href="a05612.html#l00125">125</a> of file <a class="el" href="a05612.html">context_sound.h</a>.
<p>
References <a class="el" href="a05612.html#l00273">NLSOUND::CContextSoundContainer&lt; NbJoker, UseRandom, Shift &gt;::_ContextArgsIndex</a>, <a class="el" href="a05702.html#l00239">NLMISC::CFastMem::memcpy</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
<div class="fragment"><pre>00126         {
00127                 <a class="code" href="a02418.html#NLSOUND_1_1CContextSoundContainerr2">_MaxDist</a> = 0;
00128                 <a class="code" href="a02515.html#NLMISC_1_1CFastMems0">NLMISC::CFastMem::memcpy</a>(_ContextArgsIndex, contextArgsIndex, <span class="keyword">sizeof</span>(<a class="code" href="a04558.html#a15">uint</a>) * NbJoker);
00129         }
</pre></div>    </td>
  </tr>
</table>
<hr><h2>Field Documentation</h2>
<a class="anchor" name="NLSOUND_1_1CContextSoundContainerr0" doxytag="NLSOUND::CContextSoundContainer::_ContextArgsIndex" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" colspan="4">
template&lt;uint NbJoker, bool UseRandom, uint Shift = 5&gt; </td>
        </tr>
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a11">uint32</a> <a class="el" href="a02418.html">NLSOUND::CContextSoundContainer</a>&lt; NbJoker, UseRandom, Shift &gt;::<a class="el" href="a02418.html#NLSOUND_1_1CContextSoundContainerr0">_ContextArgsIndex</a>[JOKER_ARRAY_SIZE]<code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a05612.html#l00273">273</a> of file <a class="el" href="a05612.html">context_sound.h</a>.
<p>
Referenced by <a class="el" href="a05612.html#l00246">NLSOUND::CContextSoundContainer&lt; NbJoker, UseRandom, Shift &gt;::getSound()</a>, and <a class="el" href="a05612.html#l00125">NLSOUND::CContextSoundContainer&lt; NbJoker, UseRandom, Shift &gt;::init()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CContextSoundContainerr1" doxytag="NLSOUND::CContextSoundContainer::_ContextSounds" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" colspan="4">
template&lt;uint NbJoker, bool UseRandom, uint Shift = 5&gt; </td>
        </tr>
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a02418.html#NLSOUND_1_1CContextSoundContainery2">THashContextSound</a> <a class="el" href="a02418.html">NLSOUND::CContextSoundContainer</a>&lt; NbJoker, UseRandom, Shift &gt;::<a class="el" href="a02418.html#NLSOUND_1_1CContextSoundContainerr1">_ContextSounds</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a05612.html#l00274">274</a> of file <a class="el" href="a05612.html">context_sound.h</a>.
<p>
Referenced by <a class="el" href="a05612.html#l00136">NLSOUND::CContextSoundContainer&lt; NbJoker, UseRandom, Shift &gt;::addSound()</a>, <a class="el" href="a05612.html#l00246">NLSOUND::CContextSoundContainer&lt; NbJoker, UseRandom, Shift &gt;::getSound()</a>, and <a class="el" href="a05612.html#l00263">NLSOUND::CContextSoundContainer&lt; NbJoker, UseRandom, Shift &gt;::getSoundList()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CContextSoundContainerr2" doxytag="NLSOUND::CContextSoundContainer::_MaxDist" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" colspan="4">
template&lt;uint NbJoker, bool UseRandom, uint Shift = 5&gt; </td>
        </tr>
        <tr>
          <td class="md" nowrap valign="top"> float <a class="el" href="a02418.html">NLSOUND::CContextSoundContainer</a>&lt; NbJoker, UseRandom, Shift &gt;::<a class="el" href="a02418.html#NLSOUND_1_1CContextSoundContainerr2">_MaxDist</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a05612.html#l00275">275</a> of file <a class="el" href="a05612.html">context_sound.h</a>.    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="a05612.html">context_sound.h</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 14:38:00 2004 for NeL by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 > 
</a>1.3.6 </small></address>
</body>
</html>