Augh...
Mark Guzdial
guzdial at cc.gatech.edu
Mon Oct 1 17:33:26 UTC 2001
At 7:33 PM -0500 10/1/01, Daniel Joyce wrote:
> Okay, how I play a sound under Squeak?
The top of the Sound hierarchy is AbstractSound. The process that
actually plays sounds is in SoundPlayer.
>
> What class is used by the system to play sounds when morphs are
>added/removed?
It's in TrashCanMorph (code at bottom). Here's how I found it:
- I found Morph>>delete
- I looked up the Senders of that, then looked for access via
HandMorph, since I know that HandMorph handles halos.
- Tracing from that code, I found that TrashCanMorph actually makes the sound:
> I find it sad that for a system that supports so much easy
>OOP, that things
>are not terribly clean, or refactored.
Fortunately, there are great tools for wandering the image.
> A) I'd like to know the best place to look on where sounds
>are played, and
>how they are stored in Squeak ( what's the buffer used? ).
The buffer is SoundBuffer.
You can find lots on the Sound classes in Squeak at
http://swiki.cc.gatech.edu:8080/compMusic/ActiveEssays starting at
the FM Synthesis essay but also including the Sampling essay.
moveToTrash: aMorph
Preferences soundsEnabled ifTrue:
[Preferences preserveTrash
ifFalse:
[self playSoundNamed: 'scratch']
ifTrue:
[self playDeleteSound]].
aMorph delete.
aMorph == Utilities scrapsBook ifFalse:
[Utilities addToTrash: aMorph]
Mark
--------------------------
Mark Guzdial : Georgia Tech : College of Computing : Atlanta, GA 30332-0280
Associate Professor - Learning Sciences & Technologies.
Collaborative Software Lab - http://coweb.cc.gatech.edu/csl/
(404) 894-5618 : Fax (404) 894-0673 : guzdial at cc.gatech.edu
http://www.cc.gatech.edu/gvu/people/Faculty/Mark.Guzdial.html
More information about the Squeak-dev
mailing list
|