The Trunk: Sound-dtl.25.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-dtl.25.mcz

commits-2
David T. Lewis uploaded a new version of Sound to project The Trunk:
http://source.squeak.org/trunk/Sound-dtl.25.mcz

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

Name: Sound-dtl.25
Author: dtl
Time: 24 October 2010, 1:01:43.002 pm
UUID: 5c164c71-a94e-452d-a78a-96e936f3a920
Ancestors: Sound-nice.24

Use pragma declarations in methods that are translated to C in MiscPrimitivePlugin. Supports removal of Object>>inline: and Object>>var:declareC: from trunk.

=============== Diff against Sound-nice.24 ===============

Item was changed:
  ----- Method: SampledSound class>>convert8bitSignedFrom:to16Bit: (in category 'utilities') -----
  convert8bitSignedFrom: aByteArray to16Bit: aSoundBuffer
  "Copy the contents of the given array of signed 8-bit samples into the given array of 16-bit signed samples."
 
  | n s |
  <primitive: 'primitiveConvert8BitSigned' module: 'MiscPrimitivePlugin'>
+ <var: #aByteArray declareC: 'unsigned char *aByteArray'>
+ <var: #aSoundBuffer declareC: 'unsigned short *aSoundBuffer'>
- self var: #aByteArray declareC: 'unsigned char *aByteArray'.
- self var: #aSoundBuffer declareC: 'unsigned short *aSoundBuffer'.
  n := aByteArray size.
  1 to: n do: [:i |
  s := aByteArray at: i.
  s > 127
  ifTrue: [aSoundBuffer at: i put: ((s - 256) bitShift: 8)]
  ifFalse: [aSoundBuffer at: i put: (s bitShift: 8)]].
  !