Smalltalk beep -> XXX beep?

Stephane Ducasse ducasse at iam.unibe.ch
Sun May 11 15:21:24 UTC 2003


Hi andreas

Done see KCP-0067.
I defined beep on SampledSound to avoid to have hardcoded reference and 
a class referring to its subclasses.
An important question is that in ImageSegment I saw:

install
	"This operation retrieves the segment if necessary from file storage, 
installs it in memory, and replaces (using become:) all the root stubs 
with the reconstructed roots of the segment."

	| newRoots |
	state = #onFile ifTrue: [self readFromFile].
	state = #onFileWithSymbols ifTrue: [self readFromFileWithSymbols.
		endMarker _ segment nextObject. 	"for enumeration of objects"
		endMarker == 0 ifTrue: [endMarker _ 'End' clone]].
	(state = #active) | (state = #imported) ifFalse: [self 
errorWrongState].
	newRoots _ self loadSegmentFrom: segment outPointers: outPointers.
	state = #imported
		ifTrue: ["just came in from exported file"
			arrayOfRoots _ newRoots]
		ifFalse: [
			arrayOfRoots elementsForwardIdentityTo: newRoots].
	state _ #inactive.
	self beep.	"Don't use Squeak sound here."


I changed that into

	self beepPrimitive because I felt that this could be a problem to 
invoke it here.

Dan any suggestions?

Stef

PS: I found a way to reproduce the bug that was annoying us on mac with 
nathanael see my next mail




On Sunday, May 11, 2003, at 02:45 PM, Andreas Raab wrote:

> 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