Custom Timing Layer
In addition to the scripts created to handle the soundtrack, scripts were also written to handle the need for custom timing described previously in the Design Decisions section of this paper. The timing scripts had to provide an asynchronous method for pausing a given number of seconds without interfering with any user actions, such as clicking on a button or accessing the menu bar. The functions also had to provide a mechanism for adjusting to the reading speed of the user. Figure 10 illustrates the functions created to do this.
The function ReadingIdle() is called from within the Movie script's on...idle handler and is used to determine if the previously specified delay time has expired. If it has, it simply advances to the next frame in the score. The SetReadingSpeed() function is called from the menu bar when a new reading speed is selected. Finally, StartReadingDelay() actually starts the timer for the current delay. The function stores the current frame so that ReadingIdle() can be sure that it needs to pay attention to the delay. (Simply setting gTimedFrame to zero is enough to temporarily disable the delay mechanism.)
Throughout the project score, on every frame that requires a delay, a frame script is used based on the following example:
Every time the frame is entered, it calls StartReadingDelay() in the Movie's script to begin the delay timer if it has not already been started. When the frame exits, the on...exitFrame handler simply redirects the program back to the same frame, thus causing the Director project to loop on the current frame. This continues until the ReadingIdle() function finally notices the end of the delay period and sends the project to the next frame in the score. During this time, of course, the navigational controls can be used to exit the current frame, as well. Throughout the 24 Hours project, frame scripts like the one above are used to control the appearance of word balloons, images, and animations, all to match the preferences of the reader.
Last modified 6/11/97.