View Full Version : Checking to see if Winamp is playing/stopped/paused
djharvey
October 13th, 2002, 12:55 PM
Hello,
Wondering if there would be someway to check to see if Winamp is currently playing, stopped, or paused. This information would be very helpful. Thanks.
David Harvey
djharvey
October 13th, 2002, 12:55 PM
OK, I figured out how to check for Winamp status (check for window existence of the window of Winamp.exe with substring matching and the words "paused" or "stopped" used as the name). My problem is now I would like to do an infinite loop where it would constantly check for the Winamp's state. My reason for this is that I would like to have 4 push-buttons attached to the serial port (using Mark Fiechtner serial port plugin) as well as an LED that would be solid if playing, blinking if paused, and off if stopped. However, the problem in doing this is that if Girder goes into a loop like that, it won't accept any codes from the serial device. The following is the text from the exported group file of the first few commands that I have worked on, so you can see exactly what I am doing (Paste it into a text editor and save it as "Blinking LED.gxr", then load it into Girder.)
Girder 3.0 ExportFile
[Blinking LED]
enabled=TRUE
Identifier=99
<Check for Winamp stopped>
irstr=
Device=-1
Identifier=101
enabled=TRUE
ActionType=1
ActionSubType=1
TopMost=TRUE
Matchnum=1
StateCount=1
StateBegin=1
<Check for Winamp paused>
irstr=
Device=-1
Identifier=90
enabled=TRUE
ActionType=4
ActionSubType=13
lValue1=91
TargetName=Paused
TargetClass=Winamp v1.x
TargetExe=winamp.exe
SubMatch=TRUE
TopMost=FALSE
Matchnum=1
MatchBy=7
MatchHidden=TRUE
StateCount=1
StateBegin=1
(Blink LED)
enabled=TRUE
irstr=
Device=-1
Identifier=91
Invert=FALSE
{LED off}
Identifier=93
enabled=TRUE
ActionType=140
ActionSubType=3
sValue2=Serial
iValue1=1
TopMost=TRUE
Matchnum=1
StateCount=1
StateBegin=1
{Wait}
Identifier=94
enabled=TRUE
ActionType=1
ActionSubType=7
iValue1=500
TopMost=TRUE
Matchnum=1
StateCount=1
StateBegin=1
{LED on}
Identifier=102
enabled=TRUE
ActionType=140
ActionSubType=3
sValue2=Serial
iValue1=3
TopMost=TRUE
Matchnum=1
StateCount=1
StateBegin=1
{Wait}
Identifier=108
enabled=TRUE
ActionType=1
ActionSubType=7
iValue1=500
TopMost=TRUE
Matchnum=1
StateCount=1
StateBegin=1
{Check for Winamp paused}
Identifier=112
enabled=TRUE
ActionType=4
ActionSubType=13
lValue1=91
TargetName=Paused
TargetClass=Winamp v1.x
TargetExe=winamp.exe
SubMatch=TRUE
TopMost=FALSE
Matchnum=1
MatchBy=7
MatchHidden=TRUE
StateCount=1
StateBegin=1
Am I just going about this in completely the wrong way? Is there any easier way to do this within Girder? Any possibility that there could be a command that would pause to check for any new serial commands? Well, if anyone can figure this out, I would be much obliged. Thanks.
<font size=-1>[ This Message was edited by: djharvey on 2002-01-05 02:47 ]</font>
Powered by vBulletin® Version 4.1.8 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.