Nedlinin Posted September 23, 2007 Posted September 23, 2007 Ok! Ive just started learning C++ for a class that I will be having next semester. figured getting an early start is the best way to go about it. Anyways, Ive been messing around with it a bit and was wondering if there was a way to get a program to play background music during its running period. Im able to get the program to PLAY music, but while the music plays, no commands can be entered and nothing actually moves forward in the program until the short clip is finished. I would like to able to play music at the same times commands are being entered. Anyone have a quick and easy way for a newb to be able to do this? Share this post Link to post Share on other sites More sharing options...
Waco Posted September 24, 2007 Posted September 24, 2007 Spawn a second thread to run the music code, kill that thread when the main program finishes. Share this post Link to post Share on other sites More sharing options...
flareback Posted September 24, 2007 Posted September 24, 2007 Spawn a second thread to run the music code, kill that thread when the main program finishes. yep. best way to do it is with threads. Share this post Link to post Share on other sites More sharing options...
Nedlinin Posted September 24, 2007 Posted September 24, 2007 Spawn a second thread to run the music code, kill that thread when the main program finishes. Haha.. you make it sound so easy! Mind giving me a quick tutorial on how I can do this? Or helping me find a nice website for a guide book on things such as this? Share this post Link to post Share on other sites More sharing options...
Waco Posted September 24, 2007 Posted September 24, 2007 Haha.. you make it sound so easy! Mind giving me a quick tutorial on how I can do this? Or helping me find a nice website for a guide book on things such as this? It is easy once you get the hang of it. http://www.linuxselfhelp.com/HOWTO/C++Prog...g-HOWTO-18.html EDIT: Here's some stuff I did a few years back, check out the threading labs from ECE 329: http://people.clemson.edu/~dbonnie/Web%20P...olio/Win32.html Share this post Link to post Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now