[Etoys] sound player shutdown when initiating painting

Bert Freudenberg bert at freudenbergs.de
Thu Nov 30 08:32:37 EST 2006


On Nov 30, 2006, at 14:15 , Scott Wallace wrote:

> I just noticed that playback of sound using the EventRecorder stops  
> abruptly if the event-recording includes a painting session.  Just  
> before the paint palette appears on playback, sound playback simply  
> stops.
>
> I've tracked this down to the recent addition of WorldStethoscope  
> code, in which a "SoundPlayer shutDown" call was added to  
> PasteUpMorph >> stopRunningAll.
>
> So it seems that either #stopRunningAll should be restored to its  
> original functionality, which was to suspend all ticking scripts  
> but not to mess with sound playback, or else we can change the get- 
> ready-to-paint code so that it no longer calls #stopRunningAll, but  
> instead calls some to-be-written method that does the original  
> intended work of #stopRunningAll, but without the additional  
> clobbering of sound.
>
> What do you think?

I guess this has to do with the addition of a generic sound slot in  
players. There is a new "sound" category in tile viewers, which  
allows to start and stop playing a sound of a specific frequency.  
Very cool in my opinion, I used that for the sound project I sent  
around.

Now, if you use that, those sounds would not stop automatically when  
stopping scripts. They do not even stop when you delete the object,  
which is a bug I think. So instead of shutting down SoundPlayer, one  
might want to go through all scripted morphs and only stop their  
sounds. Or modify the code to have a central registry of playing  
sounds to avoid iterating through all players.

On a related note, we might think of a more general way to suspend  
and resume sound. The activation/deactivation code in SugarLauncher  
also shuts down SoundPlayer. Thus, if you switch activities while a  
sound is playing, it will stop, and not automatically resume when  
switching back. I have not found a method in SoundPlayer that would  
allow this suspending without removing all active sounds.

In fact, I think we should use the same method on a project level -  
when entering a project, resume playing all sounds as they were when  
we left the project. Anyone wants to tackle this?

Another faintly related Todo item is the transparent saving of a  
project - that is, export a project without user interaction, and  
later resume where we were. We need that for the automatic saving in  
the OLPC's journal. I wonder if ImageSegments would help here, I  
would certainly hope so for speed reasons. But they would have too  
work without saving the image itself.

- Bert -





More information about the Etoys mailing list