The Trunk: Sound-nice.9.mcz

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

The Trunk: Sound-nice.9.mcz

commits-2
Nicolas Cellier uploaded a new version of Sound to project The Trunk:
http://source.squeak.org/trunk/Sound-nice.9.mcz

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

Name: Sound-nice.9
Author: nice
Time: 21 October 2009, 1:16:22 am
UUID: 8ca92662-3e34-4271-8ea8-cb299375fb59
Ancestors: Sound-nice.8

Use #keys rather than #fasterKeys
Note that pattern (x keys asArray sort) could as well be written (x keys sort) now that keys returns an Array...
This #asArray is here solely for cross-dialect/fork compatibility.

=============== Diff against Sound-nice.8 ===============

Item was changed:
  ----- Method: PianoRollScoreMorph>>mouseMove: (in category 'event handling') -----
  mouseMove: evt
 
  | noteMorphs chordRect sound |
  soundsPlaying ifNil: [^ self].
  self autoScrollForX: evt cursorPoint x.
 
  "Play all notes at the cursor time"
  noteMorphs := self notesInRect: ((evt cursorPoint extent: 1@0) expandBy: 0@self height).
  chordRect := (self innerBounds withLeft: evt cursorPoint x) withWidth: 1.
  soundsPlayingMorph delete.
  soundsPlayingMorph := Morph newBounds: chordRect color: Color green.
  self addMorphBack: soundsPlayingMorph.
 
  noteMorphs do:
  [:m |  "Add any new sounds"
  (soundsPlaying includesKey: m)
  ifFalse: [sound := m soundOfDuration: 999.0.
  soundsPlaying at: m put: sound.
  SoundPlayer resumePlaying: sound quickStart: false]].
+ soundsPlaying keys do:
- soundsPlaying fasterKeys do:
  [:m |  "Remove any sounds no longer in selection."
  (noteMorphs includes: m)
  ifFalse: [(soundsPlaying at: m) stopGracefully.
  soundsPlaying removeKey: m]].
 
  !

Item was changed:
  ----- Method: AbstractSound class>>updateFMSounds (in category 'sound library') -----
  updateFMSounds
  "AbstractSound updateFMSounds"
 
+ Sounds keys do: [:k |
- Sounds fasterKeys do: [:k |
  ((Sounds at: k) isKindOf: FMSound) ifTrue: [
  Sounds removeKey: k ifAbsent: []]].
 
  (FMSound class organization listAtCategoryNamed: #instruments) do:
  [:sel | Sounds at: sel asString put: (FMSound perform: sel)].
  !

Item was changed:
  ----- Method: AbstractSound class>>unloadSampledTimbres (in category 'sound library-file in/out') -----
  unloadSampledTimbres
  "This can be done to unload those bulky sampled timbres to shrink the image. The unloaded sounds are replaced by a well-known 'unloaded sound' object to enable the unloaded sounds to be detected when the process is reversed."
  "AbstractSound unloadSampledTimbres"
 
+ Sounds keys do: [:soundName |
- Sounds fasterKeys do: [:soundName |
  (((Sounds at: soundName) isKindOf: SampledInstrument) or:
  [(Sounds at: soundName) isKindOf: LoopedSampledSound]) ifTrue: [
  Sounds at: soundName put: self unloadedSound]].
  self updateScorePlayers.
  Smalltalk garbageCollect.
  !

Item was changed:
  ----- Method: SampledSound class>>soundNames (in category 'sound library') -----
  soundNames
  "Answer a list of sound names for the sounds stored in the sound library."
  "| s |
  SampledSound soundNames asSortedCollection do: [:n |
  n asParagraph display.
  s := SampledSound soundNamed: n.
  s ifNotNil: [s playAndWaitUntilDone]]"
 
+ ^ SoundLibrary keys asArray
- ^ SoundLibrary fasterKeys
  !

Item was changed:
  ----- Method: AbstractSound class>>soundNames (in category 'sound library') -----
  soundNames
 
+ ^ Sounds keys asArray sort
- ^ Sounds fasterKeys sort
  !