[squeak-dev] The Trunk: MorphicExtras-ct.305.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Jan 3 22:23:50 UTC 2022
Christoph Thiede uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-ct.305.mcz
==================== Summary ====================
Name: MorphicExtras-ct.305
Author: ct
Time: 3 January 2022, 11:23:47.016397 pm
UUID: 50af01bc-e04f-7441-ac0d-3d7a1fac9363
Ancestors: MorphicExtras-mt.304
Two fixes for MIDI:
- Ignore non-red mouse clicks to MIDIPianoKeyboardMorph
- Honor users of SimpleSwitchMorph that do not take the new state via the actionSelector.
=============== Diff against MorphicExtras-mt.304 ===============
Item was added:
+ ----- Method: PianoKeyboardMorph>>basicMouseDownPitch: (in category 'simple keyboard') -----
+ basicMouseDownPitch: midiKey
+
+ | pitch |
+ pitch := AbstractSound pitchForMIDIKey: midiKey + 23.
+ soundPlaying ifNotNil: [soundPlaying stopGracefully].
+ soundPlaying := soundPrototype soundForPitch: pitch dur: 100.0 loudness: 0.3.
+ SoundPlayer resumePlaying: soundPlaying quickStart: true.!
Item was added:
+ ----- Method: PianoKeyboardMorph>>basicMouseUpPitch: (in category 'simple keyboard') -----
+ basicMouseUpPitch: pitch
+
+ soundPlaying ifNotNil: [soundPlaying stopGracefully].!
Item was changed:
----- Method: PianoKeyboardMorph>>mouseDownPitch:event:noteMorph: (in category 'simple keyboard') -----
mouseDownPitch: midiKey event: event noteMorph: noteMorph
+
- | pitch |
event redButtonPressed ifFalse: [^ self].
event hand hasSubmorphs ifTrue: [^ self "no response if drag something over me"].
event hand mouseFocus ifNil:
["If dragged into me, then establish focus so I'll see moves"
event hand newMouseFocus: noteMorph event: event].
+
noteMorph color: playingKeyColor.
+
+ self basicMouseDownPitch: midiKey.!
- pitch := AbstractSound pitchForMIDIKey: midiKey + 23.
- soundPlaying ifNotNil: [soundPlaying stopGracefully].
- soundPlaying := soundPrototype soundForPitch: pitch dur: 100.0 loudness: 0.3.
- SoundPlayer resumePlaying: soundPlaying quickStart: true.
- !
Item was changed:
----- Method: PianoKeyboardMorph>>mouseUpPitch:event:noteMorph: (in category 'simple keyboard') -----
mouseUpPitch: pitch event: event noteMorph: noteMorph
+ noteMorph color: ((#(0 1 3 5 6 8 10) includes: pitch \\ 12)
+ ifTrue: [whiteKeyColor]
+ ifFalse: [blackKeyColor]).
+
+ self basicMouseUpPitch: pitch.!
- noteMorph color: ((#(0 1 3 5 6 8 10) includes: pitch\\12)
- ifTrue: [whiteKeyColor]
- ifFalse: [blackKeyColor]).
- soundPlaying ifNotNil: [soundPlaying stopGracefully].
- !
Item was changed:
----- Method: SimpleSwitchMorph>>doButtonAction (in category 'button') -----
doButtonAction
"Perform the action of this button. The last argument of the message sent to the target is the new state of this switch."
| newState |
(target notNil and: [actionSelector notNil])
ifTrue:
[newState := color = onColor.
target perform: actionSelector
+ withEnoughArguments: (arguments copyWith: newState)]!
- withArguments: (arguments copyWith: newState)]!
More information about the Squeak-dev
mailing list
|