VM Maker: VMMaker.oscog-eem.2813.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.2813.mcz

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

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

Name: VMMaker.oscog-eem.2813
Author: eem
Time: 24 September 2020, 1:32:51.839224 pm
UUID: c2ac4e4a-d7a9-49ef-92b0-200a234f2dfa
Ancestors: VMMaker.oscog-eem.2812

Fix primitiveSoundEnableAEC and simplify primitiveSoundSupportsAEC.
Make the simulator cope with timestamped events.

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

Item was changed:
  ----- Method: CogVMSimulator>>ioGetNextEvent: (in category 'I/O primitives') -----
  ioGetNextEvent: evtBuf
  | evt |
  "SimulatorMorphicModel browse"
  eventQueue ifNil:
  [^self primitiveFail].
  eventQueue isEmpty ifFalse:
  [evt :=  eventQueue next.
  1 to: evt size do:
+ [:i|
+ (evt at: i) ifNotNil:
+ [:val|
+ evtBuf
+ at: i - 1
+ put: (i = 2 ifTrue: [val bitAnd: MillisecondClockMask] ifFalse: [val])]]]!
- [:i| (evt at: i) ifNotNil: [:val| evtBuf at: (i - 1) put: val]]]!

Item was changed:
  ----- Method: SoundPlugin>>primitiveSoundEnableAEC (in category 'primitives') -----
  primitiveSoundEnableAEC
  "Enable or disable acoustic echo-cancellation (AEC).
  Arg is a boolean or 1 for true and 0 for false."
  <export: true>
  | arg trueOrFalse errorCode |
  interpreterProxy methodArgumentCount = 1 ifFalse:
  [^interpreterProxy primitiveFailFor: PrimErrBadNumArgs].
  "Parse arguments"
  (interpreterProxy isIntegerObject: (arg := interpreterProxy stackValue: 0))
  ifTrue:
  [arg := interpreterProxy integerValueOf: arg.
  (interpreterProxy cCoerce: arg to: #unsigned) > 1 ifTrue:
  [^interpreterProxy primitiveFailFor: PrimErrBadArgument].
  trueOrFalse := arg = 1]
  ifFalse:
  [(interpreterProxy isBooleanObject: arg) ifFalse:
  [^interpreterProxy primitiveFailFor: PrimErrBadArgument].
  trueOrFalse := interpreterProxy booleanValueOf: arg].
  "Set AEC"
  (errorCode := self snd_EnableAEC: trueOrFalse) ~= 0 ifTrue:
+ [interpreterProxy primitiveFailFor: (errorCode < 0 ifTrue: [PrimErrGenericFailure] ifFalse: [errorCode])].
+ interpreterProxy methodReturnReceiver!
- [interpreterProxy primitiveFailFor: (errorCode < 0 ifTrue: [PrimErrGenericFailure] ifFalse: [errorCode])]!

Item was changed:
  ----- Method: SoundPlugin>>primitiveSoundSupportsAEC (in category 'primitives') -----
  primitiveSoundSupportsAEC
  "Answer if the OS/hardware supports echo-cancellation."
  <export: true>
+ interpreterProxy methodReturnBool: self snd_SupportsAEC ~= 0!
- | result |
- result := self snd_SupportsAEC.
- interpreterProxy failed ifFalse:
- [interpreterProxy methodReturnBool: result ~= 0]!