Scripting Support Plugin for WinampThis Winamp plugin allows you to control and query Winamp from Active Scripting langauges such as VBScript, JScript and Perl, as well as programming languages such as C++ and Visual Basic. The plugin, in a nutshell, exposes almost all of the Winamp 2 general plugin API in a COM object which allows you to do things like query the current track title and filename, skip to the next track, open and adjust the EQ settings, and so on. The plugin should work fine with Winamp 5 but doesn't support any of the new things it adds to the general plugin API. Installgen_scripting_1004.zip (52k) (PGP sig) version 1.0.0.3 (12 Jun 2003) Copy gen_scripting.dll from the Zip to your Winamp plugins directory and then register it with regsvr32 from a command prompt: cd "C:\Program Files\Winamp\Plugins" regsvr32.exe gen_scripting.dll To remove the plugin, unregister it with "regsvr32.exe /u gen_scripting.dll" and then delete the DLL file. Source Codegen_scripting_source_1004.zip (90k) (PGP sig) C++ source code is available for anyone who wants to see or change how the plugin works. You will probably need Visual Studio .Net to open the project, which also uses ATL. History1.0.0.4 (24th July 2003)
1.0.0.3 (12th June 2003)
1.0.0.2 (25th February 2003)
Usage (VBScript)Before doing anything you must instantiate the object. Note that an error will be thrown if you call any method when Winamp isn't actually running.
You can check which version of Winamp is running. The version number is the hexadecimal value provided by WinAmp: "Version will be 0x20yx for Winamp 2.yx. Versions previous to Winamp 2.0 typically (but not always) use 0x1zyx for 1.zx versions." For example, 10241 = 0x2801 = WinAmp 2.81. x = winamp.GetVersion() GUI Control -- You can toggle the EQ and Playlist windows, show the Open File dialog, and so on.
Buttons -- Your scripts can perform actions equivalent to pressing Winamp's buttons.
Volume & EQ -- You can adjust the volume and EQ settings. The current EQ settings can also be queried. Please note that the Winamp EQ window does not always seem to update to changes made immediately and I'm not sure why.
Valid "a" and "x" values for SetEqData & GetEqData are as follows: Description a x ------------------------ ------- -------------------------------- The 10 bands of EQ data 0 to 9 0 (+20db) to 63 (-20db) The pre-amp value 10 0 (+20db) to 63 (-20db) Is the EQ Enabled? 11 0 (disabled) or other (enabled) Is AutoLoad enabled? 12 0 (disabled) or other (enabeld) Current Track -- You can get and set data about the track currently playing. (If you need the title or file-path, keep reading...)
The Playlist -- You can edit and query the playlist and tracks within it.
ExampleThis small script gets the directory where the currently playing mp3 can be found:
Usage (Other Languages)Check out the IDL file in the source code for the full interface description for languages which do proper type checking. Generally, numbers are passed as LONG and strings as BSTR. More information, and usage with mIRC.Check out this forum post, which describes how to use this plugin with mIRC, for some good tips. (I didn't write the post, just noticed it as a referer in my web-logs and thought it looked useful.) There's also information there about controlling Windows Media Player via COM, if you prefer it. (WMP has built-in COM support and doesn't require a plugin like this.) Email NoteBefore you email me, please note that I'm not much of an expert with advanced VBScript, ASP, etc. configuration/issues so if you're having problems just creating the object, and you've made sure it's registered and permissioned so that the script, webserver or whatever can access and execute it, then I probably won't be able to help much, sorry. |
