Re: [tuxracer-devel] glTron music
Status: Beta
Brought to you by:
jfpatry
From: Jasmin P. <jf...@mu...> - 2000-03-29 22:51:47
|
On Wed, 29 Mar 2000, Steve Baker wrote: > Jasmin Patry wrote: > > > > One disadvantage of SDL is that it's not as portable as PLIB (Linux is > > the only fully supported UNIX-type platform). I'll look into > > integrating the libmikmod code (loaders/players) into SL, if it's > > something you'd like to see added to PLIB. > > I believe that someone looked at that once before. I don't think > it's impossible - but it may not be that easy either. > > SL works with a central mixer that asks the various music sources: > > "Please make me X milliseconds of audio right now" > > ...hence the sources have to be able to make a particular amount > of sound on-demand. Since MikMod doesn't let you tell it how > much to generate, that's not likely to work. Actually, it does let you tell it how much sound to generate, and that's what SDL_mixer does. SDL_mixer doesn't use any of libmikmod's supplied drivers or mixers (it sets up its own libmikmod driver using mikmod's "virtual channel mixer interface"), and calls mikmod's VC_WriteBytes( buffer, len ) to fill the audio buffer. It looks fairly straightforward. > Hence we could call MikMod to create however much it feels like > - store it in a buffer and just hand 'X' bytes over to SL - keeping > what's left for next time. Not very elegant - but it ought to be > do-able. No, not elegant at all, and that's not what I had in mind. > Personally, I hate to add dependancies on yet more libraries > since that adds so much to support hassles down the line. > So, given the choice, I'd prefer to add whatever new music > formats to the existing MOD player in SL rather than constructing > some elaborate kludge to get MikMod's player to drive SL's mixer. I wouldn't consider this an eleborate kludge. It would use an exposed aspect of libmikmod, without relying on libmikmod's drivers or mixers. It needn't add dependencies to PLIB either, if you include a stripped-down version of libmikmod in PLIB (e.g., the drivers could be left out). SDL_mixer does this too. > I'm biassed though...and right now, I don't have time to do > either modification. Understood (I wasn't asking you to do it, I was offering to look into it and do it myself). Cheers, Jasmin -- Jasmin Patry Master's Student, Dept. of Computer Science jf...@cg... http://www.cgl.uwaterloo.ca/~jfpatry/ |