|Anonymous | Login||01-21-2020 11:06 UTC|
|Main | My View | View Issues | Change Log | Docs|
|Viewing Issue Advanced Details [ Jump to Notes ]||[ View Simple ] [ Issue History ] [ Print ]|
|ID||Category||Severity||Reproducibility||Date Submitted||Last Update|
|0007497||[Squeak] Sound||feature||always||04-09-10 00:44||02-06-11 23:47|
|ETA||none||Fixed in Version||trunk||Product Version|
|Summary||0007497: [FIX][Enh] Sound that name.|
deprecated object methods included #beep:
This kaboshed Beeper beep: 'click' which was my former favored way to produce a sound.
To fix the problem in the spirit of squeak I have added a method #sound to string which will return a playable sound from the sound library or the Beeper default sound.
The method Sting>>#sound is in the *sound-Synthesis category to keep it with SampledSound the owner of SoundLibrary.
|Steps To Reproduce|
'From Squeak4.1beta of 5 April 2010 [latest update: #9885] on 8 April 2010 at 7:52:50 pm'
String methodsFor: '*sound-Synthesis' stamp: 'wiz 4/8/2010 19:52'
"Return a sound. Either from the sound library via SampleSound or else the Beeper default"
^SampledSound soundNamed: self ifAbsent: [ Beeper default ]
String-*sound-Synthesis.st [^] (323 bytes) 04-09-10 00:44
SoundSupportTests.st [^] (1,253 bytes) 04-09-10 20:58
SoundSupportTests.2.cs [^] (1,261 bytes) 05-03-10 04:34
(0013675 - 148 - 204 - 204 - 204 - 204 - 204)
"SampledSound soundNames atRandom sound play"
" 'oops' sound play " (plays Beeper beep)
Yours in curiosity and service, --Jerome Peace
(0013679 - 127 - 151 - 151 - 151 - 151 - 151)
adds simple test for the existance of the String>>#sound selector
and the return of a playable object.
(0013695 - 186 - 198 - 198 - 198 - 198 - 198)
I changed this to feature, because there is no bug to fix as far as I can tell.
Also I guess you will need to mobilize more supporters for your idea on squeak-dev to make this happen.
(0013696 - 181 - 231 - 231 - 231 - 231 - 231)
Just to say, that I wouldn't like the String class to be "polluted" with such "convenience" methods. There would be no end ...
(0013708 - 2263 - 2509 - 2509 - 2509 - 2509 - 2509)
Each to his own opinion.
My take is that in squeak everything is an object. This means that basic classes such as number and string serve as objects. It leads to the following problem:
The number or name of something acts as a modifier, yet if you use the number or name first in squeak it is a receiver. To have a worthwhile language which resembles my speaking language I choose to allow my modifiers to be receivers.
It is stupid IMO to invent classes inorder to use modifiers as argument parameters. In squeak modifiers sometimes belong in the position of receivers.
In this case the problem is the invented and arbitrary class that takes the sound name as an argument was deprecated and nuked. Leaving broken code behind it.
The easy and English sounding way to avoid this is to give the modifier it's rightful place as the receiver of the message.
'click' sound play.
Is IMHO the right way to say lets play a click like sound. It sounds right when you speak it.
I feel very strongly about this.
Any other solution I could propose would involve arbitrary invention and would not be as general.
Who wants to remember what class is responsible for playing a click sound when programming an application. This solution is elegant.
Remember the old class used was Object.
So you could say:
self beep: 'click'
and aviod looking up the sound making class or creating a new object just to play your sound.
Conversion methods are used all the time. While I have seen some warning against using them too readily I have not seen any more elegant solutions.
So I am stating that all strings should be able to make a sound if they so wish.
The #sound method is in charge of knowing what that sound should be. Playing a library sound if one exists of a default sound if one does not. It doesn't belong to the String package it belongs to the Sound package along with the class that keeps the Sound Library. It extends the String classes.
The programmer should be having fun using squeak not a frustrating time trying to find the missing word.
Sorry for the rant. I feel quite strongly about this and dislike the additional hurdles being put in the way of an elegant solution.
Rantingly, --Jerome Peace
(0013716 - 333 - 399 - 399 - 399 - 399 - 399)
I have submitted
Sound-wiz.16 to the inbox.
In case it should prove acceptable.
I am also using this simple case to learn the process of submitting .mcz versions of things.
I am still an MC luddite. So feedback on the process is appreciated as I try to learn more.
Yours in curiosity and service, --Jerome Peace
(0013744 - 135 - 153 - 153 - 153 - 153 - 153)
Fixed. Sound-wiz.18 now in trunk.
To meet Berts demands the selector is called #asSound rather than #sound.
So tests need updating.
(0013745 - 164 - 206 - 206 - 206 - 206 - 206)
edited on: 05-03-10 04:36
Changed selector name in test and class comment
from #sound to asSound
Also submitted changes to inbox as Tests-wiz.75.mcz
(0013746 - 73 - 97 - 97 - 97 - 97 - 97)
Selector has been accepted in trunk.
Tests are in inbox.
|04-09-10 00:44||wiz||New Issue|
|04-09-10 00:44||wiz||File Added: String-*sound-Synthesis.st|
|04-09-10 00:48||wiz||Note Added: 0013675|
|04-09-10 20:58||wiz||File Added: SoundSupportTests.st|
|04-09-10 21:00||wiz||Note Added: 0013679|
|04-13-10 12:19||laza||Note Added: 0013695|
|04-13-10 12:19||laza||Severity||minor => feature|
|04-13-10 12:19||laza||Status||new => acknowledged|
|04-13-10 12:23||laza||Note Added: 0013696|
|04-14-10 00:50||wiz||Note Added: 0013708|
|04-18-10 03:41||wiz||Note Added: 0013716|
|05-03-10 04:20||wiz||Note Added: 0013744|
|05-03-10 04:34||wiz||File Added: SoundSupportTests.2.cs|
|05-03-10 04:35||wiz||Note Added: 0013745|
|05-03-10 04:36||wiz||Note Edited: 0013745|
|05-03-10 04:38||wiz||Status||acknowledged => resolved|
|05-03-10 04:38||wiz||Fixed in Version||=> trunk|
|05-03-10 04:38||wiz||Resolution||open => fixed|
|05-03-10 04:38||wiz||Assigned To||=> wiz|
|05-03-10 04:38||wiz||Note Added: 0013746|
|02-06-11 23:47||leves||Status||resolved => closed|
| Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
82 total queries executed.|
50 unique queries executed.