[FIX][KCP] KCP-0083-NewBeepEng
ducasse
ducasse at iam.unibe.ch
Tue Sep 30 15:59:13 UTC 2003
My job is to provide simple audible feedback.
The sound you get can be changed by invoking my class-side method
#setDefault: with any object that implements the #play message.
Use Beeper beep to play the current beep,
Beeper beepPrimitive to play the primitive beep.
Note that #play is introduced to propose a common interface between
AbstractSound and Beeper.
This way we can have more enhanced beepers as illustrated by the
following example:
SampleSound class>>initialize
"SampledSound initialize"
IncrementFractionBits _ 16.
IncrementScaleFactor _ 2 raisedTo: IncrementFractionBits.
ScaledIndexOverflow _ 2 raisedTo: 29. "handle overflow before needing
LargePositiveIntegers"
self useCoffeeCupClink.
SoundLibrary ifNil: [SoundLibrary _ Dictionary new].
Beeper setDefault: (self new
setSamples: self coffeeCupClink
samplingRate: 12000)).
Then Beeper beep will play the coffeeCup sound.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: KCP-0083-NewBeepENG.cs.gz
Type: application/x-gzip
Size: 28693 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20030930/ea603c51/KCP-0083-NewBeepENG.cs.bin
More information about the Squeak-dev
mailing list
|