Eliot Miranda uploaded a new version of Sound to project The Trunk:
http://source.squeak.org/trunk/Sound-eem.81.mcz
==================== Summary ====================
Name: Sound-eem.81
Author: eem
Time: 26 May 2021, 12:03:03.709521 pm
UUID: 43c1e089-1145-4a27-b5b8-f35e872fc99a
Ancestors: Sound-eem.80
Better meterFrom:count:in:
=============== Diff against Sound-eem.80 ===============
Item was changed:
----- Method: SoundRecorder>>meterFrom:count:in: (in category 'private') -----
meterFrom: start count: count in: buffer
"Update the meter level with the maximum signal level in the given range of the given buffer."
+ | max sample min |
+ count = 0 ifTrue: [^self]. "no new samples"
+ max := min := 0.
+ start to: start + count - 1 do:
+ [:i |
- | last max sample |
- count = 0 ifTrue: [^ self]. "no new samples"
- last := start + count - 1.
- max := 0.
- start to: last do: [:i |
sample := buffer at: i.
+ sample > max
+ ifTrue: [max := sample]
+ ifFalse:
+ [sample < min ifTrue: [min := sample]]].
+ meterLevel := max max: min negated!
- sample < 0 ifTrue: [sample := sample negated].
- sample > max ifTrue: [max := sample]].
- meterLevel := max.
- !
Marcel Taeumel uploaded a new version of FFI-Kernel to project FFI:
http://source.squeak.org/FFI/FFI-Kernel-mt.173.mcz
==================== Summary ====================
Name: FFI-Kernel-mt.173
Author: mt
Time: 26 May 2021, 6:43:06.758386 pm
UUID: a4390742-4fe7-0a44-b077-b39954d28611
Ancestors: FFI-Kernel-mt.172
Adds a singleton interface to ExternalLibrary.
=============== Diff against FFI-Kernel-mt.172 ===============
Item was changed:
ExternalObject subclass: #ExternalLibrary
instanceVariableNames: 'name'
classVariableNames: ''
poolDictionaries: ''
category: 'FFI-Kernel'!
+ ExternalLibrary class
+ instanceVariableNames: 'default'!
+ !ExternalLibrary commentStamp: 'mt 6/8/2020 13:21' prior: 0!
- !ExternalLibrary commentStamp: '<historical>' prior: 0!
An external library bundles calls to functions from the same library. It is provided mainly as convenience since every external function can be fully specified by the name and the module it resides in.
+ Every external function that is defined in an external library by default will use the library it is defined in. This can always be modified by providing the appropriate module in the specification.
+
+ Note that you will only get a valid handle *automatically* for the library if the module has not yet been loaded when making the first FFI call. After that, new instances of me must call #forceLoading to get the handle right. Consequently, it is advised to only have a single instance of your external library to reliably check #isLoaded.!
+ ExternalLibrary class
+ instanceVariableNames: 'default'!
- Every external function that is defined in an external library by default will use the library it is defined in. This can always be modified by providing the appropriate module in the specification. !
Item was added:
+ ----- Method: ExternalLibrary class>>clearAllCaches (in category 'system startup') -----
+ clearAllCaches
+
+ self withAllSubclassesDo: [:libraryClass |
+ libraryClass clearCaches].!
Item was added:
+ ----- Method: ExternalLibrary class>>clearCaches (in category 'system startup') -----
+ clearCaches
+
+ self resetDefault.!
Item was added:
+ ----- Method: ExternalLibrary class>>default (in category 'instance access') -----
+ default
+
+ ^ default ifNil: [default := self new]!
Item was added:
+ ----- Method: ExternalLibrary class>>platformChangedFrom:to: (in category 'system startup') -----
+ platformChangedFrom: oldPlatform to: newPlatform
+
+ self clearAllCaches.!
Item was added:
+ ----- Method: ExternalLibrary class>>resetDefault (in category 'instance creation') -----
+ resetDefault
+
+ default := nil.!
Item was changed:
----- Method: FFIPlatformDescription class>>startUp: (in category 'system startup') -----
startUp: resuming
"Notify all FFI classes about platform changes."
resuming ifTrue: [
LastPlatform in: [:lastPlatform | self newCurrent in: [:currentPlatform |
lastPlatform = currentPlatform
ifTrue: [
self flag: #discuss. "mt: Maybe add #platformResuming?"
ExternalAddress allBeNull.
ExternalType cleanupUnusedTypes ]
ifFalse: [
LastPlatform := currentPlatform. "Update now. See #current."
+ { ExternalAddress. ExternalType. ExternalStructure. ExternalPool. ExternalLibrary }
- { ExternalAddress. ExternalType. ExternalStructure. ExternalPool }
do: [:cls | cls
platformChangedFrom: lastPlatform
to: currentPlatform] ]]].
self checkFFIOnStartUp ifTrue: [self checkFFI].
self checkCStandardLibraryOnStartUp ifTrue: [self checkCStandardLibrary]].!