@T.P. Wang : possible bug with timer (SetTimout or SetInterval methods)
WSH panel mod version = 1.5.2
Hi,
i work on a script for a playlist viewer, and for scrolling my playlist with mousewheel, i use this function:
function on_mouse_wheel(delta) {
var i;
if(!list.waiter_timer) {
fb.trace("false!!");
if(delta>0) {
fb.trace(">0");
list.waiter_timer = window.SetTimeout(function () {
fb.trace(">0 run");
for(i=0;i<list.mousewheel_scrollstep;i++) {
scrollup_spv(fb.ActivePlaylist, 1);
}
list.waiter_timer = false;
window.Repaint();
}, 25);
} else {
fb.trace("<0");
list.waiter_timer = window.SetTimeout(function () {
fb.trace("<0 run");
for(i=0;i<list.mousewheel_scrollstep;i++) {
scrolldown_spv(fb.ActivePlaylist, 1);
}
list.waiter_timer = false;
window.Repaint();
}, 25);
}
}
}
if i use mousewheel massively, console display this:
...
false!!
>0
false!!
<0
false!!
<0
false!!
<0
false!!
<0
false!!
>0
as you can see, the timeout is never rechead because console never display ">0 run" or "<0 run", and result is that my playlist isn't scrolling at all !
Important comment about this weird behaviour: this problem is NOT PRESENT when i run foobar (so at the first launch of the WSH jscript), but it happens after some while, that became messy and no more scroll (the mousewheel is just an example, it seems that all my timer are broken!)
only a restart of foobar fix the problem (editing script then Applying has NO effect ...)
So, after testing this, i'm pretty sure that's a problem with these new methods to set timers brought with v1.5.x version of your component, and i've read in v1.5.0 betas that you've already encoutered some issues with them (timers never stopped on exit if i remember ...)
Could you check it please, because for now i'm really stuck!
Thanx by advance for your feedback
Regards,
Br3tt