Mercurial > SDL_sound_CoreAudio
comparison mixer/DESIGN @ 486:859dd2ef3197
Added some seriously INCOMPLETE mixer code.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Sun, 27 Feb 2005 19:55:29 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
485:137c0b00ea4c | 486:859dd2ef3197 |
---|---|
1 - Mixes internally in Float32. This simplifies the code immensely by only | |
2 having one format to screw with. It also makes life easy for end-user | |
3 callbacks. A native Float32 format should be added to SDL, too, so there | |
4 isn't unnecessary conversion if we can avoid it (i.e. - a CoreAudio backend). | |
5 | |
6 - "Chunks" are just Sound_Samples...you can lock the mixer to screw with them | |
7 (i.e. - seeking in a playing Sample, etc). The mixer adds some opaque state | |
8 to Sound_Sample (current play position, how much is decoded, etc), some of | |
9 which can be queried and set. | |
10 | |
11 - There is no "stopped" state. You are either in the playing list or you are | |
12 not, but state doesn't reset, so removing a sample from the list is more like | |
13 pausing it. If you put it back in the playing list without rewinding it, it | |
14 starts where it was. | |
15 | |
16 - Fire and forget mixing is easy; flag a sample as "auto free" and it'll | |
17 delete itself when it's done playing. No need to set up a callback just to | |
18 clean up. | |
19 | |
20 - No channels. You can mix as many samples as you have resources to | |
21 accomodate. | |
22 | |
23 - No groups. This can be layered on top of the library if needed. If you | |
24 need atomic operations, lock the mixer. | |
25 | |
26 - No music channel. Samples are samples. You can mix a MIDI as a sound effect | |
27 if you want, or a WAV file for background music. If you have the horsepower | |
28 to decode multiple compressed files at once, go for it. | |
29 | |
30 - You can prebuffer/predecode as much of a sample as you like. | |
31 | |
32 - Every sample mixes with a per-channel gain, plus a master gain that is | |
33 global to the mixer. | |
34 | |
35 - Can handle non-power of two resampling. | |
36 | |
37 - post mix hook, sample finished hook. Effects callback? | |
38 | |
39 | |
40 | |
41 | |
42 |