author | rubidium |
Tue, 27 May 2008 21:41:00 +0000 | |
changeset 9390 | 88d36f907e96 |
parent 9111 | 48ce04029fe4 |
child 9632 | d5d9088b10d8 |
permissions | -rw-r--r-- |
2186 | 1 |
/* $Id$ */ |
2 |
||
9111
48ce04029fe4
(svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium
parents:
6247
diff
changeset
|
3 |
/** @file mixer.cpp Mixing of sound samples. */ |
6201
bee01dc45e39
(svn r8987) -Cleanup: doxygen changes. Again. Mostly (still) @files missing tags and (more than just) a few comments style.
belugas
parents:
5587
diff
changeset
|
4 |
|
1496
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
5 |
#include "stdafx.h" |
1891
862800791170
(svn r2397) - CodeChange: rename all "ttd" files to "openttd" files.
Darkvater
parents:
1498
diff
changeset
|
6 |
#include "openttd.h" |
1496
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
7 |
#include "mixer.h" |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
8 |
|
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
9 |
struct MixerChannel { |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
10 |
bool active; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
11 |
|
6201
bee01dc45e39
(svn r8987) -Cleanup: doxygen changes. Again. Mostly (still) @files missing tags and (more than just) a few comments style.
belugas
parents:
5587
diff
changeset
|
12 |
/* pointer to allocated buffer memory */ |
1496
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
13 |
int8 *memory; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
14 |
|
6201
bee01dc45e39
(svn r8987) -Cleanup: doxygen changes. Again. Mostly (still) @files missing tags and (more than just) a few comments style.
belugas
parents:
5587
diff
changeset
|
15 |
/* current position in memory */ |
1496
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
16 |
uint32 pos; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
17 |
uint32 frac_pos; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
18 |
uint32 frac_speed; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
19 |
uint32 samples_left; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
20 |
|
6201
bee01dc45e39
(svn r8987) -Cleanup: doxygen changes. Again. Mostly (still) @files missing tags and (more than just) a few comments style.
belugas
parents:
5587
diff
changeset
|
21 |
/* Mixing volume */ |
1496
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
22 |
uint volume_left; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
23 |
uint volume_right; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
24 |
|
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
25 |
uint flags; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
26 |
}; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
27 |
|
2977 | 28 |
static MixerChannel _channels[8]; |
29 |
static uint32 _play_rate; |
|
1496
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
30 |
|
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
31 |
|
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
32 |
static void mix_int8_to_int16(MixerChannel *sc, int16 *buffer, uint samples) |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
33 |
{ |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
34 |
int8 *b; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
35 |
uint32 frac_pos; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
36 |
uint32 frac_speed; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
37 |
uint volume_left; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
38 |
uint volume_right; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
39 |
|
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
40 |
if (samples > sc->samples_left) samples = sc->samples_left; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
41 |
sc->samples_left -= samples; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
42 |
assert(samples > 0); |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
43 |
|
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
44 |
b = sc->memory + sc->pos; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
45 |
frac_pos = sc->frac_pos; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
46 |
frac_speed = sc->frac_speed; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
47 |
volume_left = sc->volume_left; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
48 |
volume_right = sc->volume_right; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
49 |
|
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
50 |
if (frac_speed == 0x10000) { |
6201
bee01dc45e39
(svn r8987) -Cleanup: doxygen changes. Again. Mostly (still) @files missing tags and (more than just) a few comments style.
belugas
parents:
5587
diff
changeset
|
51 |
/* Special case when frac_speed is 0x10000 */ |
1496
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
52 |
do { |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
53 |
buffer[0] += *b * volume_left >> 8; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
54 |
buffer[1] += *b * volume_right >> 8; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
55 |
b++; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
56 |
buffer += 2; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
57 |
} while (--samples > 0); |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
58 |
} else { |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
59 |
do { |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
60 |
buffer[0] += *b * volume_left >> 8; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
61 |
buffer[1] += *b * volume_right >> 8; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
62 |
buffer += 2; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
63 |
frac_pos += frac_speed; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
64 |
b += frac_pos >> 16; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
65 |
frac_pos &= 0xffff; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
66 |
} while (--samples > 0); |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
67 |
} |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
68 |
|
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
69 |
sc->frac_pos = frac_pos; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
70 |
sc->pos = b - sc->memory; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
71 |
} |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
72 |
|
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
73 |
static void MxCloseChannel(MixerChannel *mc) |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
74 |
{ |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
75 |
if (mc->flags & MX_AUTOFREE) free(mc->memory); |
1497
4fc9f620d3e0
(svn r2001) Resolve a race condition which could lead to dropped a sound and a memory leak
tron
parents:
1496
diff
changeset
|
76 |
mc->active = false; |
1496
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
77 |
mc->memory = NULL; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
78 |
} |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
79 |
|
2977 | 80 |
void MxMixSamples(void *buffer, uint samples) |
1496
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
81 |
{ |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
82 |
MixerChannel *mc; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
83 |
|
6201
bee01dc45e39
(svn r8987) -Cleanup: doxygen changes. Again. Mostly (still) @files missing tags and (more than just) a few comments style.
belugas
parents:
5587
diff
changeset
|
84 |
/* Clear the buffer */ |
1496
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
85 |
memset(buffer, 0, sizeof(int16) * 2 * samples); |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
86 |
|
6201
bee01dc45e39
(svn r8987) -Cleanup: doxygen changes. Again. Mostly (still) @files missing tags and (more than just) a few comments style.
belugas
parents:
5587
diff
changeset
|
87 |
/* Mix each channel */ |
2977 | 88 |
for (mc = _channels; mc != endof(_channels); mc++) { |
1496
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
89 |
if (mc->active) { |
5587
167d9a91ef02
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5584
diff
changeset
|
90 |
mix_int8_to_int16(mc, (int16*)buffer, samples); |
1496
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
91 |
if (mc->samples_left == 0) MxCloseChannel(mc); |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
92 |
} |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
93 |
} |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
94 |
} |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
95 |
|
6247 | 96 |
MixerChannel *MxAllocateChannel() |
1496
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
97 |
{ |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
98 |
MixerChannel *mc; |
2977 | 99 |
for (mc = _channels; mc != endof(_channels); mc++) |
1496
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
100 |
if (mc->memory == NULL) { |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
101 |
mc->active = false; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
102 |
return mc; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
103 |
} |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
104 |
return NULL; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
105 |
} |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
106 |
|
9390
88d36f907e96
(svn r13301) -Fix [FS#1997]: resolve more MSVC 9 x64 warnings.
rubidium
parents:
9111
diff
changeset
|
107 |
void MxSetChannelRawSrc(MixerChannel *mc, int8 *mem, size_t size, uint rate, uint flags) |
1496
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
108 |
{ |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
109 |
mc->memory = mem; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
110 |
mc->flags = flags; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
111 |
mc->frac_pos = 0; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
112 |
mc->pos = 0; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
113 |
|
2977 | 114 |
mc->frac_speed = (rate << 16) / _play_rate; |
1496
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
115 |
|
6201
bee01dc45e39
(svn r8987) -Cleanup: doxygen changes. Again. Mostly (still) @files missing tags and (more than just) a few comments style.
belugas
parents:
5587
diff
changeset
|
116 |
/* adjust the magnitude to prevent overflow */ |
9390
88d36f907e96
(svn r13301) -Fix [FS#1997]: resolve more MSVC 9 x64 warnings.
rubidium
parents:
9111
diff
changeset
|
117 |
while (size & ~0xFFFF) { |
1496
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
118 |
size >>= 1; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
119 |
rate = (rate >> 1) + 1; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
120 |
} |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
121 |
|
9390
88d36f907e96
(svn r13301) -Fix [FS#1997]: resolve more MSVC 9 x64 warnings.
rubidium
parents:
9111
diff
changeset
|
122 |
mc->samples_left = (uint)size * _play_rate / rate; |
1496
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
123 |
} |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
124 |
|
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
125 |
void MxSetChannelVolume(MixerChannel *mc, uint left, uint right) |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
126 |
{ |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
127 |
mc->volume_left = left; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
128 |
mc->volume_right = right; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
129 |
} |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
130 |
|
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
131 |
|
1498
508395d0639a
(svn r2002) Rename MxActivate to MxActivateChannel, which is more appropriate
tron
parents:
1497
diff
changeset
|
132 |
void MxActivateChannel(MixerChannel* mc) |
1496
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
133 |
{ |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
134 |
mc->active = true; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
135 |
} |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
136 |
|
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
137 |
|
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
138 |
bool MxInitialize(uint rate) |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
139 |
{ |
2977 | 140 |
_play_rate = rate; |
1496
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
141 |
return true; |
15d859a626e8
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents:
diff
changeset
|
142 |
} |