aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/a03420.html
blob: b99d7d4b761aa0c18262f20b581173cd65625b46 (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
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
<!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: NLSOUND::CSoundDriverDSound 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::CSoundDriverDSound Class Reference</h1><code>#include &lt;<a class="el" href="a06421.html">sound_driver_dsound.h</a>&gt;</code>
<p>
<p>Inheritance diagram for NLSOUND::CSoundDriverDSound:
<p><center><img src="a03420.png" usemap="#NLSOUND::CSoundDriverDSound_map" border="0" alt=""></center>
<map name="NLSOUND::CSoundDriverDSound_map">
<area href="a03419.html" alt="NLSOUND::ISoundDriver" shape="rect" coords="0,0,204,24">
</map>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public 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="a03420.html#NLSOUND_1_1CSoundDriverDSounda0">commit3DChanges</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Commit all the changes made to 3D settings of listener and sources.  <a href="#NLSOUND_1_1CSoundDriverDSounda0"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSounda1">countHw2DBuffers</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Count the number of available hardware streaming 2D buffers.  <a href="#NLSOUND_1_1CSoundDriverDSounda1"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSounda2">countHw3DBuffers</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Count the number of available hardware streaming 3D buffers.  <a href="#NLSOUND_1_1CSoundDriverDSounda2"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual <a class="el" href="a04558.html#a15">uint</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSounda3">countMaxSources</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the maximum number of sources that can created.  <a href="#NLSOUND_1_1CSoundDriverDSounda3"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSounda4">countPlayingSources</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Count the number of sources that are actually playing.  <a href="#NLSOUND_1_1CSoundDriverDSounda4"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual <a class="el" href="a02298.html">IBuffer</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSounda5">createBuffer</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a sound buffer.  <a href="#NLSOUND_1_1CSoundDriverDSounda5"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual <a class="el" href="a03861.html">IListener</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSounda6">createListener</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create the listener instance.  <a href="#NLSOUND_1_1CSoundDriverDSounda6"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual <a class="el" href="a03428.html">ISource</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSounda7">createSource</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a source.  <a href="#NLSOUND_1_1CSoundDriverDSounda7"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSounda8">CSoundDriverDSound</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor.  <a href="#NLSOUND_1_1CSoundDriverDSounda8"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSounda9">getGain</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the gain.  <a href="#NLSOUND_1_1CSoundDriverDSounda9"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>IStringMapperProvider *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSounda10">getStringMapper</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the string mapper.  <a href="#NLSOUND_1_1CSoundDriverDSounda10"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSounda11">init</a> (HWND wnd, bool useEax, IStringMapperProvider *stringMapper)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialization.  <a href="#NLSOUND_1_1CSoundDriverDSounda11"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSounda12">readRawBuffer</a> (<a class="el" href="a02298.html">IBuffer</a> *destbuffer, const std::string &amp;name, <a class="el" href="a04558.html#a7">uint8</a> *rawData, <a class="el" href="a04558.html#a15">uint</a> dataSize, <a class="el" href="a05381.html#a80">TSampleFormat</a> <a class="el" href="a04223.html#a641">format</a>, <a class="el" href="a04558.html#a11">uint32</a> frequency)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSounda13">readWavBuffer</a> (<a class="el" href="a02298.html">IBuffer</a> *destbuffer, const std::string &amp;name, <a class="el" href="a04558.html#a7">uint8</a> *wavData, <a class="el" href="a04558.html#a15">uint</a> dataSize)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Load a wave file in to the buffer.  <a href="#NLSOUND_1_1CSoundDriverDSounda13"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSounda14">setGain</a> (float gain)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSounda15">update</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Update all the driver and its sources. To be called only by the timer callback.  <a href="#NLSOUND_1_1CSoundDriverDSounda15"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSounda16">writeProfile</a> (std::ostream &amp;out)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Write information about the driver to the output stream.  <a href="#NLSOUND_1_1CSoundDriverDSounda16"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSounda17">~CSoundDriverDSound</a> ()</td></tr>

<tr><td colspan=2><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03419.html">ISoundDriver</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03419.html#NLSOUND_1_1ISoundDrivere0">createDriver</a> (bool useEax, IStringMapperProvider *stringMapper)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03420.html">CSoundDriverDSound</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSounde1">instance</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the instance of the singleton.  <a href="#NLSOUND_1_1CSoundDriverDSounde1"></a><br><br></td></tr>
<tr><td colspan=2><br><h2>Static Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>const <a class="el" href="a04558.html#a11">uint32</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03419.html#NLSOUND_1_1ISoundDrivers0">InterfaceVersion</a> = 0x08</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Version of the driver interface. To increment when the interface change.  <a href="#NLSOUND_1_1ISoundDrivers0"></a><br><br></td></tr>
<tr><td colspan=2><br><h2>Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>friend&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundd0">CBufferDSound::~CBufferDSound</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>friend&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundd1">CSourceDSound::~CSourceDSound</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundd2">displayBench</a> (<a class="el" href="a02813.html">NLMISC::CLog</a> *log)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundd3">endBench</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundd4">removeBuffer</a> (<a class="el" href="a02298.html">IBuffer</a> *<a class="el" href="a04223.html#a589">buffer</a>)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Remove a buffer (should be called by the friend destructor of the buffer class).  <a href="#NLSOUND_1_1CSoundDriverDSoundd4"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundd5">removeSource</a> (<a class="el" href="a03428.html">ISource</a> *source)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Remove a source (should be called by the friend destructor of the source class).  <a href="#NLSOUND_1_1CSoundDriverDSoundd5"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundd6">startBench</a> ()</td></tr>

<tr><td colspan=2><br><h2>Static Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void CALLBACK&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundh0">TimerCallback</a> (UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2)</td></tr>

<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>DSCAPS&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr0">_Caps</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>LPDIRECTSOUND8&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr1">_DirectSound</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>LPDIRECTSOUNDBUFFER&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr2">_PrimaryBuffer</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr3">_SourceCount</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>std::set&lt; <a class="el" href="a03430.html">CSourceDSound</a> * &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr4">_Sources</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>IStringMapperProvider *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr5">_StringMapper</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The string mapper provided by client code.  <a href="#NLSOUND_1_1CSoundDriverDSoundr5"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>UINT&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr6">_TimerID</a></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="a03420.html#NLSOUND_1_1CSoundDriverDSoundr7">_TimerResolution</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr8">_UseEAX</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The EAX support is requested and accepted (ie, there is enougth hardware 3D buffer).  <a href="#NLSOUND_1_1CSoundDriverDSoundr8"></a><br><br></td></tr>
<tr><td colspan=2><br><h2>Static Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03420.html">CSoundDriverDSound</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundv0">_Instance</a> = NULL</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="a03420.html#NLSOUND_1_1CSoundDriverDSoundv1">_TimerPeriod</a> = 100</td></tr>

</table>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSounda8" doxytag="NLSOUND::CSoundDriverDSound::CSoundDriverDSound" ></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" nowrap valign="top"> NLSOUND::CSoundDriverDSound::CSoundDriverDSound </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></td>
        </tr>

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

<p>
Constructor. 
<p>
    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSounda17" doxytag="NLSOUND::CSoundDriverDSound::~CSoundDriverDSound" ></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" nowrap valign="top"> NLSOUND::CSoundDriverDSound::~<a class="el" href="a03420.html">CSoundDriverDSound</a> </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><code> [virtual]</code></td>
        </tr>

      </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="a06420.html#l00561">561</a> of file <a class="el" href="a06420.html">sound_driver_dsound.cpp</a>.
<p>
References <a class="el" href="a06421.html#l00145">_DirectSound</a>, <a class="el" href="a06421.html#l00148">_PrimaryBuffer</a>, <a class="el" href="a06421.html#l00161">_TimerID</a>, <a class="el" href="a06421.html#l00164">_TimerResolution</a>, and <a class="el" href="a05622.html#l00101">nldebug</a>.
<p>
<div class="fragment"><pre>00562 {
00563         <a class="code" href="a04199.html#a0">nldebug</a>(<span class="stringliteral">"Destroying DirectSound driver"</span>);
00564 
00565     <span class="keywordflow">if</span> (<a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr6">_TimerID</a> != NULL)
00566     {
00567         timeKillEvent(_TimerID);
00568         timeEndPeriod(_TimerResolution); 
00569     }
00570 
00571 
00572         <span class="comment">// Assure that the remaining sources have released all their DSBuffers </span>
00573         <span class="comment">// before closing down DirectSound</span>
00574         set&lt;CSourceDSound*&gt;::iterator iter;
00575 
00576         <span class="keywordflow">for</span> (iter = <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr4">_Sources</a>.begin(); iter != <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr4">_Sources</a>.end(); iter++)
00577         {
00578                 (*iter)-&gt;release();
00579         }
00580 
00581 
00582         <span class="comment">// Assure that the listener has released all resources before closing </span>
00583         <span class="comment">// down DirectSound</span>
00584         <span class="keywordflow">if</span> (CListenerDSound::instance() != 0)
00585         {
00586                 CListenerDSound::instance()-&gt;release();
00587         }
00588 
00589 
00590     <span class="keywordflow">if</span> (<a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr2">_PrimaryBuffer</a> != NULL) 
00591     {
00592         <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr2">_PrimaryBuffer</a>-&gt;Release(); 
00593         <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr2">_PrimaryBuffer</a> = NULL;
00594     }
00595 
00596     <span class="keywordflow">if</span> (<a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr1">_DirectSound</a> != NULL) 
00597     {
00598         <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr1">_DirectSound</a>-&gt;Release(); 
00599         <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr1">_DirectSound</a> = NULL;
00600     }
00601 
00602         <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundv0">_Instance</a> = 0;
00603 
00604         <span class="comment">// free the enumerated list</span>
00605         <span class="keywordflow">if</span> (CDeviceDescription::_List)
00606         {
00607                 <span class="keyword">delete</span> CDeviceDescription::_List;
00608                 CDeviceDescription::_List = NULL;
00609         }
00610 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSoundd0" doxytag="NLSOUND::CSoundDriverDSound::CBufferDSound::~CBufferDSound" ></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" nowrap valign="top"> NLSOUND::CSoundDriverDSound::CBufferDSound::~<a class="el" href="a02299.html">CBufferDSound</a> </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><code> [private]</code></td>
        </tr>

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

<p>
    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSoundd1" doxytag="NLSOUND::CSoundDriverDSound::CSourceDSound::~CSourceDSound" ></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" nowrap valign="top"> NLSOUND::CSoundDriverDSound::CSourceDSound::~<a class="el" href="a03430.html">CSourceDSound</a> </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><code> [private]</code></td>
        </tr>

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

<p>
    </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSounda0" doxytag="NLSOUND::CSoundDriverDSound::commit3DChanges" ></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" nowrap valign="top"> void NLSOUND::CSoundDriverDSound::commit3DChanges </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><code> [virtual]</code></td>
        </tr>

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

<p>
Commit all the changes made to 3D settings of listener and sources. 
<p>

<p>
Implements <a class="el" href="a03419.html#NLSOUND_1_1ISoundDrivera0">NLSOUND::ISoundDriver</a>.
<p>
Definition at line <a class="el" href="a06420.html#l00886">886</a> of file <a class="el" href="a06420.html">sound_driver_dsound.cpp</a>.
<p>
References <a class="el" href="a05919.html#l00322">NLSOUND::CListenerDSound::commit3DChanges()</a>, and <a class="el" href="a05919.html#l00125">NLSOUND::CListenerDSound::getPos()</a>.
<p>
<div class="fragment"><pre>00887 {
00888         CListenerDSound* listener = CListenerDSound::instance();
00889         listener-&gt;commit3DChanges();
00890 
00891 
00892         <span class="keyword">const</span> CVector &amp;origin = listener-&gt;getPos();
00893 
00894         set&lt;CSourceDSound*&gt;::iterator iter;
00895 
00896         <span class="comment">// We handle the volume of the source according to the distance</span>
00897         <span class="comment">// ourselves. Call updateVolume() to, well..., update the volume</span>
00898         <span class="comment">// according to, euh ..., the new distance!</span>
00899         <span class="keywordflow">for</span> (iter = <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr4">_Sources</a>.begin(); iter != <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr4">_Sources</a>.end(); iter++)
00900         {
00901                 <span class="keywordflow">if</span> ((*iter)-&gt;isPlaying()) 
00902                 {
00903                         (*iter)-&gt;updateVolume(origin);
00904                 }
00905         }
00906 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSounda1" doxytag="NLSOUND::CSoundDriverDSound::countHw2DBuffers" ></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" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> NLSOUND::CSoundDriverDSound::countHw2DBuffers </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></td>
        </tr>

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

<p>
Count the number of available hardware streaming 2D buffers. 
<p>

<p>
Definition at line <a class="el" href="a06420.html#l00779">779</a> of file <a class="el" href="a06420.html">sound_driver_dsound.cpp</a>.
<p>
References <a class="el" href="a06421.html#l00145">_DirectSound</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a06420.html#l00613">countMaxSources()</a>, <a class="el" href="a06429.html#l00218">NLSOUND::CSourceDSound::init()</a>, and <a class="el" href="a06420.html#l00318">init()</a>.
<p>
<div class="fragment"><pre>00780 {
00781     DSCAPS caps;
00782     caps.dwSize = <span class="keyword">sizeof</span>(caps); 
00783 
00784     <span class="keywordflow">if</span> (<a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr1">_DirectSound</a>-&gt;GetCaps(&amp;caps) != DS_OK)  
00785     {
00786         <span class="keywordflow">throw</span> ESoundDriver(<span class="stringliteral">"Failed to query the sound device caps"</span>);
00787     }
00788 
00789     <span class="keywordflow">return</span> caps.dwFreeHwMixingStreamingBuffers;
00790 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSounda2" doxytag="NLSOUND::CSoundDriverDSound::countHw3DBuffers" ></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" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> NLSOUND::CSoundDriverDSound::countHw3DBuffers </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></td>
        </tr>

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

<p>
Count the number of available hardware streaming 3D buffers. 
<p>

<p>
Definition at line <a class="el" href="a06420.html#l00764">764</a> of file <a class="el" href="a06420.html">sound_driver_dsound.cpp</a>.
<p>
References <a class="el" href="a06421.html#l00145">_DirectSound</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a06420.html#l00613">countMaxSources()</a>, <a class="el" href="a06429.html#l00218">NLSOUND::CSourceDSound::init()</a>, and <a class="el" href="a06420.html#l00318">init()</a>.
<p>
<div class="fragment"><pre>00765 {
00766     DSCAPS caps;
00767     caps.dwSize = <span class="keyword">sizeof</span>(caps); 
00768 
00769     <span class="keywordflow">if</span> (<a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr1">_DirectSound</a>-&gt;GetCaps(&amp;caps) != DS_OK)  
00770     {
00771         <span class="keywordflow">throw</span> ESoundDriver(<span class="stringliteral">"Failed to query the sound device caps"</span>);
00772     }
00773 
00774     <span class="keywordflow">return</span> caps.dwFreeHw3DStreamingBuffers;
00775 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSounda3" doxytag="NLSOUND::CSoundDriverDSound::countMaxSources" ></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" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> NLSOUND::CSoundDriverDSound::countMaxSources </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><code> [virtual]</code></td>
        </tr>

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

<p>
Return the maximum number of sources that can created. 
<p>

<p>
Implements <a class="el" href="a03419.html#NLSOUND_1_1ISoundDrivera1">NLSOUND::ISoundDriver</a>.
<p>
Definition at line <a class="el" href="a06420.html#l00613">613</a> of file <a class="el" href="a06420.html">sound_driver_dsound.cpp</a>.
<p>
References <a class="el" href="a06420.html#l00779">countHw2DBuffers()</a>, <a class="el" href="a06420.html#l00764">countHw3DBuffers()</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
<div class="fragment"><pre>00614 {
00615         <span class="comment">// Try the hardware 3d buffers first</span>
00616         <a class="code" href="a04558.html#a15">uint</a> n = <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSounda2">countHw3DBuffers</a>();
00617         <span class="keywordflow">if</span> (n &gt; 0) 
00618         {
00619                 <span class="keywordflow">return</span> n;
00620         }
00621 
00622         <span class="comment">// If not, try the hardware 2d buffers first</span>
00623         n = <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSounda1">countHw2DBuffers</a>();
00624         <span class="keywordflow">if</span> (n &gt; 0)
00625         {
00626                 <span class="keywordflow">return</span> n;
00627         }
00628 
00629         <span class="comment">// Okay, we'll use 32 software buffers</span>
00630         <span class="keywordflow">return</span> 32;
00631 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSounda4" doxytag="NLSOUND::CSoundDriverDSound::countPlayingSources" ></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" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> NLSOUND::CSoundDriverDSound::countPlayingSources </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></td>
        </tr>

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

<p>
Count the number of sources that are actually playing. 
<p>

<p>
Definition at line <a class="el" href="a06420.html#l00911">911</a> of file <a class="el" href="a06420.html">sound_driver_dsound.cpp</a>.
<p>
References <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a06420.html#l00635">writeProfile()</a>.
<p>
<div class="fragment"><pre>00912 {
00913     <a class="code" href="a04558.html#a15">uint</a> n = 0;
00914         set&lt;CSourceDSound*&gt;::iterator iter;
00915 
00916         <span class="keywordflow">for</span> (iter = <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr4">_Sources</a>.begin(); iter != <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr4">_Sources</a>.end(); iter++)
00917         {
00918                 <span class="keywordflow">if</span> ((*iter)-&gt;isPlaying()) 
00919                 {
00920                         n++;
00921                 }
00922         }
00923 
00924     <span class="keywordflow">return</span> n;
00925 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSounda5" doxytag="NLSOUND::CSoundDriverDSound::createBuffer" ></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" nowrap valign="top"> <a class="el" href="a02298.html">IBuffer</a> * NLSOUND::CSoundDriverDSound::createBuffer </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><code> [virtual]</code></td>
        </tr>

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

<p>
Create a sound buffer. 
<p>

<p>
Implements <a class="el" href="a03419.html#NLSOUND_1_1ISoundDrivera2">NLSOUND::ISoundDriver</a>.
<p>
Definition at line <a class="el" href="a06420.html#l00820">820</a> of file <a class="el" href="a06420.html">sound_driver_dsound.cpp</a>.
<p>
References <a class="el" href="a06421.html#l00148">_PrimaryBuffer</a>.
<p>
<div class="fragment"><pre>00821 {
00822         NL_ALLOC_CONTEXT(NLSOUND_CSoundDriverDSound);
00823     <span class="keywordflow">if</span> (<a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr2">_PrimaryBuffer</a> == 0) 
00824     {
00825         <span class="keywordflow">throw</span> ESoundDriver(<span class="stringliteral">"Corrupt driver"</span>);
00826     }
00827 
00828 
00829     <span class="comment">// FIXME: set buffer ID</span>
00830     <span class="keywordflow">return</span> <span class="keyword">new</span> CBufferDSound();
00831 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1ISoundDrivere0" doxytag="NLSOUND::CSoundDriverDSound::createDriver" ></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" nowrap valign="top"> <a class="el" href="a03419.html">ISoundDriver</a> * NLSOUND::ISoundDriver::createDriver </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">bool&nbsp;</td>
          <td class="mdname" nowrap> <em>useEax</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a03878.html">IStringMapperProvider</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>stringMapper</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [static, inherited]</code></td>
        </tr>

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

<p>
The static method which builds the sound driver instance In case of failure, can throw one of these <a class="el" href="a03814.html">ESoundDriver</a> exception objects: <a class="el" href="a03819.html">ESoundDriverNotFound</a>, <a class="el" href="a03816.html">ESoundDriverCorrupted</a>, <a class="el" href="a03821.html">ESoundDriverOldVersion</a>, <a class="el" href="a03822.html">ESoundDriverUnknownVersion</a><p>
You can request support for EAX. If EAX is requested and if there is enougth hardware buffer replay, then only hardware buffer are created when calling createBuffer. If the number of available hardware buffer is less than 10, then EAX is ignored.
<p>
Definition at line <a class="el" href="a06416.html#l00061">61</a> of file <a class="el" href="a06416.html">sound_driver.cpp</a>.
<p>
References <a class="el" href="a05646.html#l00649">buffer</a>, <a class="el" href="a06416.html#l00050">NLSOUND::ISDRV_CREATE_PROC</a>, <a class="el" href="a06416.html#l00053">NLSOUND::ISDRV_VERSION_PROC</a>, <a class="el" href="a05622.html#l00111">nlinfo</a>, and <a class="el" href="a05622.html#l00135">nlwarning</a>.
<p>
<div class="fragment"><pre>00062 {
00063         <a class="code" href="a05381.html#a13">ISDRV_CREATE_PROC</a>       createSoundDriver = NULL;
00064         <a class="code" href="a05381.html#a15">ISDRV_VERSION_PROC</a>      versionDriver = NULL;
00065 
00066 <span class="preprocessor">#ifdef NL_OS_WINDOWS</span>
00067 <span class="preprocessor"></span>
00068         <span class="comment">// WINDOWS code.</span>
00069         HINSTANCE                       hInst;
00070 
00071         hInst = LoadLibrary(NLSOUND_DLL_NAME);
00072 
00073         <span class="keywordflow">if</span> (!hInst)
00074         {
00075                 <span class="keywordflow">throw</span> ESoundDriverNotFound();
00076         }
00077 
00078         <span class="keywordtype">char</span> <a class="code" href="a04223.html#a589">buffer</a>[1024], *ptr;
00079         SearchPath (NULL, NLSOUND_DLL_NAME, NULL, 1023, buffer, &amp;ptr);
00080         <a class="code" href="a04199.html#a1">nlinfo</a> (<span class="stringliteral">"Using the library '"</span>NLSOUND_DLL_NAME<span class="stringliteral">"' that is in the directory: '%s'"</span>, buffer);
00081 
00082         createSoundDriver = (<a class="code" href="a05381.html#a13">ISDRV_CREATE_PROC</a>) GetProcAddress (hInst, IDRV_CREATE_PROC_NAME);
00083         <span class="keywordflow">if</span> (createSoundDriver == NULL)
00084         {
00085                 <a class="code" href="a04199.html#a1">nlinfo</a>( <span class="stringliteral">"Error: %u"</span>, GetLastError() );
00086                 <span class="keywordflow">throw</span> ESoundDriverCorrupted();
00087         }
00088 
00089         versionDriver = (<a class="code" href="a05381.html#a15">ISDRV_VERSION_PROC</a>) GetProcAddress (hInst, IDRV_VERSION_PROC_NAME);
00090         <span class="keywordflow">if</span> (versionDriver != NULL)
00091         {
00092                 <span class="keywordflow">if</span> (versionDriver()&lt;ISoundDriver::InterfaceVersion)
00093                         <span class="keywordflow">throw</span> ESoundDriverOldVersion();
00094                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (versionDriver()&gt;ISoundDriver::InterfaceVersion)
00095                         <span class="keywordflow">throw</span> ESoundDriverUnknownVersion();
00096         }
00097 
00098 <span class="preprocessor">#elif defined (NL_OS_UNIX)</span>
00099 <span class="preprocessor"></span>
00100         <span class="comment">// Unix code</span>
00101         <span class="keywordtype">void</span> *handle = dlopen(NLSOUND_DLL_NAME, RTLD_NOW);
00102 
00103         <span class="keywordflow">if</span> (handle == NULL)
00104         {
00105                 <a class="code" href="a04199.html#a2">nlwarning</a> (<span class="stringliteral">"when loading dynamic library '%s': %s"</span>, NLSOUND_DLL_NAME, dlerror());
00106                 <span class="keywordflow">throw</span> ESoundDriverNotFound();
00107         }
00108 
00109         <span class="comment">/* Not ANSI. Might produce a warning */</span>
00110         createSoundDriver = (<a class="code" href="a05381.html#a13">ISDRV_CREATE_PROC</a>) dlsym (handle, IDRV_CREATE_PROC_NAME);
00111         <span class="keywordflow">if</span> (createSoundDriver == NULL)
00112         {
00113                 <a class="code" href="a04199.html#a2">nlwarning</a> (<span class="stringliteral">"when getting function in dynamic library '%s': %s"</span>, NLSOUND_DLL_NAME, dlerror());
00114                 <span class="keywordflow">throw</span> ESoundDriverCorrupted();
00115         }
00116 
00117         versionDriver = (<a class="code" href="a05381.html#a15">ISDRV_VERSION_PROC</a>) dlsym (handle, IDRV_VERSION_PROC_NAME);
00118         <span class="keywordflow">if</span> (versionDriver != NULL)
00119         {
00120                 <span class="keywordflow">if</span> (versionDriver()&lt;ISoundDriver::InterfaceVersion)
00121                         <span class="keywordflow">throw</span> ESoundDriverOldVersion();
00122                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (versionDriver()&gt;ISoundDriver::InterfaceVersion)
00123                         <span class="keywordflow">throw</span> ESoundDriverUnknownVersion();
00124         }
00125 
00126 <span class="preprocessor">#else // NL_OS_UNIX</span>
00127 <span class="preprocessor"></span><span class="preprocessor">#error "Dynamic DLL loading not implemented!"</span>
00128 <span class="preprocessor"></span><span class="preprocessor">#endif // NL_OS_UNIX</span>
00129 <span class="preprocessor"></span>
00130         <a class="code" href="a03419.html#NLSOUND_1_1ISoundDriverb0">ISoundDriver</a> *ret = createSoundDriver(useEax, stringMapper);
00131         <span class="keywordflow">if</span> ( ret == NULL )
00132         {
00133                 <span class="keywordflow">throw</span> ESoundDriverCantCreateDriver();
00134         }
00135         <span class="keywordflow">return</span> ret;
00136 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSounda6" doxytag="NLSOUND::CSoundDriverDSound::createListener" ></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" nowrap valign="top"> <a class="el" href="a03861.html">IListener</a> * NLSOUND::CSoundDriverDSound::createListener </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><code> [virtual]</code></td>
        </tr>

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

<p>
Create the listener instance. 
<p>

<p>
Implements <a class="el" href="a03419.html#NLSOUND_1_1ISoundDrivera3">NLSOUND::ISoundDriver</a>.
<p>
Definition at line <a class="el" href="a06420.html#l00794">794</a> of file <a class="el" href="a06420.html">sound_driver_dsound.cpp</a>.
<p>
References <a class="el" href="a06421.html#l00148">_PrimaryBuffer</a>, and <a class="el" href="a05622.html#l00135">nlwarning</a>.
<p>
<div class="fragment"><pre>00795 {
00796         NL_ALLOC_CONTEXT(NLSOUND_CSoundDriverDSound);
00797     LPDIRECTSOUND3DLISTENER8 dsoundListener;
00798 
00799     <span class="keywordflow">if</span> (CListenerDSound::instance() != NULL) 
00800     {
00801         <span class="keywordflow">return</span> CListenerDSound::instance();
00802     }
00803 
00804     <span class="keywordflow">if</span> (<a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr2">_PrimaryBuffer</a> == 0) 
00805     {
00806         <span class="keywordflow">throw</span> ESoundDriver(<span class="stringliteral">"Corrupt driver"</span>);
00807     }
00808 
00809     <span class="keywordflow">if</span> (FAILED(<a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr2">_PrimaryBuffer</a>-&gt;QueryInterface(IID_IDirectSound3DListener, (LPVOID *) &amp;dsoundListener)))
00810     {
00811                 <a class="code" href="a04199.html#a2">nlwarning</a>(<span class="stringliteral">"The 3D listener interface is not available."</span>);
00812         <span class="keywordflow">return</span> <span class="keyword">new</span> CListenerDSound(NULL);
00813     }
00814 
00815     <span class="keywordflow">return</span> <span class="keyword">new</span> CListenerDSound(dsoundListener);
00816 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSounda7" doxytag="NLSOUND::CSoundDriverDSound::createSource" ></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" nowrap valign="top"> <a class="el" href="a03428.html">ISource</a> * NLSOUND::CSoundDriverDSound::createSource </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><code> [virtual]</code></td>
        </tr>

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

<p>
Create a source. 
<p>

<p>
Implements <a class="el" href="a03419.html#NLSOUND_1_1ISoundDrivera4">NLSOUND::ISoundDriver</a>.
<p>
Definition at line <a class="el" href="a06420.html#l00860">860</a> of file <a class="el" href="a06420.html">sound_driver_dsound.cpp</a>.
<p>
References <a class="el" href="a06421.html#l00145">_DirectSound</a>, <a class="el" href="a06421.html#l00148">_PrimaryBuffer</a>, <a class="el" href="a06421.html#l00167">_UseEAX</a>, and <a class="el" href="a05646.html#l01124">src</a>.
<p>
<div class="fragment"><pre>00861 {
00862         NL_ALLOC_CONTEXT(NLSOUND_CSoundDriverDSound);
00863     <span class="keywordflow">if</span> (<a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr2">_PrimaryBuffer</a> == 0) 
00864     {
00865         <span class="keywordflow">throw</span> ESoundDriver(<span class="stringliteral">"Corrupt driver"</span>);
00866     }
00867 
00868 
00869         CSourceDSound* <a class="code" href="a04223.html#a652">src</a> = <span class="keyword">new</span> CSourceDSound(0);
00870         <a class="code" href="a04223.html#a652">src</a>-&gt;init(_DirectSound, _UseEAX);
00871         <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr4">_Sources</a>.insert(src);
00872 
00873         <span class="keywordflow">return</span> <a class="code" href="a04223.html#a652">src</a>;
00874 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSoundd2" doxytag="NLSOUND::CSoundDriverDSound::displayBench" ></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" nowrap valign="top"> void NLSOUND::CSoundDriverDSound::displayBench </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a02813.html">NLMISC::CLog</a> *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>log</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [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="a03419.html#NLSOUND_1_1ISoundDrivera5">NLSOUND::ISoundDriver</a>.
<p>
Definition at line <a class="el" href="a06420.html#l01064">1064</a> of file <a class="el" href="a06420.html">sound_driver_dsound.cpp</a>.
<p>
References <a class="el" href="a05787.html#l00288">NLMISC::CHTimer::display()</a>, <a class="el" href="a05787.html#l00375">NLMISC::CHTimer::displayByExecutionPath()</a>, <a class="el" href="a05787.html#l00472">NLMISC::CHTimer::displayHierarchical()</a>, and <a class="el" href="a05787.html#l00556">NLMISC::CHTimer::displayHierarchicalByExecutionPathSorted()</a>.
<p>
<div class="fragment"><pre>01065 {
01066                 <a class="code" href="a02640.html#NLMISC_1_1CHTimere8">NLMISC::CHTimer::displayHierarchicalByExecutionPathSorted</a>(log, CHTimer::TotalTime, <span class="keyword">true</span>, 48, 2);
01067                 <a class="code" href="a02640.html#NLMISC_1_1CHTimere6">NLMISC::CHTimer::displayHierarchical</a>(log, <span class="keyword">true</span>, 48, 2);
01068                 <a class="code" href="a02640.html#NLMISC_1_1CHTimere5">NLMISC::CHTimer::displayByExecutionPath</a>(log, CHTimer::TotalTime);
01069                 <a class="code" href="a02640.html#NLMISC_1_1CHTimere4">NLMISC::CHTimer::display</a>(log, CHTimer::TotalTime);
01070 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSoundd3" doxytag="NLSOUND::CSoundDriverDSound::endBench" ></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" nowrap valign="top"> void NLSOUND::CSoundDriverDSound::endBench </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><code> [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="a03419.html#NLSOUND_1_1ISoundDrivera6">NLSOUND::ISoundDriver</a>.
<p>
Definition at line <a class="el" href="a06420.html#l01060">1060</a> of file <a class="el" href="a06420.html">sound_driver_dsound.cpp</a>.
<p>
References <a class="el" href="a05787.html#l00271">NLMISC::CHTimer::endBench()</a>.
<p>
<div class="fragment"><pre>01061 {
01062         <a class="code" href="a02640.html#NLMISC_1_1CHTimere10">NLMISC::CHTimer::endBench</a>();
01063 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSounda9" doxytag="NLSOUND::CSoundDriverDSound::getGain" ></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" nowrap valign="top"> float NLSOUND::CSoundDriverDSound::getGain </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></td>
        </tr>

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

<p>
Get the gain. 
<p>

<p>
Definition at line <a class="el" href="a06420.html#l00962">962</a> of file <a class="el" href="a06420.html">sound_driver_dsound.cpp</a>.
<p>
References <a class="el" href="a06421.html#l00148">_PrimaryBuffer</a>, and <a class="el" href="a05622.html#l00101">nldebug</a>.
<p>
<div class="fragment"><pre>00963 {
00964         <span class="keywordflow">if</span> (<a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr2">_PrimaryBuffer</a> != 0)
00965         {
00966                 <span class="comment">/* convert from hundredths of decibels to linear amplitude */</span>
00967                 LONG volume;
00968                 HRESULT hr = <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr2">_PrimaryBuffer</a>-&gt;GetVolume(&amp;volume);
00969 
00970                 <span class="keywordflow">if</span> (hr != DS_OK)
00971                 {
00972                         <a class="code" href="a04199.html#a0">nldebug</a>(<span class="stringliteral">"Failed to get the volume"</span>);
00973                         <span class="keywordflow">return</span> 1.0;
00974                 }
00975 
00976                 <span class="keywordflow">return</span> (<span class="keywordtype">float</span>) pow(10, (<span class="keywordtype">double</span>) volume / 20.0 / 100.0);
00977         }
00978 
00979         <span class="keywordflow">return</span> 1.0;
00980 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSounda10" doxytag="NLSOUND::CSoundDriverDSound::getStringMapper" ></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" nowrap valign="top"> IStringMapperProvider* NLSOUND::CSoundDriverDSound::getStringMapper </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><code> [inline]</code></td>
        </tr>

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

<p>
Return the string mapper. 
<p>

<p>
Definition at line <a class="el" href="a06421.html#l00112">112</a> of file <a class="el" href="a06421.html">sound_driver_dsound.h</a>.
<p>
References <a class="el" href="a06421.html#l00169">_StringMapper</a>.
<p>
<div class="fragment"><pre>00112 {<span class="keywordflow">return</span> <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr5">_StringMapper</a>;}
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSounda11" doxytag="NLSOUND::CSoundDriverDSound::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" nowrap valign="top"> bool NLSOUND::CSoundDriverDSound::init </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">HWND&nbsp;</td>
          <td class="mdname" nowrap> <em>wnd</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>bool&nbsp;</td>
          <td class="mdname" nowrap> <em>useEax</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>IStringMapperProvider *&nbsp;</td>
          <td class="mdname" nowrap> <em>stringMapper</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [virtual]</code></td>
        </tr>

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

<p>
Initialization. 
<p>

<p>
Definition at line <a class="el" href="a06420.html#l00318">318</a> of file <a class="el" href="a06420.html">sound_driver_dsound.cpp</a>.
<p>
References <a class="el" href="a06421.html#l00151">_Caps</a>, <a class="el" href="a06421.html#l00145">_DirectSound</a>, <a class="el" href="a06421.html#l00148">_PrimaryBuffer</a>, <a class="el" href="a06421.html#l00169">_StringMapper</a>, <a class="el" href="a06421.html#l00161">_TimerID</a>, <a class="el" href="a06420.html#l00053">_TimerPeriod</a>, <a class="el" href="a06421.html#l00164">_TimerResolution</a>, <a class="el" href="a06421.html#l00167">_UseEAX</a>, <a class="el" href="a06420.html#l00779">countHw2DBuffers()</a>, <a class="el" href="a06420.html#l00764">countHw3DBuffers()</a>, <a class="el" href="a06420.html#l00309">NLSOUND::CSoundDriverDSoundEnumCallback()</a>, <a class="el" href="a05646.html#l01016">format</a>, <a class="el" href="a05622.html#l00101">nldebug</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, <a class="el" href="a05646.html#l01119">res</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>00319 {
00320         <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr5">_StringMapper</a> = stringMapper;
00321     <span class="keywordflow">if</span> (FAILED(DirectSoundEnumerate(CSoundDriverDSoundEnumCallback, <span class="keyword">this</span>)))
00322     {
00323         <span class="keywordflow">throw</span> ESoundDriver(<span class="stringliteral">"Failed to enumerate the DirectSound devices"</span>);
00324     }
00325 
00326     <span class="comment">// Create a DirectSound object and set the cooperative level.</span>
00327 
00328         <span class="keywordflow">if</span> (useEax)
00329         {
00330                 <span class="keywordflow">if</span> (EAXDirectSoundCreate8(NULL, &amp;_DirectSound, NULL) != DS_OK) 
00331                 {
00332                         <span class="keywordflow">throw</span> ESoundDriver(<span class="stringliteral">"Failed to create the DirectSound object from EAX proxy funtion"</span>);
00333                 }
00334         }
00335         <span class="keywordflow">else</span>
00336         {
00337                 <span class="keywordflow">if</span> (DirectSoundCreate8(NULL, &amp;_DirectSound, NULL) != DS_OK) 
00338                 {
00339                         <span class="keywordflow">throw</span> ESoundDriver(<span class="stringliteral">"Failed to create the DirectSound object"</span>);
00340                 }
00341         }
00342 
00343 
00344     <span class="keywordflow">if</span> (<a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr1">_DirectSound</a>-&gt;SetCooperativeLevel(wnd, DSSCL_PRIORITY) != DS_OK) 
00345     {
00346         <span class="keywordflow">throw</span> ESoundDriver(<span class="stringliteral">"Failed to set the cooperative level"</span>);
00347     }
00348 
00349 
00350     <span class="comment">// Analyse the capabilities of the sound driver/device</span>
00351 
00352     <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr0">_Caps</a>.dwSize = <span class="keyword">sizeof</span>(<a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr0">_Caps</a>); 
00353 
00354     <span class="keywordflow">if</span> (<a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr1">_DirectSound</a>-&gt;GetCaps(&amp;_Caps) != DS_OK)  
00355     {
00356         <span class="keywordflow">throw</span> ESoundDriver(<span class="stringliteral">"Failed to query the sound device caps"</span>);
00357     }
00358 
00359 
00360     <span class="comment">// Create primary buffer </span>
00361  
00362     DSBUFFERDESC desc;
00363 
00364     ZeroMemory(&amp;desc, <span class="keyword">sizeof</span>(DSBUFFERDESC));
00365     desc.dwSize = <span class="keyword">sizeof</span>(DSBUFFERDESC);
00366 
00367 
00368     <span class="comment">// First, try to allocate a 3D hardware buffer.</span>
00369     <span class="comment">// If we can't get a 3D hardware buffer, use a 2D hardware buffer.</span>
00370     <span class="comment">// As last option, use a 2D software buffer.</span>
00371 
00372         <span class="comment">// check if wa can honor eax request</span>
00373         <span class="keywordflow">if</span> (<a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSounda2">countHw3DBuffers</a>() &gt; 10)
00374         {
00375                 <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr8">_UseEAX</a> = useEax;
00376         }
00377         <span class="keywordflow">else</span>
00378         {
00379                 <span class="comment">// not enougth hardware buffer, can't use eax</span>
00380                 <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr8">_UseEAX</a> = <span class="keyword">false</span>;
00381         }
00382 
00383     <span class="keywordflow">if</span> (<a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSounda2">countHw3DBuffers</a>() &gt; 0) 
00384     {
00385                 <a class="code" href="a04199.html#a0">nldebug</a>(<span class="stringliteral">"Primary buffer: Allocating 3D buffer in hardware"</span>);
00386         desc.dwFlags = DSBCAPS_PRIMARYBUFFER | DSBCAPS_LOCHARDWARE | DSBCAPS_CTRL3D | DSBCAPS_CTRLVOLUME;
00387     } 
00388     <span class="keywordflow">else</span>
00389     {
00390                 <a class="code" href="a04199.html#a0">nldebug</a>(<span class="stringliteral">"Primary buffer: Allocating 3D buffer in software"</span>);
00391         desc.dwFlags = DSBCAPS_PRIMARYBUFFER | DSBCAPS_LOCSOFTWARE | DSBCAPS_CTRL3D | DSBCAPS_CTRLVOLUME;
00392 <span class="comment">//        desc.guid3DAlgorithm = DS3DALG_NO_VIRTUALIZATION;</span>
00393     }
00394         
00395 
00396 
00397         HRESULT <a class="code" href="a04223.html#a643">res</a> = <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr1">_DirectSound</a>-&gt;CreateSoundBuffer(&amp;desc, &amp;_PrimaryBuffer, NULL);
00398 
00399     <span class="keywordflow">if</span> (<a class="code" href="a04223.html#a643">res</a> != DS_OK &amp;&amp; <a class="code" href="a04223.html#a643">res</a> != DS_NO_VIRTUALIZATION)
00400     {
00401 
00402                 <a class="code" href="a04199.html#a2">nlwarning</a>(<span class="stringliteral">"Primary buffer: Failed to create a buffer with 3D capabilities."</span>);
00403 
00404                 ZeroMemory(&amp;desc, <span class="keyword">sizeof</span>(DSBUFFERDESC));
00405                 desc.dwSize = <span class="keyword">sizeof</span>(DSBUFFERDESC);
00406 
00407                 <span class="keywordflow">if</span> (<a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSounda1">countHw2DBuffers</a>() &gt; 0) 
00408                 {
00409                         <a class="code" href="a04199.html#a0">nldebug</a>(<span class="stringliteral">"Primary buffer: Allocating 2D buffer in hardware"</span>);
00410                         desc.dwFlags = DSBCAPS_PRIMARYBUFFER | DSBCAPS_LOCHARDWARE | DSBCAPS_CTRLVOLUME;
00411                 } 
00412                 <span class="keywordflow">else</span>
00413                 {
00414                         <a class="code" href="a04199.html#a0">nldebug</a>(<span class="stringliteral">"Primary buffer: Allocating 2D buffer in software"</span>);
00415                         desc.dwFlags = DSBCAPS_PRIMARYBUFFER | DSBCAPS_LOCSOFTWARE | DSBCAPS_CTRLVOLUME;
00416                 }
00417 
00418                 <span class="keywordflow">if</span> (<a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr1">_DirectSound</a>-&gt;CreateSoundBuffer(&amp;desc, &amp;_PrimaryBuffer, NULL) != DS_OK) 
00419                 {
00420                         <span class="keywordflow">throw</span> ESoundDriver(<span class="stringliteral">"Failed to create the primary buffer"</span>);
00421                 }
00422     }
00423 
00424 
00425     <span class="comment">// Set the format of the primary buffer</span>
00426 
00427     WAVEFORMATEX <a class="code" href="a04223.html#a641">format</a>;
00428 
00429     <a class="code" href="a04223.html#a641">format</a>.cbSize = <span class="keyword">sizeof</span>(WAVEFORMATEX);
00430 
00431     <span class="comment">// Make sure the sound card accepts the default settings.</span>
00432     <span class="comment">// For now, only the default settings are accepted. Fallback</span>
00433     <span class="comment">// strategy will be handled later.</span>
00434 
00435     <span class="keywordflow">if</span> ((<a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr0">_Caps</a>.dwMinSecondarySampleRate &gt; 22050) &amp;&amp; (22050 &gt; <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr0">_Caps</a>.dwMaxSecondarySampleRate)) {
00436         <span class="keywordflow">throw</span> ESoundDriver(<span class="stringliteral">"Unsupported sample rate range"</span>);        
00437     }   
00438 
00439     <span class="keywordflow">if</span> ((<a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr0">_Caps</a>.dwFlags &amp; DSCAPS_PRIMARY16BIT) == 0) {
00440         <span class="keywordflow">throw</span> ESoundDriver(<span class="stringliteral">"Unsupported sample size [16bits]"</span>);        
00441     }   
00442 
00443     <a class="code" href="a04223.html#a641">format</a>.wBitsPerSample = 16;
00444     <a class="code" href="a04223.html#a641">format</a>.nChannels = 1;
00445     <a class="code" href="a04223.html#a641">format</a>.nSamplesPerSec = 22050;
00446     <a class="code" href="a04223.html#a641">format</a>.nBlockAlign = <a class="code" href="a04223.html#a641">format</a>.nChannels * <a class="code" href="a04223.html#a641">format</a>.wBitsPerSample / 8;
00447     <a class="code" href="a04223.html#a641">format</a>.nAvgBytesPerSec = <a class="code" href="a04223.html#a641">format</a>.nSamplesPerSec * <a class="code" href="a04223.html#a641">format</a>.nBlockAlign;
00448     <a class="code" href="a04223.html#a641">format</a>.wFormatTag = WAVE_FORMAT_PCM;
00449 
00450 
00451     <span class="keywordflow">if</span> (<a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr2">_PrimaryBuffer</a>-&gt;SetFormat(&amp;format) != DS_OK) 
00452     {
00453         <span class="keywordflow">throw</span> ESoundDriver(<span class="stringliteral">"Failed to create set the format of the primary buffer"</span>);
00454     }
00455 
00456         <span class="comment">// Fill the buffer with silence</span>
00457 <span class="comment">/*      LPVOID ptr;</span>
00458 <span class="comment">        DWORD bytes;</span>
00459 <span class="comment"></span>
00460 <span class="comment">        HRESULT hr = _PrimaryBuffer-&gt;Lock(0, 0, &amp;ptr, &amp;bytes, NULL, NULL, DSBLOCK_ENTIREBUFFER);</span>
00461 <span class="comment">        if (FAILED(hr))</span>
00462 <span class="comment">        {</span>
00463 <span class="comment">                switch (hr)</span>
00464 <span class="comment">                {</span>
00465 <span class="comment">                case DSERR_BUFFERLOST:</span>
00466 <span class="comment">                        throw ESoundDriver("Failed to lock the DirectSound primary buffer : DSERR_BUFFERLOST");</span>
00467 <span class="comment">                case DSERR_INVALIDCALL:</span>
00468 <span class="comment">                        throw ESoundDriver("Failed to lock the DirectSound primary buffer : DSERR_INVALIDCALL");</span>
00469 <span class="comment">                case DSERR_INVALIDPARAM:</span>
00470 <span class="comment">                        throw ESoundDriver("Failed to lock the DirectSound primary buffer : DSERR_INVALIDPARAM");</span>
00471 <span class="comment">                case DSERR_PRIOLEVELNEEDED:</span>
00472 <span class="comment">                        throw ESoundDriver("Failed to lock the DirectSound primary buffer : DSERR_PRIOLEVELNEEDED");</span>
00473 <span class="comment">                default:</span>
00474 <span class="comment">                        throw ESoundDriver("Failed to lock the DirectSound primary buffer : unkown error");</span>
00475 <span class="comment">                </span>
00476 <span class="comment">                }</span>
00477 <span class="comment">        }</span>
00478 <span class="comment"></span>
00479 <span class="comment">        memset(ptr, 0, bytes);</span>
00480 <span class="comment">        </span>
00481 <span class="comment">        _PrimaryBuffer-&gt;Unlock(ptr, bytes, 0, 0);</span>
00482 <span class="comment">*/</span>
00483 
00484     <a class="code" href="a04558.html#a11">uint32</a> numBuffers = <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSounda2">countHw3DBuffers</a>();
00485         <span class="keywordflow">if</span> (numBuffers == 0)
00486         {
00487                 numBuffers = 31;
00488         }
00489 
00490         <span class="comment">/*</span>
00491 <span class="comment">    _Sources = new CSourceDSound*[numBuffers];</span>
00492 <span class="comment"></span>
00493 <span class="comment"></span>
00494 <span class="comment">        for (uint i = 0; i &lt; numBuffers; i++) </span>
00495 <span class="comment">        {</span>
00496 <span class="comment">                _Sources[i] = 0;</span>
00497 <span class="comment">        }</span>
00498 <span class="comment"></span>
00499 <span class="comment">        try</span>
00500 <span class="comment">        {</span>
00501 <span class="comment">            for (i = 0; i &lt; numBuffers; i++) </span>
00502 <span class="comment">                {</span>
00503 <span class="comment">                        _Sources[i] = new CSourceDSound(i);</span>
00504 <span class="comment">                        _Sources[i]-&gt;init(_DirectSound);</span>
00505 <span class="comment">                        _SourceCount++;</span>
00506 <span class="comment">                }</span>
00507 <span class="comment">        }</span>
00508 <span class="comment">        catch (ESoundDriver&amp; e)</span>
00509 <span class="comment">        {</span>
00510 <span class="comment">                // Okay, here's the situation: I'm listening to WinAmp while debugging.</span>
00511 <span class="comment">                // The caps told me there were 31 buffers available. In reality, there were</span>
00512 <span class="comment">                // only 30 available because WinAmp was using one. Somehow DirectSound didn't</span>
00513 <span class="comment">                // notice. So when creating buffer 31, an exception was thrown. </span>
00514 <span class="comment">                // If something like this happens, don't bother and go on with the buffers we've </span>
00515 <span class="comment">                // got. If no buffers are created at all, throw the exception again.</span>
00516 <span class="comment"></span>
00517 <span class="comment">                if (_Sources == 0)</span>
00518 <span class="comment">                {</span>
00519 <span class="comment">                        throw e;</span>
00520 <span class="comment">                }</span>
00521 <span class="comment">        }</span>
00522 <span class="comment"></span>
00523 <span class="comment">*/</span>
00524 
00525 
00526     TIMECAPS tcaps;
00527     
00528     timeGetDevCaps(&amp;tcaps, <span class="keyword">sizeof</span>(TIMECAPS));
00529     <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr7">_TimerResolution</a> = (tcaps.wPeriodMin &gt; 10)? tcaps.wPeriodMin : 10;
00530     timeBeginPeriod(_TimerResolution); 
00531 
00532 
00533 
00534 <span class="preprocessor">#if NLSOUND_PROFILE</span>
00535 <span class="preprocessor"></span>    <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> i = 0; i &lt; 1024; i++)
00536     {
00537         _TimerInterval[i] = 0;
00538     }
00539 
00540     _TimerDate = CTime::getPerformanceTime();
00541 <span class="preprocessor">#endif</span>
00542 <span class="preprocessor"></span>
00543 
00544 
00545 
00546     <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr6">_TimerID</a> = timeSetEvent(_TimerPeriod, 0, &amp;CSoundDriverDSound::TimerCallback, (DWORD)<span class="keyword">this</span>, TIME_CALLBACK_FUNCTION | TIME_PERIODIC);
00547 
00548     <span class="keywordflow">if</span> (<a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr6">_TimerID</a> == NULL)
00549     {
00550         <span class="keywordflow">throw</span> ESoundDriver(<span class="stringliteral">"Failed to create the timer"</span>);
00551     }
00552 
00553         
00554 
00555 
00556     <span class="keywordflow">return</span> <span class="keyword">true</span>;
00557 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSounde1" doxytag="NLSOUND::CSoundDriverDSound::instance" ></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" nowrap valign="top"> <a class="el" href="a03420.html">CSoundDriverDSound</a>* NLSOUND::CSoundDriverDSound::instance </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><code> [inline, static]</code></td>
        </tr>

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

<p>
Return the instance of the singleton. 
<p>

<p>
Definition at line <a class="el" href="a06421.html#l00055">55</a> of file <a class="el" href="a06421.html">sound_driver_dsound.h</a>.
<p>
<div class="fragment"><pre>00055 { <span class="keywordflow">return</span> <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundv0">_Instance</a>; }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSounda12" doxytag="NLSOUND::CSoundDriverDSound::readRawBuffer" ></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" nowrap valign="top"> bool NLSOUND::CSoundDriverDSound::readRawBuffer </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a02298.html">IBuffer</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>destbuffer</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>name</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a7">uint8</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>rawData</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>dataSize</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a05381.html#a80">TSampleFormat</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>format</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>frequency</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [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="a03419.html#NLSOUND_1_1ISoundDrivera7">NLSOUND::ISoundDriver</a>.
<p>
Definition at line <a class="el" href="a06420.html#l00852">852</a> of file <a class="el" href="a06420.html">sound_driver_dsound.cpp</a>.
<p>
References <a class="el" href="a05646.html#l01016">format</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05981.html#l00100">uint32</a>, and <a class="el" href="a05981.html#l00096">uint8</a>.
<p>
<div class="fragment"><pre>00853 {
00854         <span class="keywordflow">return</span> ((CBufferDSound*) destbuffer)-&gt;readRawBuffer(name, rawData, dataSize, format, frequency);
00855 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSounda13" doxytag="NLSOUND::CSoundDriverDSound::readWavBuffer" ></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" nowrap valign="top"> bool NLSOUND::CSoundDriverDSound::readWavBuffer </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a02298.html">IBuffer</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>destbuffer</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>name</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a7">uint8</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>wavData</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>dataSize</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [virtual]</code></td>
        </tr>

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

<p>
Load a wave file in to the buffer. 
<p>

<p>
Implements <a class="el" href="a03419.html#NLSOUND_1_1ISoundDrivera8">NLSOUND::ISoundDriver</a>.
<p>
Definition at line <a class="el" href="a06420.html#l00847">847</a> of file <a class="el" href="a06420.html">sound_driver_dsound.cpp</a>.
<p>
References <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00096">uint8</a>.
<p>
<div class="fragment"><pre>00848 {
00849         <span class="keywordflow">return</span> ((CBufferDSound*) destbuffer)-&gt;readWavBuffer(name, wavData, dataSize);
00850 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSoundd4" doxytag="NLSOUND::CSoundDriverDSound::removeBuffer" ></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" nowrap valign="top"> void NLSOUND::CSoundDriverDSound::removeBuffer </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a02298.html">IBuffer</a> *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>buffer</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [private, virtual]</code></td>
        </tr>

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

<p>
Remove a buffer (should be called by the friend destructor of the buffer class). 
<p>

<p>
Implements <a class="el" href="a03419.html#NLSOUND_1_1ISoundDriverb1">NLSOUND::ISoundDriver</a>.
<p>
Definition at line <a class="el" href="a06420.html#l00835">835</a> of file <a class="el" href="a06420.html">sound_driver_dsound.cpp</a>.
<p>
References <a class="el" href="a05646.html#l00649">buffer</a>.
<p>
<div class="fragment"><pre>00836 {
00837 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSoundd5" doxytag="NLSOUND::CSoundDriverDSound::removeSource" ></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" nowrap valign="top"> void NLSOUND::CSoundDriverDSound::removeSource </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a03428.html">ISource</a> *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>source</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [private, virtual]</code></td>
        </tr>

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

<p>
Remove a source (should be called by the friend destructor of the source class). 
<p>

<p>
Implements <a class="el" href="a03419.html#NLSOUND_1_1ISoundDriverb2">NLSOUND::ISoundDriver</a>.
<p>
Definition at line <a class="el" href="a06420.html#l00879">879</a> of file <a class="el" href="a06420.html">sound_driver_dsound.cpp</a>.
<p>
<div class="fragment"><pre>00880 {
00881         <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr4">_Sources</a>.erase((CSourceDSound*) source);
00882 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSounda14" doxytag="NLSOUND::CSoundDriverDSound::setGain" ></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" nowrap valign="top"> void NLSOUND::CSoundDriverDSound::setGain </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">float&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>gain</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

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

<p>
Set the gain (volume value inside [0 , 1]). (default: 1) 0.0 -&gt; silence 0.5 -&gt; -6dB 1.0 -&gt; no attenuation values &gt; 1 (amplification) not supported by most drivers
<p>
Definition at line <a class="el" href="a06420.html#l00930">930</a> of file <a class="el" href="a06420.html">sound_driver_dsound.cpp</a>.
<p>
References <a class="el" href="a06421.html#l00148">_PrimaryBuffer</a>, and <a class="el" href="a05622.html#l00101">nldebug</a>.
<p>
<div class="fragment"><pre>00931 {
00932         <span class="keywordflow">if</span> (<a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr2">_PrimaryBuffer</a> != 0)
00933         {
00934                 <span class="keywordflow">if</span> (gain &lt; 0.00001f)
00935                 {
00936                         gain = 0.00001f;
00937                 }
00938 
00939                 <span class="comment">/* convert from linear amplitude to hundredths of decibels */</span>
00940                 LONG volume = (LONG)(100.0 * 20.0 * log10(gain));
00941 
00942                 <span class="keywordflow">if</span> (volume &lt; DSBVOLUME_MIN) 
00943                 {
00944                         volume = DSBVOLUME_MIN;
00945                 }
00946                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (volume &gt; DSBVOLUME_MAX) 
00947                 {
00948                         volume = DSBVOLUME_MAX;
00949                 }
00950 
00951                 HRESULT hr = <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr2">_PrimaryBuffer</a>-&gt;SetVolume(volume);
00952 
00953                 <span class="keywordflow">if</span> (hr != DS_OK)
00954                 {
00955                         <a class="code" href="a04199.html#a0">nldebug</a>(<span class="stringliteral">"Failed to set the volume"</span>);
00956                 }
00957         }
00958 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSoundd6" doxytag="NLSOUND::CSoundDriverDSound::startBench" ></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" nowrap valign="top"> void NLSOUND::CSoundDriverDSound::startBench </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><code> [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="a03419.html#NLSOUND_1_1ISoundDrivera9">NLSOUND::ISoundDriver</a>.
<p>
Definition at line <a class="el" href="a06420.html#l01056">1056</a> of file <a class="el" href="a06420.html">sound_driver_dsound.cpp</a>.
<p>
References <a class="el" href="a05787.html#l00241">NLMISC::CHTimer::startBench()</a>.
<p>
<div class="fragment"><pre>01057 {
01058         <a class="code" href="a02640.html#NLMISC_1_1CHTimere11">NLMISC::CHTimer::startBench</a>();
01059 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSoundh0" doxytag="NLSOUND::CSoundDriverDSound::TimerCallback" ></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" nowrap valign="top"> void CALLBACK NLSOUND::CSoundDriverDSound::TimerCallback </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">UINT&nbsp;</td>
          <td class="mdname" nowrap> <em>uID</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>UINT&nbsp;</td>
          <td class="mdname" nowrap> <em>uMsg</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>DWORD&nbsp;</td>
          <td class="mdname" nowrap> <em>dwUser</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>DWORD&nbsp;</td>
          <td class="mdname" nowrap> <em>dw1</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>DWORD&nbsp;</td>
          <td class="mdname" nowrap> <em>dw2</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [static, private]</code></td>
        </tr>

      </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="a06420.html#l00679">679</a> of file <a class="el" href="a06420.html">sound_driver_dsound.cpp</a>.
<p>
References <a class="el" href="a06420.html#l00053">_TimerPeriod</a>, <a class="el" href="a06552.html#l00055">NLMISC::CTime::getLocalTime()</a>, <a class="el" href="a06553.html#l00047">NLMISC::TTime</a>, and <a class="el" href="a06420.html#l00703">update()</a>.
<p>
<div class="fragment"><pre>00680 {
00681         <span class="comment">// a little speed check</span>
00682         <span class="keyword">static</span> <a class="code" href="a05378.html#a242">NLMISC::TTime</a> lastUpdate = <a class="code" href="a02142.html#NLMISC_1_1CTimee0">NLMISC::CTime::getLocalTime</a>();
00683         <a class="code" href="a05378.html#a242">NLMISC::TTime</a> now = <a class="code" href="a02142.html#NLMISC_1_1CTimee0">NLMISC::CTime::getLocalTime</a>();
00684 
00685         <span class="keywordflow">if</span> (now - lastUpdate &gt; <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundv1">_TimerPeriod</a> * 2)
00686         {
00687 <span class="comment">//              nlwarning("CSoundDriverDSound::TimerCallback : no update since %u millisec (nominal update = %u", uint32(now-lastUpdate), uint32(_TimerPeriod));</span>
00688         }
00689         <span class="keywordflow">else</span>
00690         {
00691 <span class="comment">//              nldebug("Callback delay = %u ms", uint32(now-lastUpdate));</span>
00692         }
00693 
00694         lastUpdate = now;
00695 
00696 
00697     <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSounda8">CSoundDriverDSound</a>* driver = (<a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSounda8">CSoundDriverDSound</a>*) dwUser;
00698     driver-&gt;update();
00699 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSounda15" doxytag="NLSOUND::CSoundDriverDSound::update" ></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" nowrap valign="top"> void NLSOUND::CSoundDriverDSound::update </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></td>
        </tr>

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

<p>
Update all the driver and its sources. To be called only by the timer callback. 
<p>

<p>
Definition at line <a class="el" href="a06420.html#l00703">703</a> of file <a class="el" href="a06420.html">sound_driver_dsound.cpp</a>.
<p>
References <a class="el" href="a06420.html#l00053">_TimerPeriod</a>, <a class="el" href="a06552.html#l00055">NLMISC::CTime::getLocalTime()</a>, <a class="el" href="a05788.html#l00056">H_AUTO</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, <a class="el" href="a06553.html#l00048">NLMISC::TTicks</a>, <a class="el" href="a06553.html#l00047">NLMISC::TTime</a>, and <a class="el" href="a05981.html#l00100">uint32</a>.
<p>
Referenced by <a class="el" href="a06420.html#l00679">TimerCallback()</a>.
<p>
<div class="fragment"><pre>00704 {
00705         <a class="code" href="a04365.html#a4">H_AUTO</a>(NLSOUND_DSoundUpdate)
00706 #<span class="keywordflow">if</span> NLSOUND_PROFILE
00707     <a class="code" href="a05378.html#a243">TTicks</a> tnow = CTime::getPerformanceTime();
00708 <span class="preprocessor">#endif</span>
00709 <span class="preprocessor"></span>
00710         <a class="code" href="a05378.html#a242">NLMISC::TTime</a> now = <a class="code" href="a02142.html#NLMISC_1_1CTimee0">NLMISC::CTime::getLocalTime</a>();
00711 
00712         set&lt;CSourceDSound*&gt;::iterator first(<a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr4">_Sources</a>.begin()), last(<a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr4">_Sources</a>.end());
00713         <span class="keywordflow">for</span> (;first != last; ++first)
00714         {
00715                 <span class="keywordflow">if</span> ((*first)-&gt;needsUpdate())
00716                 {
00717                         <span class="keywordflow">if</span> ((*first)-&gt;update()) 
00718                         {
00719 <span class="preprocessor">#if NLSOUND_PROFILE</span>
00720 <span class="preprocessor"></span>                                _UpdateSources++;
00721 <span class="preprocessor">#endif</span>
00722 <span class="preprocessor"></span>                        }
00723                 }
00724         }
00725 
00726 <span class="comment">/*</span>
00727 <span class="comment">        set&lt;CSourceDSound*&gt;::iterator iter;</span>
00728 <span class="comment"></span>
00729 <span class="comment">        iter = _Sources.begin();</span>
00730 <span class="comment"></span>
00731 <span class="comment"></span>
00732 <span class="comment">        if ((iter != _Sources.end()) &amp;&amp; (*iter)-&gt;needsUpdate())</span>
00733 <span class="comment">        {</span>
00734 <span class="comment">                while (iter != _Sources.end())</span>
00735 <span class="comment">                {</span>
00736 <span class="comment">//                      if ((*iter)-&gt;update2()) {</span>
00737 <span class="comment">                        if ((*iter)-&gt;update()) </span>
00738 <span class="comment">                        {</span>
00739 <span class="comment">#if NLSOUND_PROFILE</span>
00740 <span class="comment">                                _UpdateSources++;</span>
00741 <span class="comment">#endif</span>
00742 <span class="comment">                        }</span>
00743 <span class="comment">                        iter++;</span>
00744 <span class="comment">                }</span>
00745 <span class="comment">        }</span>
00746 <span class="comment"></span>
00747 <span class="comment">*/</span>
00748         {
00749                 <a class="code" href="a05378.html#a242">NLMISC::TTime</a>   last = CTime::getLocalTime() - now;
00750                 <span class="keywordflow">if</span> (last &gt; <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundv1">_TimerPeriod</a> / 2)
00751                 {
00752                         <a class="code" href="a04199.html#a2">nlwarning</a>(<span class="stringliteral">"CSoundDriverDSound::TimerCallback : update took %u millisec"</span>, (<a class="code" href="a04558.html#a11">uint32</a>)last);
00753                 }
00754         }
00755 
00756 <span class="preprocessor">#if NLSOUND_PROFILE</span>
00757 <span class="preprocessor"></span>    _TotalUpdateTime += 1000.0 * CTime::ticksToSecond(CTime::getPerformanceTime() - tnow);
00758         _UpdateCount++;
00759 <span class="preprocessor">#endif</span>
00760 <span class="preprocessor"></span>}
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSounda16" doxytag="NLSOUND::CSoundDriverDSound::writeProfile" ></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" nowrap valign="top"> void NLSOUND::CSoundDriverDSound::writeProfile </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">std::ostream &amp;&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>out</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [virtual]</code></td>
        </tr>

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

<p>
Write information about the driver to the output stream. 
<p>

<p>
Implements <a class="el" href="a03419.html#NLSOUND_1_1ISoundDrivera10">NLSOUND::ISoundDriver</a>.
<p>
Definition at line <a class="el" href="a06420.html#l00635">635</a> of file <a class="el" href="a06420.html">sound_driver_dsound.cpp</a>.
<p>
References <a class="el" href="a06421.html#l00145">_DirectSound</a>, and <a class="el" href="a06420.html#l00911">countPlayingSources()</a>.
<p>
<div class="fragment"><pre>00636 {
00637     <span class="comment">// Write the available sound devices</span>
00638     CDeviceDescription* <a class="code" href="a03889.html">list</a> = CDeviceDescription::_List;
00639     <span class="keywordflow">while</span> (list) {
00640                 out &lt;&lt; list-&gt;_Description &lt;&lt; <span class="stringliteral">"\n"</span>;
00641         list = list-&gt;_Next;
00642     }
00643 
00644     out &lt;&lt; <span class="stringliteral">"\n"</span>;
00645 
00646     <span class="comment">// Write the buffers sizes</span>
00647     out &lt;&lt; <span class="stringliteral">"buffer size: "</span> &lt;&lt; (<span class="keywordtype">int</span>)CSourceDSound::_SecondaryBufferSize &lt;&lt; <span class="stringliteral">"\n"</span>;
00648     out &lt;&lt; <span class="stringliteral">"copy size: "</span> &lt;&lt; (<span class="keywordtype">int</span>)CSourceDSound::_UpdateCopySize &lt;&lt; <span class="stringliteral">"\n"</span>;
00649     out &lt;&lt; <span class="stringliteral">"swap size: "</span> &lt;&lt; (<span class="keywordtype">int</span>)CSourceDSound::_SwapCopySize &lt;&lt; <span class="stringliteral">"\n"</span>;
00650     out &lt;&lt; <span class="stringliteral">"\n"</span>;
00651 
00652     <span class="comment">// Write the number of hardware buffers </span>
00653     DSCAPS caps;
00654     caps.dwSize = <span class="keyword">sizeof</span>(caps); 
00655     <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr1">_DirectSound</a>-&gt;GetCaps(&amp;caps);  
00656 
00657     cout &lt;&lt; <span class="stringliteral">"3d hw buffers: "</span> &lt;&lt; caps.dwMaxHw3DAllBuffers &lt;&lt; <span class="stringliteral">"\n"</span>;
00658         cout &lt;&lt; <span class="stringliteral">"2d hw buffers: "</span> &lt;&lt; caps.dwMaxHwMixingAllBuffers &lt;&lt; <span class="stringliteral">"\n"</span>;
00659     out &lt;&lt; <span class="stringliteral">"\n"</span>;
00660 
00661     <span class="comment">// Write the number of hardware buffers </span>
00662 <span class="preprocessor">#if NLSOUND_PROFILE</span>
00663 <span class="preprocessor"></span>    out &lt;&lt; <span class="stringliteral">"update time total --- "</span> &lt;&lt;  getAverageUpdateTime()&lt;&lt; <span class="stringliteral">"\n"</span>;
00664         out &lt;&lt; <span class="stringliteral">"update time source --- "</span> &lt;&lt; CSourceDSound::getAverageUpdateTime() &lt;&lt; <span class="stringliteral">"\n"</span>;
00665         out &lt;&lt; <span class="stringliteral">"update --- t: "</span> &lt;&lt; CSourceDSound::getAverageCumulTime();
00666         out &lt;&lt; <span class="stringliteral">" - p: "</span> &lt;&lt; CSourceDSound::getAveragePosTime();
00667         out &lt;&lt; <span class="stringliteral">" - l: "</span> &lt;&lt; CSourceDSound::getAverageLockTime();
00668         out &lt;&lt; <span class="stringliteral">" - c: "</span> &lt;&lt; CSourceDSound::getAverageCopyTime();
00669         out &lt;&lt; <span class="stringliteral">" - u: "</span> &lt;&lt; CSourceDSound::getAverageUnlockTime() &lt;&lt; <span class="stringliteral">"\n"</span>;
00670         out &lt;&lt; <span class="stringliteral">"update percentage: --- "</span> &lt;&lt; getUpdatePercentage() &lt;&lt; <span class="stringliteral">"\n"</span>;
00671         out &lt;&lt; <span class="stringliteral">"update num sources --- "</span> &lt;&lt; (<span class="keywordtype">int</span>)getAverageUpdateSources() &lt;&lt; <span class="stringliteral">"\n"</span>;
00672         out &lt;&lt; <span class="stringliteral">"update byte size --- "</span> &lt;&lt; CSourceDSound::getAverageUpdateSize() &lt;&lt; <span class="stringliteral">"\n"</span>;
00673         out &lt;&lt; <span class="stringliteral">"swap time --- "</span> &lt;&lt; CSourceDSound::getTestAverage() &lt;&lt; <span class="stringliteral">"\n"</span>;
00674         out &lt;&lt; <span class="stringliteral">"src --- "</span> &lt;&lt; <a class="code" href="a03420.html#NLSOUND_1_1CSoundDriverDSounda4">countPlayingSources</a>() &lt;&lt; <span class="stringliteral">"\n"</span>;
00675 <span class="preprocessor">#endif</span>
00676 <span class="preprocessor"></span>}
</pre></div>    </td>
  </tr>
</table>
<hr><h2>Field Documentation</h2>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSoundr0" doxytag="NLSOUND::CSoundDriverDSound::_Caps" ></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" nowrap valign="top"> DSCAPS <a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr0">NLSOUND::CSoundDriverDSound::_Caps</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="a06421.html#l00151">151</a> of file <a class="el" href="a06421.html">sound_driver_dsound.h</a>.
<p>
Referenced by <a class="el" href="a06420.html#l00318">init()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSoundr1" doxytag="NLSOUND::CSoundDriverDSound::_DirectSound" ></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" nowrap valign="top"> LPDIRECTSOUND8 <a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr1">NLSOUND::CSoundDriverDSound::_DirectSound</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="a06421.html#l00145">145</a> of file <a class="el" href="a06421.html">sound_driver_dsound.h</a>.
<p>
Referenced by <a class="el" href="a06420.html#l00779">countHw2DBuffers()</a>, <a class="el" href="a06420.html#l00764">countHw3DBuffers()</a>, <a class="el" href="a06420.html#l00860">createSource()</a>, <a class="el" href="a06420.html#l00318">init()</a>, <a class="el" href="a06420.html#l00635">writeProfile()</a>, and <a class="el" href="a06420.html#l00561">~CSoundDriverDSound()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSoundv0" doxytag="NLSOUND::CSoundDriverDSound::_Instance" ></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" nowrap valign="top"> <a class="el" href="a03420.html">CSoundDriverDSound</a> * <a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundv0">NLSOUND::CSoundDriverDSound::_Instance</a> = NULL<code> [static, 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="a06420.html#l00052">52</a> of file <a class="el" href="a06420.html">sound_driver_dsound.cpp</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSoundr2" doxytag="NLSOUND::CSoundDriverDSound::_PrimaryBuffer" ></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" nowrap valign="top"> LPDIRECTSOUNDBUFFER <a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr2">NLSOUND::CSoundDriverDSound::_PrimaryBuffer</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="a06421.html#l00148">148</a> of file <a class="el" href="a06421.html">sound_driver_dsound.h</a>.
<p>
Referenced by <a class="el" href="a06420.html#l00820">createBuffer()</a>, <a class="el" href="a06420.html#l00794">createListener()</a>, <a class="el" href="a06420.html#l00860">createSource()</a>, <a class="el" href="a06420.html#l00962">getGain()</a>, <a class="el" href="a06420.html#l00318">init()</a>, <a class="el" href="a06420.html#l00930">setGain()</a>, and <a class="el" href="a06420.html#l00561">~CSoundDriverDSound()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSoundr3" doxytag="NLSOUND::CSoundDriverDSound::_SourceCount" ></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" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr3">NLSOUND::CSoundDriverDSound::_SourceCount</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="a06421.html#l00158">158</a> of file <a class="el" href="a06421.html">sound_driver_dsound.h</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSoundr4" doxytag="NLSOUND::CSoundDriverDSound::_Sources" ></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" nowrap valign="top"> std::set&lt;<a class="el" href="a03430.html">CSourceDSound</a>*&gt; <a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr4">NLSOUND::CSoundDriverDSound::_Sources</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="a06421.html#l00155">155</a> of file <a class="el" href="a06421.html">sound_driver_dsound.h</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSoundr5" doxytag="NLSOUND::CSoundDriverDSound::_StringMapper" ></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" nowrap valign="top"> IStringMapperProvider* <a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr5">NLSOUND::CSoundDriverDSound::_StringMapper</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The string mapper provided by client code. 
<p>

<p>
Definition at line <a class="el" href="a06421.html#l00169">169</a> of file <a class="el" href="a06421.html">sound_driver_dsound.h</a>.
<p>
Referenced by <a class="el" href="a06421.html#l00112">getStringMapper()</a>, and <a class="el" href="a06420.html#l00318">init()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSoundr6" doxytag="NLSOUND::CSoundDriverDSound::_TimerID" ></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" nowrap valign="top"> UINT <a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr6">NLSOUND::CSoundDriverDSound::_TimerID</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="a06421.html#l00161">161</a> of file <a class="el" href="a06421.html">sound_driver_dsound.h</a>.
<p>
Referenced by <a class="el" href="a06420.html#l00318">init()</a>, and <a class="el" href="a06420.html#l00561">~CSoundDriverDSound()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSoundv1" doxytag="NLSOUND::CSoundDriverDSound::_TimerPeriod" ></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" nowrap valign="top"> <a class="el" href="a04558.html#a11">uint32</a> <a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundv1">NLSOUND::CSoundDriverDSound::_TimerPeriod</a> = 100<code> [static, 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="a06420.html#l00053">53</a> of file <a class="el" href="a06420.html">sound_driver_dsound.cpp</a>.
<p>
Referenced by <a class="el" href="a06420.html#l00318">init()</a>, <a class="el" href="a06420.html#l00679">TimerCallback()</a>, and <a class="el" href="a06420.html#l00703">update()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSoundr7" doxytag="NLSOUND::CSoundDriverDSound::_TimerResolution" ></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" nowrap valign="top"> <a class="el" href="a04558.html#a11">uint32</a> <a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr7">NLSOUND::CSoundDriverDSound::_TimerResolution</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="a06421.html#l00164">164</a> of file <a class="el" href="a06421.html">sound_driver_dsound.h</a>.
<p>
Referenced by <a class="el" href="a06420.html#l00318">init()</a>, and <a class="el" href="a06420.html#l00561">~CSoundDriverDSound()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CSoundDriverDSoundr8" doxytag="NLSOUND::CSoundDriverDSound::_UseEAX" ></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" nowrap valign="top"> bool <a class="el" href="a03420.html#NLSOUND_1_1CSoundDriverDSoundr8">NLSOUND::CSoundDriverDSound::_UseEAX</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The EAX support is requested and accepted (ie, there is enougth hardware 3D buffer). 
<p>

<p>
Definition at line <a class="el" href="a06421.html#l00167">167</a> of file <a class="el" href="a06421.html">sound_driver_dsound.h</a>.
<p>
Referenced by <a class="el" href="a06420.html#l00860">createSource()</a>, and <a class="el" href="a06420.html#l00318">init()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1ISoundDrivers0" doxytag="NLSOUND::CSoundDriverDSound::InterfaceVersion" ></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" nowrap valign="top"> const <a class="el" href="a04558.html#a11">uint32</a> <a class="el" href="a03419.html#NLSOUND_1_1ISoundDrivers0">NLSOUND::ISoundDriver::InterfaceVersion</a> = 0x08<code> [static, inherited]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Version of the driver interface. To increment when the interface change. 
<p>

<p>
Definition at line <a class="el" href="a06416.html#l00048">48</a> of file <a class="el" href="a06416.html">sound_driver.cpp</a>.    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="a06421.html">sound_driver_dsound.h</a><li><a class="el" href="a06420.html">sound_driver_dsound.cpp</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 14:44:35 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>