[Tuxnes-devel] Sound routines abstracted!
Brought to you by:
tmmm
From: Jim U. <ji...@3e...> - 2001-09-24 20:12:07
|
Hi all, As promised long ago, I have finally gotten around to abstracting the sound routines into platform-specific functions, modeled after the renderer. Here is a summary of the changes. - Common sound calculation setup code was moved into InitSoundParms(). - InitAudio and UpdateAudio are now InitAudio[Platform] and UpdateAudio[Platform], and are called indirectly through their old names via a pointer to function. Each platform gets its own file. Common sound code remains in sound.c. - The existing sound driver is now "oss" (InitAudioOSS), in oss-sound.c. - Added "mute" and "none" drivers. Mute does all the sound calculations, but produces no output. None does no calculations or output at all. These are simple enough to stay in sound.c. - -s/--sound option now selects the sound driver rather than the output file. The default output file is determined by the respective InitAudio function. However, it can be overridden with the -e/--sound-device option. - Help text reflects the changes. Errata: - Names are not final. Not sure about "OSS" as driver name, though it seems most specific. In places I refer to the sound routines as the sound engine, sound driver, or the "sounder"; needs to be standardized. - Did not abstract sample_format, it's probably not worth the effort now. Patch is cvs diff, ~36K, mostly because of the splitting of sound.c into two files. Should I send the patch to the list, or privately? -- "the visual pattern seemed to be a sort of m-dimensional lissajous curve formed by the intersection of 'i' with the shock wave of space-time causality." -- zarkov, "a hit of dmt 10/9/84" ji...@3e... / 0x43340710 / 517B C658 D2CB 260D 3E1F 5ED1 6DB3 FBB9 4334 0710 |