Marcel Taeumel uploaded a new version of Sound to project The Trunk:
http://source.squeak.org/trunk/Sound-mt.51.mcz
==================== Summary ====================
Name: Sound-mt.51
Author: mt
Time: 6 April 2016, 6:04:45.917125 pm
UUID: ee88ba13-414b-8e49-ba8e-2a0c42a9b886
Ancestors: Sound-mt.50
Fixes MIDI support wrt. to using real MIDI devices and CMD+Dot behavior. Keep sounds and music playing when only snapshotting but not quitting the image.
=============== Diff against Sound-mt.50 ===============
Item was changed:
----- Method: BaseSoundSystem>>shutDown (in category 'misc') -----
shutDown
+
+ SoundPlayer shutDown: true.
+ ScorePlayer shutDown: true.!
- SoundPlayer shutDown
- !
Item was added:
+ ----- Method: MIDISound>>play (in category 'as yet unclassified') -----
+ play
+ "The base class ScorePlayer has two interfaces: a sound and a sound player. Choose the right interface depending on whether MIDI support is present."
+
+ SimpleMIDIPort useMIDIDeviceForOutput ifTrue: [
+ [self openMIDIPort]
+ on: Error
+ do: [
+ SimpleMIDIPort askForDefault.
+ self openMIDIPort]].
+
+ self reset; resumePlaying.!
Item was added:
+ ----- Method: ScorePlayer class>>initialize (in category 'as yet unclassified') -----
+ initialize
+
+ Smalltalk addToShutDownList: self.!
Item was added:
+ ----- Method: ScorePlayer class>>shutDown: (in category 'snapshotting') -----
+ shutDown: quitting
+
+ quitting ifTrue: [
+ ScorePlayer allSubInstancesDo: [:ea | [ea stopMIDIPlaying] on: Error do: [] ] ].!
Item was added:
+ ----- Method: ScorePlayer>>openMIDIPort (in category 'midi output') -----
+ openMIDIPort
+
+ midiPort := SimpleMIDIPort openDefault.!
Item was changed:
Object subclass: #SimpleMIDIPort
instanceVariableNames: 'portNumber accessSema lastCommandByteOut'
+ classVariableNames: 'DefaultPortNumber InterfaceClockRate UseMIDIDeviceForOutput'
- classVariableNames: 'DefaultPortNumber InterfaceClockRate'
poolDictionaries: ''
category: 'Sound-Scores'!
!SimpleMIDIPort commentStamp: '<historical>' prior: 0!
This is a first cut at a simple MIDI output port.
!
Item was added:
+ ----- Method: SimpleMIDIPort class>>anyPortNumFromUser (in category 'utilities') -----
+ anyPortNumFromUser
+
+ ^ UIManager default
+ chooseFrom: ((0 to: self primPortCount - 1) collect:[:i| self portDescription: i])
+ values: (0 to: self primPortCount - 1)
+ title: 'MIDI port for default usage:' translated
+ !
Item was added:
+ ----- Method: SimpleMIDIPort class>>askForDefault (in category 'utilities') -----
+ askForDefault
+ "self askForDefault"
+
+ self anyPortNumFromUser ifNotNil: [:num |
+ DefaultPortNumber := num].!
Item was added:
+ ----- Method: SimpleMIDIPort class>>useMIDIDeviceForOutput (in category 'preferences') -----
+ useMIDIDeviceForOutput
+
+ <preference: 'Use MIDI device for output'
+ category: #media
+ description: 'If true, will try to open a native MIDI device when playing MIDI scores.'
+ type: #Boolean>
+ ^ UseMIDIDeviceForOutput ifNil: [false]!
Item was added:
+ ----- Method: SimpleMIDIPort class>>useMIDIDeviceForOutput: (in category 'preferences') -----
+ useMIDIDeviceForOutput: boolean
+
+ UseMIDIDeviceForOutput := boolean.!
Item was changed:
----- Method: SimpleMIDIPort>>midiCmd:channel:byte: (in category 'output') -----
midiCmd: cmd channel: channel byte: dataByte
+ "Immediately output the given MIDI command with the given channel and argument byte to this MIDI port. Assume that the port is open."
- "Immediately output the given MIDI command with the given channel and
- argument byte to this MIDI port. Assume that the port is open."
accessSema critical: [
+ self primMIDIWritePort: portNumber
- self primMIDIWriteNoErrorPort: portNumber
from: (ByteArray
with: (cmd bitOr: channel)
with: dataByte)
at: 0].
!
Item was changed:
----- Method: SimpleMIDIPort>>midiCmd:channel:byte:byte: (in category 'output') -----
midiCmd: cmd channel: channel byte: dataByte1 byte: dataByte2
+ "Immediately output the given MIDI command with the given channel and argument bytes to this MIDI port. Assume that the port is open."
- "Immediately output the given MIDI command with the given channel
- and argument bytes to this MIDI port. Assume that the port is open."
accessSema critical: [
+ self primMIDIWritePort: portNumber
- self primMIDIWriteNoErrorPort: portNumber
from: (ByteArray
with: (cmd bitOr: channel)
with: dataByte1
with: dataByte2)
at: 0].
!
Item was removed:
- ----- Method: SoundPlayer class>>shutDown (in category 'snapshotting') -----
- shutDown
- "Stop player process, for example before snapshotting."
-
- self stopPlayerProcess.
- ReverbState := nil.
- !
Item was added:
+ ----- Method: SoundPlayer class>>shutDown: (in category 'snapshotting') -----
+ shutDown: quitting
+ "Stop player process, for example before snapshotting."
+
+ quitting ifTrue: [
+ self stopPlayerProcess.
+ ReverbState := nil].!
On 06.04.2016, at 08:28, commits(a)source.squeak.org wrote:
> Marcel Taeumel uploaded a new version of Sound to project The Trunk:
> http://source.squeak.org/trunk/Sound-mt.49.mcz
>
> ==================== Summary ====================
>
> Name: Sound-mt.49
> Author: mt
> Time: 6 April 2016, 10:28:46.469834 am
> UUID: a2a341f2-f4d3-b946-a104-0e5f59c1554c
> Ancestors: Sound-mt.48
>
> Adds code for conveniently playing MIDIs stored in the file system. Compares with Form class.
\o/
BTW: this makes Squeak the only convenient midi player on mac ;P
Best
-tobias
>
> =============== Diff against Sound-mt.48 ===============
>
> Item was added:
> + ScorePlayer subclass: #MIDISound
> + instanceVariableNames: ''
> + classVariableNames: ''
> + poolDictionaries: ''
> + category: 'Sound-Scores'!
> +
> + !MIDISound commentStamp: 'mt 4/6/2016 10:19' prior: 0!
> + This empty class just makes the fact explicit that this object is a sound object that needs can be played. Just like other sounds.
> +
> + Example: (MIDISound fromFileNamed: 'some.mid') play!
>
> Item was added:
Marcel Taeumel uploaded a new version of Sound to project The Trunk:
http://source.squeak.org/trunk/Sound-mt.50.mcz
==================== Summary ====================
Name: Sound-mt.50
Author: mt
Time: 6 April 2016, 1:07:48.224625 pm
UUID: 07f087d1-3449-4f4d-a243-7bf79a49b90e
Ancestors: Sound-mt.49
Use this sound system by default if there is no other sound system used already.
=============== Diff against Sound-mt.49 ===============
Item was changed:
----- Method: AbstractSound>>play (in category 'playing') -----
play
"Play this sound to the sound output port in real time. Use the sound service to check for sound preferences."
+ SoundService playSound: self.!
- SoundService play: self.!
Item was changed:
----- Method: BaseSoundSystem class>>initialize (in category 'class initialization') -----
initialize
+
+ SoundService register: self.
+
+ SoundService defaultOrNil
+ ifNil: [SoundService default: self].!
- SoundService register: self.!
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.811.mcz
==================== Summary ====================
Name: System-mt.811
Author: mt
Time: 6 April 2016, 11:16:15.706625 am
UUID: 582451db-f36b-ca41-8510-d3b5505f8e8d
Ancestors: System-mt.810
Make start-up scripts work also in othere GUIs.
=============== Diff against System-mt.810 ===============
Item was changed:
----- Method: AutoStart class>>startUp: (in category 'initialization') -----
startUp: resuming
"The image is either being newly started (resuming is true), or it's just been snapshotted.
If this has just been a snapshot, skip all the startup stuff."
| startupParameters launchers |
self active ifTrue: [^self].
self active: true.
resuming ifFalse: [^self].
HTTPClient determineIfRunningInBrowser.
startupParameters := Smalltalk namedArguments.
(startupParameters includesKey: 'apiSupported' asUppercase )
ifTrue: [
HTTPClient browserSupportsAPI: ((startupParameters at: 'apiSupported' asUppercase) asUppercase = 'TRUE').
HTTPClient isRunningInBrowser
ifFalse: [HTTPClient isRunningInBrowser: true]].
"Some images might not have the UpdateStream package."
((self respondsTo: #checkForUpdates) and: [self checkForUpdates]) ifTrue: [^self].
self checkForPluginUpdate.
launchers := self installedLaunchers collect: [:launcher |
launcher new].
launchers do: [:launcher |
launcher parameters: startupParameters].
launchers do: [:launcher |
+ Project current addDeferredUIMessage: [launcher startUp]]!
- Smalltalk at: #WorldState ifPresent: [ :ws | ws addDeferredUIMessage: [launcher startUp]]]!
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.810.mcz
==================== Summary ====================
Name: System-mt.810
Author: mt
Time: 6 April 2016, 11:05:30.468095 am
UUID: 8d6172bc-5f9e-af49-b88f-4c74141fdd38
Ancestors: System-mt.809
Migration complete. Revert implementation of #isMorphic.
=============== Diff against System-mt.809 ===============
Item was changed:
----- Method: SmalltalkImage>>isMorphic (in category 'snapshot and quit') -----
isMorphic
+
+ ^ Project current isMorphic!
- "Temporary implementation."
-
- ^ (Project current respondsTo: #isMorphic) not or: [Project current isMorphic]!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1101.mcz
==================== Summary ====================
Name: Morphic-mt.1101
Author: mt
Time: 6 April 2016, 10:55:47.896095 am
UUID: 8f859759-097e-ec4c-80ce-4894b2ef62a7
Ancestors: Morphic-mt.1100
Adds #isMorphic as extension to Project.
=============== Diff against Morphic-mt.1100 ===============
Item was added:
+ ----- Method: Project>>isMorphic (in category '*Morphic-testing') -----
+ isMorphic
+ "Complexity is because #isMVC is lazily installed"
+ ^ world isInMemory
+ ifTrue: [world isMorph]
+ ifFalse: [(self projectParameters at: #isMVC ifAbsent: [false]) not]!