[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

synchronizing sound and removing and adding subviews



Hello,

Is there a way to tell MCL to hold of processing a function until it has
finished adding or removing subviews?
I am having the following problem.

Everytime I add subviews or remove subviews from a window and then play a
sound file (either asynchronous or synchronous) MCL stops adding or
removing the subviews and starts playing the sound file.  This creates a
problem because if I have the following code

 (set-back-color  window *blue-color*)
 (add-subviews window assistant-writer)
 (goto-beginning-of-movie assistant-writer)
 (play-movie assistant-writer)
 (remove-subviews window assistant-writer))
 (cheap-sound-play  "play-song")

    

The events happen in the following order: 
 1)The video starts playing before the back color of the window has been
set to blue
 2)When the video finishes the sound file is played
 3)When the sound file finishes the window is set to blue
 4)The video is removed from the window

The order I want to happen in is as follows:
1)window set to blue
2)video played
3)video  removed from window
4)sound file played

I initially thought that playing the sound file asynchronously would solve
the problem unfortunately it doesn't.
Regardless of  the manor in which I play the sound file I want to MCL to
wait before it calls the function until it has finished removing or adding
subviews.  Thus I want

 (set-back-color  window *blue-color*)
   (how-button window)
 *wait until views added or removed**
  (cheap-sound-play  "play-song")
___________________________________________________________________________

Nichole Denise Pinkard
The Institute for the Learning Sciences
Northwestern University
e-mail: pinkard@ils.nwu.edu
___________________________________________________________________________