VM Maker: VMMaker.oscog-eem.2786.mcz

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

VM Maker: VMMaker.oscog-eem.2786.mcz

commits-2
 
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2786.mcz

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

Name: VMMaker.oscog-eem.2786
Author: eem
Time: 5 August 2020, 11:36:00.348057 am
UUID: 4a2487b6-5a6f-4baa-bd3a-534337e78564
Ancestors: VMMaker.oscog-eem.2785

SoundPlugin: Fix a regression in primitiveSoundPlaySamples:from:startingAt: from VMMaker.oscog-eem.2785.

=============== Diff against VMMaker.oscog-eem.2785 ===============

Item was changed:
  ----- Method: SoundPlugin>>primitiveSoundInsertSamples:from:leadTime: (in category 'primitives') -----
  primitiveSoundInsertSamples: frameCount from: buf leadTime: leadTime
  "Insert a buffer's worth of sound samples into the currently playing  
  buffer. Used to make a sound start playing as quickly as possible. The  
  new sound is mixed with the previously buffered sampled."
  "Details: Unlike primitiveSoundPlaySamples, this primitive always starts  
  with the first sample the given sample buffer. Its third argument  
  specifies the number of samples past the estimated sound output buffer  
  position the inserted sound should start. If successful, it returns the  
  number of samples inserted."
  | framesPlayed |
  self primitive: 'primitiveSoundInsertSamples'
  parameters: #(SmallInteger WordArray SmallInteger).
+ (self cCoerce: frameCount to: #usqInt) > (interpreterProxy slotSizeOf: buf cPtrAsOop) ifTrue:
- frameCount <= (interpreterProxy slotSizeOf: buf cPtrAsOop) ifFalse:
  [^interpreterProxy primitiveFailFor: PrimErrBadArgument].
 
  framesPlayed := self snd_InsertSamplesFromLeadTime: frameCount _: buf _: leadTime.
  framesPlayed >= 0
  ifTrue: [interpreterProxy methodReturnInteger: framesPlayed]
  ifFalse: [interpreterProxy primitiveFail]!

Item was changed:
  ----- Method: SoundPlugin>>primitiveSoundPlaySamples:from:startingAt: (in category 'primitives') -----
  primitiveSoundPlaySamples: frameCount from: buf startingAt: startIndex
  "Output a buffer's worth of sound samples."
  | framesPlayed |
  self primitive: 'primitiveSoundPlaySamples'
  parameters: #(SmallInteger WordArray SmallInteger).
+ (startIndex >= 1 and: [startIndex + frameCount - 1 <= (interpreterProxy slotSizeOf: buf cPtrAsOop)]) ifFalse:
- (startIndex >= 1 and: [startIndex + frameCount - 1 <= (interpreterProxy slotSizeOf: buf cPtrAsOop)]) ifTrue:
  [^interpreterProxy primitiveFailFor: PrimErrBadArgument].
 
  framesPlayed := self snd_PlaySamplesFromAtLength: frameCount _: buf _: startIndex - 1.
  framesPlayed >= 0
  ifTrue: [interpreterProxy methodReturnInteger: framesPlayed]
  ifFalse: [interpreterProxy primitiveFail]!