A lurkers ravings (was RE: Smalltalk beep -> XXX beep?) (anothertry)

Stephane Ducasse ducasse at iam.unibe.ch
Wed May 14 18:06:50 UTC 2003


>
> Why not simply add as a convenience method:
>
> TranscriptStream>>beep
> 	"Make a default beep."
>
> 	Beeper beep
>
> ...or something like that? I do think I like to have the Beeper class -
> since it would create a nice place to set what the default behaviour
> should be, which sound if any etc.
>
> But perhaps we should have a Singleton pattern here so that Beeper has 
> a
> single instance of itself that it uses. So essentially you would do:
>
> Beeper default beep
>
> ...which would give the possibility of putting a completely different
> Beeper instance in place - for example a silent one or one that writes
> on stdout etc.
>
>

This was exactly what we had in mind

This way Sound could change the default instance to produce a nice sound

SampledSound class>>loaded
	Beeper setDefault: self soundForBeep

Beeper>>play
	self beep

Beeper>>beep
	<primitive>

Or we should find a way to have a the same interface
so may be it should be

Beeper play	

> Beeper class>>beep
>
> 	self default beep
>
>
> regards, Göran
>
> PS. Sorry if I repeated stuff people already have written - I didn't
> take the time to read the thread too closely.
>



More information about the Squeak-dev mailing list