CD Jukebox

The CD Jukebox is a system that uses a simulated robotic arm and a computer with two CD-ROMs. The user is able to have the robotic arm get a CD and place it into a CD-ROM, after which they can play the whole CD, a single track, or randomly play a track. The user can then return the CD back to its bay. The last feature of the system is the programming feature. If the user wishes, they can program in different CDs and tracks for the system to play and the arm will get the appropriate CD, and play its track. While that track is playing, the arm will get the next CD and load it into the second CD-ROM, once the first finishes, the second will being to play its track. While the second CD-ROM is playing, the first CD is returned and the next CD in the list is placed into the first CD-ROM, this continues until all the programmed CDs and tracks have been played.

I chose this project, as my own commercial CD Jukebox cannot keep track of when a CD is in a bay until it tries to get it. It can also not be programmed without the programmed CD playing. For example, if you want to play track 10 on CD 9, you have to load the CD, and then go to track 10, press play and then program. You have to do this for each track. With the CD Jukebox, the system knows when a CD is in the bay, and the programming can be done without having to get each individual CD.

I created the program using C++ and two DOS command line CD programs. For the visual simulation of the robotic arm and system, I integrated openGL code into my project.

I came across many problems along the way, two including timing issues between C++ and hardware, and C++ to DOS commands.

Some of the timing issues I was having was getting the C++ code to pause for the hardware to completes its tasks before going on. I eventually solved this by creating a DOS based wait file that made C++ wait for the hardware to initialize.

The problem with C++ to DOS dealt with two different issues, the first was actually getting a DOS program to run from C++, and the other dealt with converting the C++ values to a format that DOS could use. I found that the C++ spawnl command, used to run an external program would only allow a 32k or smaller program to run. To solve this problem I created batch files that would accept variables for the command line CD-Player to use. To fix the problem of sending variables to the command line, I had to capture the variables as a char. In the case of two digit numbers, I had to capture them from the user interface as ints and then had to use switch and case statements that represented the value of the int to the command line.

This project has been very challenging as I had to learn advance C++ and batch file coding, I also had to figure out how one of the command line players was talking to the two CD-ROMs so as to get it to close both drive doors.

Advisor: Dr Boyd

Image: 
Student Name: 
David M. Schlabach