RE: processing click events when restart="whenNotActive"

Hi Kari,

Not exactly.

In http://www.w3.org/TR/smil20/smil-timing.html#Timing-BeginEnd-LC-Active :

"This period occurs when the current interval is active (i.e. once it has begun, and until it has ended).  During this period, the end time of the interval can change, but the begin time cannot. If any of the instance times in the begin list change after the current interval has begun, the change will not affect the current interval. This is different from the case of adding a new instance time to the begin list, which can cause a restart. 

If the element receives a "new interval" notice while it is active, it will add the associated time (i.e. the begin or end time of the syncbase interval) to the appropriate list of resolved times. If the new interval adds a time to the begin list, restart semantics are considered, and this may end the current interval."

It isn't the case of changing one of the instance times - this is more like adding a new instance time to the begin list - it is not that I'm trying to end this interval (assuming that the new begin time is after the active duration end of the current interval).

I http://www.w3.org/TR/smil20/smil-timing.html#Timing-BeginEnd-LC-PostActive :

"If restart="whenNotActive" then nothing more is done. If the time falls within the current interval, the element cannot restart, and if it falls after, then the normal processing at the end of the current interval will handle it. If the time falls before the current interval, as can happen if the time includes a negative offset, the element does not restart (the new instance time is effectively ignored)."

Although they are talking here of the process to be done when the element is not active, I think that when active, an element should process events as here: if it is about to be active on a specific time in the future - it can't begin then. But if it is to be not active - why not?

I'm afraid they mean us all to use lists of instances and add more calculations, which will significantly increase the memory used by the player.
I hope that it doesn't matter. Anyway, I've tried the GRiNS player, the X-Smiles player, and, of course, the RealOne player, but amazingly - none of which reacts the same...


thanks anyway,
Dana

-----Original Message-----
From: kpihkala@cc.hut.fi [mailto:kpihkala@cc.hut.fi]
Sent: Wednesday, January 29, 2003 10:38 AM
To: Dana Rosenfeld
Cc: www-smil@w3.org
Subject: Re: processing click events when restart="whenNotActive"



Hi Dana,

I can try to explane this, however I might be wrong..

On Sun, 26 Jan 2003 21:16:51 +0200 Dana Rosenfeld <Dana.rosenfeld@emblaze.com> 
wrote:

> Consider this SMIL source:
>  
> <smil xmlns=" http://www.w3.org/2001/SMIL20/Language">
>   <head>
>     <layout>
>       <root-layout id="viewport-0" title="viewport 0" 
> backgroundColor="black" width="400" height="400"/>
>       <region id="r1" left="0" width="400" top="0" height="100"/>
>       <region id="r2" left="0" width="400" top="100" height="200"/>
>       <region id="r3" left="0" width="400" top="300" height="100"/>
>     </layout>
>   </head>
>   <body>
>     <par dur="30s">
>       <img id="bar" region="r1" dur="30s" src="../images/frown.jpg"/>
>       <img id="foo" region="r2" 
> begin="0;bar.activateEvent+10;joe.activateEvent" dur="8s"
> end="bar.activateEvent+11" restart="whenNotActive"
> src="../images/smile.jpg"/>
>       <img id="joe" region="r3" dur="30s" src="../images/frown.jpg"/>
>     </par>
>   </body>
> </smil>
> 
> Now, lets say that the user clicks on bar at t=2s and then clicks on
> joe at t=9s.
> How is the player supposed to react?
>  
> Since activating bar can either begin or end foo - we should check
> foo's state on t+10.
> At first (before the user clicks on joe), it seems that we should
> consider the first click as a begin trigger.
> But then comes the second click, and so the logical approach is to
> change the first click to be considered as an end trigger.

I think that when the user clicks on bar, it will be considered as an end 
event, because foo is already active [interval 0-8s]. See 
http://www.w3.org/TR/smil20/smil-timing.html#Timing-EventSensitivity

"3. If an element is (already) active when an event is raised, ...: if 
restart="whenNotActive", then any begin specification of the event is ignored 
for this instance of the event. If end specifies the event, an end value is 
resolved based upon the event time"

So, in the example you gave, foo will be played 0-8s and after that 9-13s 
(begins because of joe 9s and ends because bar was clicked: 2s+11s=13s). 
I know this all seems quite strange, but I think this is the way it works..

> BUT, it doesn't make any sense! Do I have to keep a list of all
> "doubled" events, in case that the user behaves like that? It seems to
> me very clumsy. Can't I just consider the first click as a begin
> trigger and when the second click comes (t=9s) - restart foo and and
> end it after 8s? (since I won't be able to restart foo again)

Just make the decision about the begin / end event triggering when you get the 
event, add the time offset and insert the time to the time instance list. Based 
on the usual SMIL interval calculation you then create the time intervals.

 regards, 
      Kari

**************************************************************************************************
The contents of this email and any attachments are confidential.
It is intended for the named recipient(s) only.
If you have received this email in error please notify the system manager or  the 
sender immediately and do not disclose the contents to any one or make copies.

** eSafe scanned this email for viruses, vandals and malicious content **
**************************************************************************************************

Received on Wednesday, 29 January 2003 06:08:18 UTC