David T. Lewis uploaded a new version of Chronology-Core to project The Trunk:
http://source.squeak.org/trunk/Chronology-Core-dtl.57.mcz
==================== Summary ====================
Name: Chronology-Core-dtl.57
Author: dtl
Time: 5 September 2020, 11:37:48.320554 am
UUID: a2e27812-3d4b-4db0-b3ce-e1371c1c895b
Ancestors: Chronology-Core-ul.55
Clean up a leftover FIXME in DateAndTime>>asTimeStamp
=============== Diff against Chronology-Core-ul.55 ===============
Item was changed:
----- Method: DateAndTime>>asTimeStamp (in category 'squeak protocol') -----
asTimeStamp
+ ^ self as: TimeStamp!
- ^ self
- asDateAndTime "FIXME LX hack for test support"
- as: TimeStamp!
Fabio Niephaus uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ct.1677.mcz
==================== Summary ====================
Name: Morphic-ct.1677
Author: ct
Time: 22 August 2020, 7:34:52.856555 pm
UUID: 094ccc97-c3f6-364c-a10d-7418b3482703
Ancestors: Morphic-mt.1674
Nuke backward compatibility for Squeak 2.x menus. This should really not be relevant any longer I think. ;-)
Also minor refactoring to MenuItemMorph >> #invokeWithEvent:.
=============== Diff against Morphic-mt.1674 ===============
Item was changed:
----- Method: MenuItemMorph>>invokeWithEvent: (in category 'events') -----
invokeWithEvent: evt
"Perform the action associated with the given menu item."
- | w |
self isEnabled ifFalse: [^ self].
+
+ (owner notNil and: [self isStayUpItem not]) ifTrue: [
- target class == HandMorph ifTrue: [(self notObsolete) ifFalse: [^ self]].
- owner ifNotNil:[self isStayUpItem ifFalse:[
self flag: #workAround. "The tile system invokes menus straightforwardly so the menu might not be in the world."
+ self world ifNotNil: [:world |
- (w := self world) ifNotNil:[
owner deleteIfPopUp: evt.
"Repair damage before invoking the action for better feedback"
+ world displayWorldSafely]].
+
+ selector ifNil: [^ self].
+
+ Cursor normal showWhile: [
+ "show cursor in case item opens a new MVC window"
+ selector numArgs isZero
+ ifTrue: [target perform: selector]
+ ifFalse: [target perform: selector withArguments: (
+ selector numArgs = arguments size
+ ifTrue: [arguments]
+ ifFalse: [arguments copyWith: evt] )] ].!
- w displayWorldSafely]]].
- selector ifNil:[^self].
- Cursor normal showWhile: [ | selArgCount | "show cursor in case item opens a new MVC window"
- (selArgCount := selector numArgs) = 0
- ifTrue:
- [target perform: selector]
- ifFalse:
- [selArgCount = arguments size
- ifTrue: [target perform: selector withArguments: arguments]
- ifFalse: [target perform: selector withArguments: (arguments copyWith: evt)]]].!
Item was removed:
- ----- Method: MenuItemMorph>>notObsolete (in category 'private') -----
- notObsolete
- "Provide backward compatibility with messages being sent to the Hand. Remove this when no projects made prior to 2.9 are likely to be used. If this method is removed early, the worst that can happen is a notifier when invoking an item in an obsolete menu."
-
- (HandMorph canUnderstand: (selector)) ifTrue: [^ true]. "a modern one"
-
- self inform: 'This world menu is obsolete.
- Please dismiss the menu and open a new one.'.
- ^ false
- !
Fabio Niephaus uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-LM.1678.mcz
==================== Summary ====================
Name: Morphic-LM.1678
Author: LM
Time: 3 September 2020, 12:58:35.620287 pm
UUID: d1262531-fd1c-43a1-ba41-9ff8b3728a3a
Ancestors: Morphic-ct.1677
Prevent users from creating multiple SystemProgressMorphs by abusing uniqueInstance.
Currently the UniqueInstance class variable is not set properly when it is nil, which allows the user to call it multiple times to generate many SystemProgressMorphs, defeating the purpose of having a *unique* instance.
=============== Diff against Morphic-mt.1674 ===============
Item was changed:
----- Method: MenuItemMorph>>invokeWithEvent: (in category 'events') -----
invokeWithEvent: evt
"Perform the action associated with the given menu item."
- | w |
self isEnabled ifFalse: [^ self].
+
+ (owner notNil and: [self isStayUpItem not]) ifTrue: [
- target class == HandMorph ifTrue: [(self notObsolete) ifFalse: [^ self]].
- owner ifNotNil:[self isStayUpItem ifFalse:[
self flag: #workAround. "The tile system invokes menus straightforwardly so the menu might not be in the world."
+ self world ifNotNil: [:world |
- (w := self world) ifNotNil:[
owner deleteIfPopUp: evt.
"Repair damage before invoking the action for better feedback"
+ world displayWorldSafely]].
+
+ selector ifNil: [^ self].
+
+ Cursor normal showWhile: [
+ "show cursor in case item opens a new MVC window"
+ selector numArgs isZero
+ ifTrue: [target perform: selector]
+ ifFalse: [target perform: selector withArguments: (
+ selector numArgs = arguments size
+ ifTrue: [arguments]
+ ifFalse: [arguments copyWith: evt] )] ].!
- w displayWorldSafely]]].
- selector ifNil:[^self].
- Cursor normal showWhile: [ | selArgCount | "show cursor in case item opens a new MVC window"
- (selArgCount := selector numArgs) = 0
- ifTrue:
- [target perform: selector]
- ifFalse:
- [selArgCount = arguments size
- ifTrue: [target perform: selector withArguments: arguments]
- ifFalse: [target perform: selector withArguments: (arguments copyWith: evt)]]].!
Item was removed:
- ----- Method: MenuItemMorph>>notObsolete (in category 'private') -----
- notObsolete
- "Provide backward compatibility with messages being sent to the Hand. Remove this when no projects made prior to 2.9 are likely to be used. If this method is removed early, the worst that can happen is a notifier when invoking an item in an obsolete menu."
-
- (HandMorph canUnderstand: (selector)) ifTrue: [^ true]. "a modern one"
-
- self inform: 'This world menu is obsolete.
- Please dismiss the menu and open a new one.'.
- ^ false
- !
Item was changed:
----- Method: SystemProgressMorph class>>uniqueInstance (in category 'instance creation') -----
uniqueInstance
+
+ ^ UniqueInstance ifNil: [UniqueInstance := super new]!
- ^UniqueInstance ifNil:[super new]!
David T. Lewis uploaded a new version of Sound to project The Trunk:
http://source.squeak.org/trunk/Sound-ct.71.mcz
==================== Summary ====================
Name: Sound-ct.71
Author: ct
Time: 1 September 2020, 2:07:15.07999 am
UUID: 0d91a1bf-41cb-834c-ab0c-fa2ad832e408
Ancestors: Sound-nice.69
Fixes wave sound streaming on non-filestream objects. The endianness was inverted because #int16: already uses Big Endian. This did not sound well - listen yourself in an unpatched image: :-)
array := ByteArray streamContents: [:stream |
PluckedSound bachFugue storeWAVSamplesOn: stream].
(FileStream fileNamed: 'bachFugue.wav') binary in: [:stream |
[array do: [:ea | stream nextPut: ea]]
ensure: [stream close]].
(SampledSound fromWaveFileNamed: 'bachFugue.wav') play.
Please review in detail as this is one of my first contacts to the Sound system!
=============== Diff against Sound-nice.69 ===============
Item was changed:
----- Method: AbstractSound>>storeSampleCount:bigEndian:on: (in category 'file i/o') -----
storeSampleCount: samplesToStore bigEndian: bigEndianFlag on: aBinaryStream
"Store my samples on the given stream at the current SoundPlayer sampling rate. If bigFlag is true, then each 16-bit sample is stored most-significant byte first (AIFF files), otherwise it is stored least-significant byte first (WAV files). If self isStereo is true, both channels are stored, creating a stereo file. Otherwise, only the left channel is stored, creating a mono file."
+ | bufSize stereoBuffer reverseBytes streamDirect |
- | bufSize stereoBuffer reverseBytes |
self reset.
bufSize := (2 * self samplingRate rounded) min: samplesToStore. "two second buffer"
stereoBuffer := SoundBuffer newStereoSampleCount: bufSize.
+ streamDirect := aBinaryStream isKindOf: StandardFileStream.
+ reverseBytes := (bigEndianFlag xor: Smalltalk isBigEndian) xor: streamDirect not.
- reverseBytes := bigEndianFlag ~= (Smalltalk isBigEndian).
'Storing audio...'
displayProgressFrom: 0 to: samplesToStore during: [:bar | | remaining out |
remaining := samplesToStore.
[remaining > 0] whileTrue: [
bar value: samplesToStore - remaining.
stereoBuffer primFill: 0. "clear the buffer"
self playSampleCount: (bufSize min: remaining) into: stereoBuffer startingAt: 1.
out := self isStereo
ifTrue: [stereoBuffer]
ifFalse: [stereoBuffer extractLeftChannel].
reverseBytes ifTrue: [out reverseEndianness].
+ streamDirect
- (aBinaryStream isKindOf: StandardFileStream)
ifTrue: [ "optimization for files: write sound buffer directly to file"
aBinaryStream next: (out size // 2) putAll: out startingAt: 1] "size in words"
ifFalse: [ "for non-file streams:"
1 to: out monoSampleCount do: [:i | aBinaryStream int16: (out at: i)]].
+ remaining := remaining - bufSize]].!
- remaining := remaining - bufSize]].
- !