[squeak-dev] The Inbox: Sound-wiz.18.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Apr 28 20:08:43 UTC 2010


A new version of Sound was added to project The Inbox:
http://source.squeak.org/inbox/Sound-wiz.18.mcz

==================== Summary ====================

Name: Sound-wiz.18
Author: wiz
Time: 28 April 2010, 4:08:23.052 pm
UUID: 234c49bf-dace-4b55-83b1-beee75a189de
Ancestors: Sound-nice.15

Ok this is a resubmission of String>>sound now names
String>>#asSound in compliance with Bert's preference.

I have fixed the nits. 

I have discussed why I believe this is the right word rather than asSound on the mailing list. Squeak-dev 2010. I have not heard back from Bert. He still is in favor of this form over my preference.  Authority matters so we are now in compliance.
Usage:

"'click' asSound play" will play a click sound from the sound library.
Any name missing from the sound library will return a default sound to be played. Currently the default is the same as Beeper default.

The purpose of the selector is to be a facade to allow access to sounds by name. Currently this only covers the Sampled Sound sound library and the default sound. 

However, the contract is only that
" 'name' asSound "
return a playable object. So in the future this could be expanded to check other sound libraries as well before relying on the default.

=============== Diff against Sound-nice.15 ===============

Item was added:
+ ----- Method: String>>asSound (in category '*sound-synthesis') -----
+ asSound
+ 	"Return a sound. Either from the sound library via SampleSound or
+ 	else the Beeper default"
+ 	^ SampledSound
+ 		soundNamed: self
+ 		ifAbsent: [Beeper default]!




More information about the Squeak-dev mailing list