Posted by member 37809 on 2004-06-05 09:37:54 link

Your approach and constraints make it difficult IMO. Step.rc if/then/elses are static in nature. The way to go is to use xlabel (or xlabellight) and mzscript.

Create a hidden label whose text is "[winampStatus]"

Set its update interval accordingly. Something like 100ms or less would be best for user feedback. That is, whenever winamp's playback status changes, the maximum delay before the label updates its text is 100ms (but on average it should be 50ms).

Have the label's onTextChange event call a custom bang. In this custom bang !labelmzscriptvarcopy to an mzscript variable and then based on that, show the appropriate shortcut through bangs. You will have to isolate these shortcuts by giving them unique groups IDs.

I don't know how omnipotent xlabel has gotten at the time of this writing but I wouldn't be surprised if you could use the same xlabel as a single shortcut itself. That is, try offsetting the text so that it's not shown. Then instead of having to toggle the visibility of shortcuts, you could use !LabelRefresh to update its images on-the-fly.

The elegance in this solution is that you can control winamp through whatever means and litestep will still be aware of winamp's playback status, automatically updating the image and semantic of the button you made.