CD Player (Code Inside)
by Tim Heldna · in Torque Game Engine · 02/01/2007 (5:49 pm) · 5 replies
Here's a free CD Player for anyone who wants it.
It's completely scripted, is straight forward to install, features play, previous track, next track and stop buttons as well as a track list and should detect all installed CD devices.
Installation:
- Add the following line to yourModFolder/client/init.cs
- Download the following file named CDPlayer.gui and save it to yourModFolder/client/ui
CDPlayer.gui
- Delete yourModFolder/client/config.cs to ensure our new keybinding is picked up
That's it. Run your game and hit Ctrl-M to open the CD Player. Enjoy.

It's completely scripted, is straight forward to install, features play, previous track, next track and stop buttons as well as a track list and should detect all installed CD devices.
Installation:
- Add the following line to yourModFolder/client/init.cs
exec("./ui/CDPlayer.gui");- Download the following file named CDPlayer.gui and save it to yourModFolder/client/ui
CDPlayer.gui
- Delete yourModFolder/client/config.cs to ensure our new keybinding is picked up
That's it. Run your game and hit Ctrl-M to open the CD Player. Enjoy.

About the author
#2
02/01/2007 (10:15 pm)
This is very neat. I was wondering what to do for 'ingame' music. Having the option for the game player to play CD music of there choice is a nice solution.
#3
02/01/2007 (10:54 pm)
Awesome Tim. Thanks a ton.
#4
02/01/2007 (11:21 pm)
Awesome!
#5
I only use this in a 'developer' context, i.e. it allows me to listen to CD music whilst working in my game.
I don't know if the stock redbook (CD Audio) code in Torque is fit enough for actual game use. I dug through the source and noticed that the volume control for CD Audio does not work and there's some pretty important callbacks missing. Like the ability to determine if a track is playing, the length of a track, changing devices etc. This makes simple tasks like creating a playlist, auto playing another track once one track has finished etc impossible to achieve.
If I manage to improve things I'll bundle it up as a resource.
02/02/2007 (1:11 am)
Thanks guys.I only use this in a 'developer' context, i.e. it allows me to listen to CD music whilst working in my game.
I don't know if the stock redbook (CD Audio) code in Torque is fit enough for actual game use. I dug through the source and noticed that the volume control for CD Audio does not work and there's some pretty important callbacks missing. Like the ability to determine if a track is playing, the length of a track, changing devices etc. This makes simple tasks like creating a playlist, auto playing another track once one track has finished etc impossible to achieve.
If I manage to improve things I'll bundle it up as a resource.
Torque Owner AllynMcelrath
Sugestion: you should put the track list in a drop down. To make the window smaller.