Timer.enabled bug in MS ihdsim
Hi guys,
I think I found a bug in MS ihdsim.
Lets discuss following JS example:
var count = 0;
function keydown_callback()
{
timer.enabled = false;
timer.enabled = true;
}
function timer_callback()
{
count++;
document.getElementById("TextLine1").state.value = count;
}
function main()
{
timer = createTimer("00:00:05:00", 1, timer_callback);
timer.autoReset = true;
timer.enabled = true;
}
setMarkupLoadedHandler(main);
addEventListener("controller_key_down", keydown_callback, false);
1. I run this content in MS ihdsim; counter incremented with 5s period, its OK
2. Then I start pressing some buttons, for example '1' key, with period<5s.
3. But counter NOT incremented
I think its against the iHD SPEC.
************HDDVD spec snapshot***************************************
enabled of type Boolean
Contains whether Player call the callback function or not. When this property is "true", Player shall call the callback function. When this property is "false", Player shall not call it. When this property is changed to "false" from "true", Player shall stop timer count, shall not reset count. When this property is changed to "true" from "false", Player shall restart timer count from stop count.
*****************************************************************
So, I think, when enabled->disabled->enabled sequence is used in JS content, MS ihdsim reset timer count, and this is against HDDVD spec.
Maybe I do not fully understand the spec Please help me.

Timer.enabled bug in MS ihdsim
Earl Hood
Oh, my bad - I misunderstood which count you were talking about :)
I guess the simulator is functioning how _I_ would expect it to, but not how the _spec_ says it should :( bummer
tjl
Shu Gao
The count isn't incremented until 5 seconds after the last key down event. In your code, everytime it hears a keydown event, the timer is reset. If before the 5 seconds are up another keydown event is heard, the timer gets reset again.