View Full Version : Quick Scripting Question
will
27th January 2002, 21:44
When my script loads, how can i tell if something is currently playing?
I thought of checking if the Vu meters are zero and if the seeker is 0, but then the skin switch might occur when a song is just begining and this would lead to a bug.
Luc: you did this for probe when it goes to winshade, but you took the script source out :( so i cant find out how you did it. How did you do it?
Naamloos
28th January 2002, 05:41
Originally posted by willfisher
When my script loads, how can i tell if something is currently playing?
I thought of checking if the Vu meters are zero and if the seeker is 0, but then the skin switch might occur when a song is just begining and this would lead to a bug.
Luc: you did this for probe when it goes to winshade, but you took the script source out :( so i cant find out how you did it. How did you do it?
no, the vu meters are already above 0 (I think, not sure)above zero, but why dont you use double (first an VU meter check and after that a seekercheck, when one of boths leads to that...) just an idea
will
28th January 2002, 07:09
thats what i thought of, but that is a bit of a dirty hack, there has got to be a way that has no chance of getting it wrong.
Gonzotek
28th January 2002, 12:30
See my bitrate and frequency example:
http://forums.winamp.com/showthread.php?&threadid=71090
particularly this line in songinfoparse.m:
if (getLeftVUMeter()) songInfoTimer.start();
Then trap onPlay, onPause, onStop and onResume, if it fits the needs of your script.
I'm pretty sure that it's 100% in respect to knowing if a song is playing or not on script load.
-=Gonzotek=-
will
28th January 2002, 13:07
Originally posted by Gonzotek
See my bitrate and frequency example:
http://forums.winamp.com/showthread.php?&threadid=71090
particularly this line in songinfoparse.m:
if (getLeftVUMeter()) songInfoTimer.start();
Then trap onPlay, onPause, onStop and onResume, if it fits the needs of your script.
I'm pretty sure that it's 100% in respect to knowing if a song is playing or not on script load.
-=Gonzotek=- yeah, i'm using that now, but if the song is in a quiet patch when the skin loads then this would lead the script to getting it wrong. There should be a better way. a System.isPlaying() function would be nice.
thanks for all your help.
Gonzotek
28th January 2002, 14:35
Well, this should work
NullVUMeterCheck = getLeftVUMeter();
if (NullVUMeterCheck!=NULL){
songInfoTimer.start();
}
You could put it in a function:
Function isPlaying();
isPlaying(){
int NullVUMeterCheck;
NullVUMeterCheck = getLeftVUMeter();
if (NullVUMeterCheck!=NULL){
return 1;
else
return 0;
}
-=Gonzotek=-
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.