The Inbox: Sound-wiz.16.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: Sound-wiz.16.mcz

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

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

Name: Sound-wiz.16
Author: wiz
Time: 17 April 2010, 11:35:32.041 pm
UUID: 5d77f8ac-ffc8-4496-8f5a-06b31e8248e6
Ancestors: Sound-nice.15

This adds String>>#sound.

Typical usage:

"'click' sound play"

The reciever is a string name. Usually a key into
Sound Library.

The answer is a playable object. Usually a sampled sound from the sound library. In the absence of a findable key a default sound will be returned. Currently this is Beeper default.

This method's purpose is to act as a facade for the sound system hiding the details of where the sound is actually stored.

Its contract is to always return something playable.

Conceivably in the future it could check several other dictionaries returning the first playable object found for a key equal to the receiver.

Presently the motivation for the command was to replace the now nuked and formerly deprecated
"Beeper beep: 'click'"

The Beeper class protocol inherited the deprecated method from Object>>class.

This is also my (wiz) Jerome Peaces first attempt to submit a package to the inbox. So in that sense it is a test for me.

Cheers --Jer

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

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


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Sound-wiz.16.mcz

Bert Freudenberg
On 18.04.2010, at 03:35, [hidden email] wrote:
>
> A new version of Sound was added to project The Inbox:
> http://source.squeak.org/inbox/Sound-wiz.16.mcz
>
> This adds String>>#sound.
>
> This is also my (wiz) Jerome Peaces first attempt to submit a package to the inbox. So in that sense it is a test for me.

Yay! Great that you made your way through Monticello :)

Technically the submission is good, that's how you can prepare your next submission too.

But you seem to have missed the discussion that we do not want it to be named #sound, but #asSound. Please resubmit.

Also, please use proper indention - everything except the method pattern needs to be indented one tab. If you are unsure about how to properly indent, choose "pretty print" from the shifted context menu, then edit to your liking. In this particular method, I personally would only indent the two lines with one tab each and leave it at that.

And as I'm picking nits, a really minor one is that you should use all lower-case for the category :)

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

Thanks!

- Bert -