[squeak-dev] The Trunk: Sound-bf.31.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Jul 11 09:57:05 UTC 2011
Bert Freudenberg uploaded a new version of Sound to project The Trunk:
http://source.squeak.org/trunk/Sound-bf.31.mcz
==================== Summary ====================
Name: Sound-bf.31
Author: bf
Time: 11 July 2011, 11:56:46.198 am
UUID: 9113a678-f0af-4e29-b86b-1ca6bebbd622
Ancestors: Sound-cmm.30
fix up sound player refactoring
=============== Diff against Sound-cmm.30 ===============
Item was changed:
----- Method: SoundPlayer class>>playLoop (in category 'player process') -----
playLoop
"The sound player process loop."
| bytesPerSlice count willStop mayStop |
+ mayStop := self stopSoundWhenDone.
- mayStop := self soundStopWhenDone.
bytesPerSlice := Stereo ifTrue: [4] ifFalse: [2].
[
[(count := self primSoundAvailableBytes // bytesPerSlice) > 100]
whileFalse: [ReadyForBuffer wait].
count := count min: Buffer stereoSampleCount.
PlayerSemaphore critical: [
ActiveSounds := ActiveSounds select: [:snd | snd samplesRemaining > 0].
ActiveSounds do: [:snd |
snd ~~ SoundJustStarted ifTrue: [
snd playSampleCount: count into: Buffer startingAt: 1]].
ReverbState == nil ifFalse: [
ReverbState applyReverbTo: Buffer startingAt: 1 count: count].
self primSoundPlaySamples: count from: Buffer startingAt: 1.
willStop := mayStop and:[
(ActiveSounds size = 0) and:[
self isAllSilence: Buffer size: count]].
LastBuffer ifNotNil:[
LastBuffer replaceFrom: 1 to: LastBuffer size with: Buffer startingAt: 1.
].
willStop
ifTrue:[self shutDown. PlayerProcess := nil]
ifFalse:[Buffer primFill: 0].
SoundJustStarted := nil].
willStop ifTrue:[^self] ] repeat
!
More information about the Squeak-dev
mailing list
|