Nicolas Cellier uploaded a new version of Sound to project The Trunk:
http://source.squeak.org/trunk/Sound-nice.11.mcz==================== Summary ====================
Name: Sound-nice.11
Author: nice
Time: 27 December 2009, 12:45:28 pm
UUID: f7b07a4e-cda6-4860-99d4-1652cac617a4
Ancestors: Sound-ul.10
Cosmetic: move or remove a few temps inside closures
=============== Diff against Sound-ul.10 ===============
Item was changed:
----- Method: ScorePlayerMorph class>>playMidiFile: (in category 'class initialization') -----
playMidiFile: fullName
"Play a MIDI file."
- | f score |
Smalltalk at: #MIDIFileReader ifPresent: [:midiReader |
+ | f score |
f := (FileStream oldFileNamed: fullName) binary.
score := (midiReader new readMIDIFrom: f) asScore.
f close.
self openOn: score title: (FileDirectory localNameFor: fullName)]
!
Item was changed:
----- Method: ScorePlayerMorph>>instrumentChoicesForTrack: (in category 'menu') -----
instrumentChoicesForTrack: trackIndex
+ | names |
- | names inst |
-
names := AbstractSound soundNames asOrderedCollection.
names := names collect: [:n |
+ | inst |
inst := AbstractSound soundNamed: n.
(inst isKindOf: UnloadedSound)
ifTrue: [n, '(out)']
ifFalse: [n]].
names add: 'clink'.
names add: 'edit ', (instrumentSelector at: trackIndex) contents.
^ names asArray
!
Item was changed:
----- Method: SoundInputStream>>nextBufferOrNil (in category 'accessing') -----
nextBufferOrNil
"Answer the next input buffer or nil if no buffer is available."
- | result |
mutex ifNil: [^ nil]. "not recording"
+ ^mutex critical: [
- mutex critical: [
recordedBuffers size > 0
+ ifTrue: [recordedBuffers removeFirst]
+ ifFalse: [nil]].
- ifTrue: [result := recordedBuffers removeFirst]
- ifFalse: [result := nil]].
- ^ result
!
Item was changed:
----- Method: SoundInputStream>>bufferCount (in category 'accessing') -----
bufferCount
"Answer the number of sound buffers that have been queued."
- | n |
mutex ifNil: [^ 0]. "not recording"
+ ^mutex critical: [recordedBuffers size].
- mutex critical: [n := recordedBuffers size].
- ^ n
!
Item was changed:
----- Method: ScorePlayerMorph>>showResumeButtonInTheWorld (in category 'layout') -----
showResumeButtonInTheWorld
-
- | w |
-
WorldState addDeferredUIMessage: [
+ | w |
w := self world.
w ifNotNil: [
w addMorphFront:
(self standaloneResumeButton position: (w right - 100) @ (w top + 10)).
scorePlayer pause.
].
]
!