How to capture playing stream name in Winamp

Simple advice that you may find useful. Feel free to discuss or add your own.
Post Reply
roussell
Advanced Member
Posts: 268
Joined: Wed Dec 15, 2004 9:07 am
Location: Pelham, AL

How to capture playing stream name in Winamp

Post by roussell »

Previously I had used the WinAmpCOM dll to capture the currently playing song name in WinAmp. There are problems with that method however when running multiple instances of Winamp to different sound cards.

The DoSomething Winamp plugin can trigger a lists of tasks (called Actions) on song changes. It works with streams or local files. What we're going to do here is install the plugin and create two actions. The first action will create a vbscript file from a template. The second action will run that vbscript to populate a Property Value in HouseBot. The script uses the external com control to communicate with HB. If you haven't registered the com control from HB yet, you'll need to run this command from the "Run" dialog in Windows or from a command prompt:
  • regsvr32 "C:\Program Files\HouseBot\Plugins\Devices\ExternalComControl\HBControlMod.dll"
The following method, while a little complex to setup will work with multiple instances just fine and I believe results in a cleaner install.

1. Setup Multiple copies of Winamp. Do this by creating multiple copies of your Winamp program folder (Normally located in c:\Program Files\Winamp). I placed all of my copies in the HouseBot Config directory and renamed each copy to zone1, zone2, etc. so that each copy is located/named as below:
  • C:\Program Files\HouseBot\Config\Winamp\Zone1
    C:\Program Files\HouseBot\Config\Winamp\Zone2
In HB for this example, I created my Winamp Devices following this convention:
  • Winamp.Zone1
    Winamp.Zone2
    Winamp.Zone3
2. You need the "DoSomething" plugin, you can get it from here: http://www.oddsock.org/tools/dosomething/. Download and install/copy-to-plugins-folder or to get right to it; download and unzip the attachment (WinampNowPlaying.zip) to this post and place a copy of the "gen_dosomething.dll" file in each Winamp folder's plugin directory (C:\Program Files\HouseBot\Config\Winamp\Zone_\Plugins)

Here are the contents of the attachment:
  • VBtemplate.txt - A vbscript template to create a script that will chane the "Now Playing" PV in HB
    Zone1Playing.vbs - An example of the output from the template above would be executed with a "zone switch" (ex: /Zone:Zone1)
    DoSomething Plugin folder - The plugin dll and associated files from the author. open the html for a much more comprehensive list of the plugin's capabilities.

3. Create a "Scripts" folder for Winamp (C:\Program Files\HouseBot\Config\Winamp\Scripts)
4. Copy the "VBtemplate.txt" file into the scripts folder above.
5. In Housebot, create an alpha property in each Winamp device called "Now Playing"
6. In Housebot, create an external control device with the following properties: ASCII Protocol - No, Server IP Port - 1234, Server Password - pwd (If you change the password/port here, make sure you also change it in the VBtemplate.txt file)

Now we're ready to configure the plugin to update the "Now Playing" property in the winamp device. We're going to create two "actions" in the DoSomething plugin that will trigger when the song title changes. The first action will create a VBscript file based on the template in the scripts folder. The second action will execute that vbScript file which will update the property in the winamp device.

7. Launch a copy of Winamp and Navigate to: Options --> Preferences --> Plugins --> General Purpose. Double click on the DoSomething plugin to configure it.
8. "Uncheck" the "Disable Plugin" option.
9. In the "Actions" dropdown box; select "Generate HTML Playlist"
10. In the "Template In" box, type the path to the vbscript template saved in step 4.
C:\Program Files\HouseBot\Config\Winamp\Scripts\VBtemplate.txt
11. In the "Template Out" box, type the path to the completed VBscript for the zone you're changing.
C:\Program Files\HouseBot\Config\Winamp\Scripts\Zone1Playing.vbs
12. Click the "Add -->" button to add the action to the Action List.
13. In the "Actions" dropdown box; select "Run A Command"
14. In the "Command" box, type the path to the vbscript that was created in step 11
C:\Progra~1\HouseBot\Config\Winamp\Scripts\Zone1Playing.vbs /Zone:Zone1

Notice the "/Zone:Zone1" switch in the example above. You will change that switch to match your zone number (/Zone:Zone2, etc). Note that if you do not name your Winamp Devices in HB as I did here (Winamp.Zone1, Winamp.Zone2, etc) you will have to change the script template to match your configuration.

15. Click the "Add -->" button to add the action to the Action List.
16. Click the OK button to save and return to the Winamp Preferences screen.
17. Click the Close button to exit the Winamp Preferences screen.
18. Restart Winamp, play something.
You should notice a DOS box pop up and go away when the song changes. If you get a vbscript error, check over everything to make sure your paths/filenames/etc. are correct. If you have no errors, you should have the song title/artist populated in the "Now Playing" variable in the Winamp Device.
19. Copy the above procedure for each Winamp folder/instance you have, make sure you change "Output template" and "Command" file name and the zone switch in steps 11 and 14 above to correctly reflect each new zone.


Terry
Attachments
WinampNowPlaying.zip
(414.69 KiB) Downloaded 433 times
Post Reply