A Remote Control for Winamp 2 over a TCP/IP network
This a little program I wrote for work. We have a collection of music on the network, but the PC playing it is controlled by the nerd who sits in the corner (i.e. me).
In an effort to bring a little democracy to the musical proceedings I decided to create a system to allow my colleagues a bit of control over what we listen to.
I found the Winamp developers information at http://www.winamp.com/nsdn/winamp2x/dev/sdk/api.jhtml. This is all you need to give some control over playlists, volume (for when the phone rings) and, as it turned out, to force me to listen to a lot of Bob Dylan.
After an abortive attempt to write an activex component that I could use in ASP scripts over an intranet, I decided the way to go would be to write a WIN32 program in C++ to do the job.
The networking side of things is handled by some code I found called NDK (Network Development Kit) which is at: http://www.codeguru.com/network/NDK2.html. This code is released as freeware and includes a sample chat program. I altered the Chat Client and Server programs to create the Jukebox.
The server program controls Winamp, accept commands from the clients and issues messages on status (volume, track number, whether Winamp is playing, paused, stopped etc.). This is done using chat messages.
The client program let users on remote PCs add tracks to the playlist, pause, stop, skip back and forward, turn the volume up and down and mute, all from the comfort of their own computers.
About ten hours later it's pretty much done. My first effort at proper windows programming and my first struggle with MFC. I'll hopefully release the code soon when I've got it into shape.
You can get Winamp 2.x here.
Note: The program requires a TCP/IP network with FIXED IP addresses. One day I plan to rewrite it using DirectPlay which would search for servers on the local subnet.
If you find this program useful, please let me know.
|