I assume you are using this:
http://www.adcock8.freeserve.co.uk/winamp.htm
As far as I know, even though WinAmp supports COM, it provides no *direct* method of commanding WinAmp or requesting information.
Basically, as Nick said, you can use createobject to create an instance of the above plugin like:
Dim oWinCom as object
set oWinCom = CreateObject("WinampCOM.Application")
oWinCom.Play
All the features supported through the plugin are accessable that way. To get the song name for instance:
Song = oWinCom.CurrentSongTitle
Now.. An important thing to note:
There is a SongChange 'event'. The problem is that, except for Python, which has its own rules, most scripts, including ActivePerl cannot use events from anything not either:
a) provided by the program using it - like the world.<command> functions in Mushclient.
b) specialized 'web based' COM objects that impliment some sort of additional linking method. I have no idea how this works or even if it will actually let you use createobject call with them.
As a result.. If you want to capture an event, you have to design the object itself and use Mushclient commands like CallPlugin, or the trick someone came up with that uses aliases and World.Execute to 'fake' calling an event. Existing COM objects can't have their events trapped, this unfortunately includes the WinAmp one.
The 'trick' you can use is to have an alias like:
<alias>
Match="Event::* *"
Sendto="12"
enabled="y"
<send>call %1 %2<send>
</alias>
So your own COM object would include a call to fake the event with something like:
world.execute "Event::SongChange " & oWinCom.CurrentSongName
However, this would require creating a new version of gen_com.dll that can use the Mushclient function. But it is at least possible using this trick.
|