Automating Winamp

I, like many others, am of the opinion that Winamp 2.x is simply the best media player out there. A quick Task Manager check shows it using 9 MB of memory and about 1% of CPU time. Try firing up QuickTime or Media Player (or the other player I won’t name because of its hideous privacy practices) and see if the resources used are anywhere near the small footprint of Winamp. It’s so fast, it runs as comfortably on a 486 as a Pentium III.

Being a techie, I also am of the opinion that Winamp, along with its documented API, is the best media playback library out there. Unfortunately, most of the attempts I’ve seen to write a Visual Basic wrapper for it have been lacking in some way – typically in the quality of the object model (it was often limiting). I therefore decided to begin writing my own.

I’ve made good progress today. The ActiveX DLL supports read/write Balance, Repeat, Volume, and Shuffle properties, as well as some early transport methods (currently, PausePlayback and StopPlayback). When instances of the class initialize, they automatically start copies of Winamp; if a copy should be closed for some reason, the wrapper will silently re-open it. With the assistance of many helpful posters at Nullsoft’s developer forums and a great example of working with process memory at AllAPI, I managed to get filenames from the playlist by reading Winamp’s process memory – something the API docs say can’t be done except with a plug-in.

I wish Nullsoft wrote documentation of the same caliber as their software. (Sigh.)