Subversion Repositories svn.mios

Rev

Rev 628 | Rev 642 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
628 adamjking 1
package org.midibox.apps.miosstudiosid;
2
 
641 adamjking 3
import java.util.Observable;
4
 
628 adamjking 5
import org.midibox.apps.SIDV2librarian.SIDV2librarian;
6
 
7
public class MIOSStudioSID extends org.midibox.apps.miosstudio.MIOSStudio {
8
 
9
    private SIDV2librarian sidv2librarian;
10
 
11
    public SIDV2librarian getSidv2librarian() {
12
 
13
        return sidv2librarian;
14
    }
15
 
16
    protected void createDevices() {
17
 
18
        super.createDevices();
19
 
641 adamjking 20
        sidv2librarian = new SIDV2librarian(null, null);
628 adamjking 21
 
22
        sidv2librarian.getSIDLibController().addObserver(this);
23
    }
24
 
25
    protected void routeIndividualDevices() {
26
 
27
        super.routeIndividualDevices();
28
 
29
        midiDeviceRouting.addMidiWriteDevice(sidv2librarian
30
                .getSysExControllerDevice());
31
        midiDeviceRouting.addMidiReadDevice(sidv2librarian
32
                .getSysExControllerDevice());
33
    }
34
 
35
    public void connectDevices() {
36
 
37
        super.connectDevices();
38
 
39
        midiDeviceRouting.connectDevices(miosStudioInPort, sidv2librarian
40
                .getSysExControllerDevice());
41
        midiDeviceRouting.connectDevices(sidv2librarian
42
                .getSysExControllerDevice(), miosStudioOutPort);
43
    }
641 adamjking 44
 
45
    public void update(Observable observable, Object object) {
46
 
47
        super.update(observable, object);
48
 
49
        if (object == "Edit") {
50
 
51
            boolean portsReleased = midiDeviceRouting.getPortsReleased();
52
 
53
            if (!portsReleased) {
54
                midiDeviceRouting.setPortsReleased(true);
55
                midiDeviceRouting.setPortsReleased(false);
56
            }
57
        }
58
    }
628 adamjking 59
}