one.dll & mzscript Thread last updated on 2004-05-18 10:46:11

Posted by member 843 on 2004-05-17 21:19:17

I'm trying to create a winamp control using dynamp, using only one button to play/pause the current song.
the play and pause buttons were created using layercut, with the pause button group starting hidden.
However, on a !recycle, the play button would be showing, even if winamp were already playing a song.
So i was thinking about using mzscripts Start command to do a search with one.dll (v0.7) for the "Winamp [Stopped]" or "Winamp [Paused]" title to show/hide the corresponding buttons.

*Script bang !StartUp
*Script exec !One "*Winamp*" "* Winamp [Stopped]" #w !About !none
*Script ~bang
*Script Start !StartUp


(the !about and !none commands were used for testing)
However, it doesn't do anything, wathever is the status of the current song on winamp.
So.. am I doing anything wrong here?

Posted by member 37809 on 2004-05-17 23:08:55 link

isn't there a !amp_playpause ?

Posted by member 7223 on 2004-05-18 01:16:43 link

@tnl: Yes it is. But he wants to know if winamp is playing or paused.

@Vorlon:
- Use the good syntax of !one (check the docs). "[Stopped]" might conflicts with the [] expected by !one. In your script, [!about] is the [not found command] and [!none] the [found command] lol

- Use the right Winamp WindowClass (Winamp v1.x) Hum... maybe this can change depending on the skin in use (with winamp5)

- If you want total control of your player, switch to foobar (.8.1 because .8.2 has a broken command line support)

Posted by member 843 on 2004-05-18 02:22:15 link

Actually, I tried to do the exact same command using the !one bang on a popup and it worked fine, but for some reason it doesn't do anything when its called from mzscript

Posted by member 37809 on 2004-05-18 09:55:43 link

oh sorry, in that case xLabel or xLabelLight should be able to do it. Create a dummy hidden label that refreshes often, whose text is "[winampStatus]". Have its onTextChange event call a scripted bang to !labelmzscriptvarcopy its text and then show the appropriate shortcutgroup.

Posted by member 843 on 2004-05-18 10:46:11 link

I found the error... while testing I started to put the mzscript directly into my theme.rc, but forgot to add mzScriptUseStep (...)
Thanks for the help guys!