Nicolas Cellier uploaded a new version of Sound to project The Trunk:
http://source.squeak.org/trunk/Sound-nice.13.mcz==================== Summary ====================
Name: Sound-nice.13
Author: nice
Time: 20 March 2010, 8:13:09.158 am
UUID: 7a167e23-4789-d44b-86fc-f6fb7df7aaab
Ancestors: Sound-nice.12
1) Let add: answer the added object argument
2) remove a fixTemp
=============== Diff against Sound-nice.12 ===============
Item was changed:
----- Method: SequentialSound>>add: (in category 'composition') -----
add: aSound
sounds := sounds copyWith: aSound.
+ ^aSound
!
Item was changed:
----- Method: MixedSound>>add: (in category 'composition') -----
add: aSound
"Add the given sound with a pan setting of centered and no attenuation."
self add: aSound pan: 0.5 volume: 1.0.
+ ^aSound
!
Item was changed:
----- Method: ScorePlayer>>adjustVolumeTo:overMSecs: (in category 'volume') -----
adjustVolumeTo: vol overMSecs: mSecs
| normalizedVolume incr block |
normalizedVolume := (vol asFloat min: 1.0) max: 0.0.
incr := (self overallVolume - normalizedVolume) / mSecs * 50.0.
block := normalizedVolume > 0.0
ifTrue: [
[[(normalizedVolume - self overallVolume) abs > 0.01] whileTrue: [self overallVolume: self overallVolume - incr. (Delay forMilliseconds: 50) wait]]]
ifFalse: [
[[self overallVolume > 0.0] whileTrue: [self overallVolume: self overallVolume - incr. (Delay forMilliseconds: 50) wait]. self pause]].
+ block fork
- block fixTemps; fork
!
Item was changed:
----- Method: SequentialSound>>duration (in category 'accessing') -----
duration
"Answer the duration of this sound in seconds."
"7 dec 2000 - handle compressed sounds. better way??"
+ ^sounds inject: 0 into: [:totalDuration :snd | totalDuration + snd asSound duration]!
- | dur |
- dur := 0.
- sounds do: [:snd | dur := dur + snd asSound duration].
- ^ dur
- !