Smalltalk beep -> XXX beep?

Andreas Raab andreas.raab at gmx.de
Sun May 11 12:45:12 UTC 2003


Stef,

I think this should be factored along the lines of:

[Object|SystemDictionary]>>primitiveBeep
	"beep in the absence of sound support"
	<primitive: 140>

Object>>beep
	"if sound system is present use it otherwise do whatever we can"
	Smalltalk at: #AbstractSound 
			ifPresent:[:snd| snd beep]
			ifAbsent:[ (self|Smalltalk) primitiveBeep].

AbstractSound class>>beep
	"beep in the presence of the sound system.
	this method may still #primitiveBeep if sound
	support is disabled or doesn't work or whatever"
	(SampledSound new
			setSamples: sampledSound coffeeCupClink
			samplingRate: 12000) play.

(note that primitive 140 lives entirely outside the sound system)

Cheers,
  - Andreas

> -----Original Message-----
> From: squeak-dev-bounces at lists.squeakfoundation.org 
> [mailto:squeak-dev-bounces at lists.squeakfoundation.org] On 
> Behalf Of Stephane Ducasse
> Sent: Sunday, May 11, 2003 2:35 PM
> To: The list
> Subject: Smalltalk beep -> XXX beep?
> 
> 
> Hi
> 
> have you any idea where would be the best place for defining beep?
> Object? as it is already defined there.
> 
> Any other better idea? I was thinking that we may want to do 
> beep even 
> when the sound
> related classes are not loaded.
> 
> Stef
> 
> 



More information about the Squeak-dev mailing list