Subversion Repositories svn.mios

Rev

Rev 739 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 739 Rev 808
Line 22... Line 22...
22
22
23
import javax.sound.midi.MidiDevice;
23
import javax.sound.midi.MidiDevice;
24
24
25
import org.midibox.midi.MidiDeviceManager;
25
import org.midibox.midi.MidiDeviceManager;
26
import org.midibox.midi.MidiDeviceRouting;
26
import org.midibox.midi.MidiDeviceRouting;
-
 
27
import org.midibox.midi.VirtualMidiDevice;
27
import org.midibox.sidlibr.SIDLibController;
28
import org.midibox.sidlibr.SIDLibController;
28
import org.midibox.sidlibr.SysExControllerDevice;
29
import org.midibox.sidlibr.SysExController;
29
30
30
public class SIDV2Editor {
31
public class SIDV2Editor {
31
32
32
    private MidiDeviceRouting midiDeviceRouting;
33
    private MidiDeviceRouting midiDeviceRouting;
33
    private SysExControllerDevice sysexControllerDevice;
34
    private SysExController sysexController;
-
 
35
    private VirtualMidiDevice sysexControllerDevice;
34
    private SIDLibController sidLibController;
36
    private SIDLibController sidLibController;
35
37
36
    private MidiDevice localMidiDevice;
38
    private MidiDevice localMidiDevice;
37
    private MidiDevice inputMidiDevice;
39
    private MidiDevice inputMidiDevice;
38
    private MidiDevice outputMidiDevice;
40
    private MidiDevice outputMidiDevice;
Line 49... Line 51...
49
51
50
        this.midiDeviceManager = midiDeviceManager;
52
        this.midiDeviceManager = midiDeviceManager;
51
53
52
        this.midiDeviceRouting = midiDeviceRouting;
54
        this.midiDeviceRouting = midiDeviceRouting;
53
55
-
 
56
        sysexControllerDevice = new VirtualMidiDevice("MidiBox SID V2 Editor",
-
 
57
                -1, -1);
54
        sysexControllerDevice = new SysExControllerDevice(
58
        sysexController = new SysExController(sysexControllerDevice
55
                "MidiBox SID V2 Editor");
59
                .getMidiOutReceiver());
-
 
60
        sysexControllerDevice.setMidiInReceiver(sysexController);
56
61
57
        this.localMidiDevice = sysexControllerDevice;
62
        this.localMidiDevice = sysexControllerDevice;
58
63
59
        sidLibController = new SIDLibController(sysexControllerDevice
64
        sidLibController = new SIDLibController(sysexController);
60
                .getSysExController());
-
 
61
65
62
        if (midiDeviceRouting != null) {
66
        if (midiDeviceRouting != null) {
63
            midiDeviceManager.rescanDevices();
67
            midiDeviceManager.rescanDevices();
64
            midiDeviceRouting.addMidiReadDevices(midiDeviceManager
68
            midiDeviceRouting.addMidiReadDevices(midiDeviceManager
65
                    .getSelectedMidiReadDevices().values());
69
                    .getSelectedMidiReadDevices().values());
Line 74... Line 78...
74
78
75
    public MidiDeviceRouting getMidiDeviceRouting() {
79
    public MidiDeviceRouting getMidiDeviceRouting() {
76
        return midiDeviceRouting;
80
        return midiDeviceRouting;
77
    }
81
    }
78
82
79
    public SysExControllerDevice getSysExControllerDevice() {
83
    public SysExController getSysExController() {
-
 
84
        return sysexController;
-
 
85
    }
-
 
86
-
 
87
    public VirtualMidiDevice getSysexControllerDevice() {
80
        return sysexControllerDevice;
88
        return sysexControllerDevice;
81
    }
89
    }
82
90
83
    public SIDLibController getSIDLibController() {
91
    public SIDLibController getSIDLibController() {
84
        return sidLibController;
92
        return sidLibController;