Game Development Community

Updated CD Player code with CDDB support

by Harold "LabRat" Brown · in Torque Game Engine · 04/15/2002 (3:54 am) · 6 replies

Here it is...

The Updated CD player engine files are thanks to nohbody. The Windows SDL code is not here as there seems to be some Concern from some corners of the community about their use.

As a result this updated version will not work with the Linux build, nor will it work with the Mac build... Sorry guys.

CDPlayer.zip

realmwars.feylab.com/images/cdplayer.jpg

#1
04/15/2002 (4:02 am)
Looks great!!
but the link doesn't work.... :-(
#2
04/15/2002 (4:11 am)
It will work now... mispelled the filename on the server.
#3
04/15/2002 (9:40 am)
Looks great, but... but... Peter Cetera? :)


/duck
#4
04/15/2002 (9:58 am)
Why not just wrap the calls in Platform:: and use SDL for linux/mac and whatever for windows ?
#5
04/15/2002 (10:54 am)
Why write 2x the code for something that could have been accomplished on all 3 platforms by writing it once?

I did not write the updated MCI code that allowed for the CDDB code, Nohbody did. As such there isn't any SDL code written for those functions.

A crossplatform application should not require a different codebase for each platform you support. As it is right now that is the direction Torque is heading, and wrapping every function in abstraction layers that you create does not negate that.

This is the reason why DirectX, OpenGL, OpenAL, and SDL were created. Initially they provided abstraction layers so you did not have to write code to support different sets of hardware. Now they are providing abstraction layers that allow you to write programs that don't care what Operating System you are running.

As it is I won't release the windows SDL code, nor the SDL code for the other platforms that would enable the CD Player to work on the other platforms, until it is given the OK by Tim, Jeff, Mark or Rick. If they can not OK the use of SDL on the windows platform I can not in good concience believe that it is then OK to use it on another.
#6
04/15/2002 (4:07 pm)
Well, the only thing I added that breaks the Linux build is adding a few more pure virtual functions to the 'RedBook' class which Win32RedBookDevice and LinuxRedBookDevice (im guessing thats what its called, I forget exactly) are derived from. Since I didn't implement these new functions in LinuxRedBookDevice, it won't be able to instantiate the class (and will probably give you a compiler error from trying to do so)

To fix it you'd just need to add empty functions in the LinuxRedBook... or go ahead fill em in with working code, Linux uses SDL... shouldn't be too hard :) I believe all the functions I added so far have straightforward SDL function calls.... The CD player won't work without the functions working correctly, but at least it'll compile

As for Mac... I'm not sure how Mac deals with the RedBook stuff... However since there isn't a MacRedBookDevice, I'd imagine it should still build fine... correct me if I'm wrong

I don't have a Linux machine capable of running Torque otherwise I'd do it myself

Anywho, enjoy the CD player ;p There's still a few more things to add - Seeking within a track, for example... which I'll fix up as soon as I have more time

-noh