Subversion Repositories svn.mios

Rev

Rev 715 | Rev 723 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 715 Rev 721
Line 22... Line 22...
22
22
23
import java.util.Iterator;
23
import java.util.Iterator;
24
import java.util.Observable;
24
import java.util.Observable;
25
import java.util.Observer;
25
import java.util.Observer;
26
26
27
import javax.sound.midi.MetaMessage;
-
 
28
import javax.sound.midi.MidiDevice;
27
import javax.sound.midi.MidiDevice;
29
import javax.sound.midi.MidiMessage;
-
 
30
import javax.sound.midi.ShortMessage;
28
import javax.sound.midi.ShortMessage;
31
import javax.sound.midi.SysexMessage;
-
 
32
29
33
import org.midibox.midi.MidiDeviceManager;
30
import org.midibox.midi.MidiDeviceManager;
34
import org.midibox.midi.MidiDeviceRouting;
31
import org.midibox.midi.MidiDeviceRouting;
35
import org.midibox.midi.MidiFilterDevice;
32
import org.midibox.midi.MidiFilterDevice;
36
import org.midibox.midi.MidiFilterDeviceManager;
33
import org.midibox.midi.MidiFilterDeviceManager;
37
import org.midibox.midi.MidiKeyboardControllerDevice;
34
import org.midibox.midi.MidiKeyboardControllerDevice;
38
import org.midibox.midi.MidiMonitorFiltered;
35
import org.midibox.midi.MidiMonitorFiltered;
39
import org.midibox.midi.MidiMonitorFilteredDevice;
36
import org.midibox.midi.MidiMonitorFilteredDevice;
40
import org.midibox.midi.MidiRouterDevice;
37
import org.midibox.midi.MidiRouterDevice;
41
import org.midibox.mios.DebugFunctionDevice;
38
import org.midibox.mios.DebugFunctionDevice;
42
import org.midibox.mios.HexFileUpload;
-
 
43
import org.midibox.mios.HexFileUploadDevice;
39
import org.midibox.mios.HexFileUploadDevice;
44
import org.midibox.mios.HexFileUploadDeviceManager;
40
import org.midibox.mios.HexFileUploadDeviceManager;
45
import org.midibox.mios.LCDMessageDevice;
41
import org.midibox.mios.LCDMessageDevice;
46
import org.midibox.mios.MIOSTerminal;
42
import org.midibox.mios.MIOSTerminal;
47
43
48
public class MIOSStudio implements Observer {
44
public class MIOSStudio extends Observable implements Observer {
-
 
45
-
 
46
    public static Object MIDI_THRU_OUT_PORT = new Object();
-
 
47
   
-
 
48
    public static Object ROUTE_INDIVIDUAL_DEVICES = new Object();
49
49
   
50
    protected MidiDeviceRouting midiDeviceRouting;
50
    protected MidiDeviceRouting midiDeviceRouting;
51
51
52
    protected MidiRouterDevice miosStudioInPort;
52
    protected MidiRouterDevice miosStudioInPort;
53
53
Line 167... Line 167...
167
         */
167
         */
168
168
169
        hexFileUploadDeviceManager = new HexFileUploadDeviceManager();
169
        hexFileUploadDeviceManager = new HexFileUploadDeviceManager();
170
170
171
        hexFileUploadDeviceManager.addObserver(this);
171
        hexFileUploadDeviceManager.addObserver(this);
172
-
 
173
        hexFileUploadDeviceManager.newHexFileUploadDevice();
-
 
174
       
172
       
175
        /*
173
        /*
176
         * memoryReadWriteDevice = new MemoryReadWriteDevice( "MIOS Memory
174
         * memoryReadWriteDevice = new MemoryReadWriteDevice( "MIOS Memory
177
         * Read/Write");
175
         * Read/Write");
178
         */
176
         */
Line 317... Line 315...
317
            midiDeviceRouting.connectDevices(midiThruFilterDevice,
315
            midiDeviceRouting.connectDevices(midiThruFilterDevice,
318
                    miosStudioThruPort);
316
                    miosStudioThruPort);
319
        }
317
        }
320
318
321
        setRouteIndividualDevices(routeIndividualDevices);
319
        setRouteIndividualDevices(routeIndividualDevices);
-
 
320
       
-
 
321
        setChanged();
-
 
322
       
-
 
323
        notifyObservers(MIDI_THRU_OUT_PORT);
-
 
324
       
-
 
325
        clearChanged();
322
    }
326
    }
323
327
324
    public MidiRouterDevice getMiosStudioInPort() {
328
    public MidiRouterDevice getMiosStudioInPort() {
325
        return miosStudioInPort;
329
        return miosStudioInPort;
326
    }
330
    }
Line 361... Line 365...
361
                midiDeviceRouting.addMidiReadDevice(miosStudioThruPort);
365
                midiDeviceRouting.addMidiReadDevice(miosStudioThruPort);
362
            }
366
            }
363
        }
367
        }
364
368
365
        reorder();
369
        reorder();
-
 
370
       
-
 
371
        setChanged();
-
 
372
       
-
 
373
        notifyObservers(ROUTE_INDIVIDUAL_DEVICES);
-
 
374
       
-
 
375
        clearChanged();
366
    }
376
    }
367
377
368
    public void reorder() {
378
    public void reorder() {
369
379
370
        midiDeviceRouting.getMidiReadDevices().removeAll(
380
        midiDeviceRouting.getMidiReadDevices().removeAll(