Subversion Repositories svn.mios

Rev

Rev 628 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 628 Rev 641
Line 20... Line 20...
20
20
21
package org.midibox.apps.SIDV2librarian;
21
package org.midibox.apps.SIDV2librarian;
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.MidiDeviceRouting;
26
import org.midibox.midi.MidiDeviceRouting;
26
import org.midibox.sidlibr.SIDLibController;
27
import org.midibox.sidlibr.SIDLibController;
27
import org.midibox.sidlibr.SysExControllerDevice;
28
import org.midibox.sidlibr.SysExControllerDevice;
28
29
29
public class SIDV2librarian {
30
public class SIDV2librarian {
Line 33... Line 34...
33
    private SIDLibController sidLibController;
34
    private SIDLibController sidLibController;
34
35
35
    private MidiDevice localMidiDevice;
36
    private MidiDevice localMidiDevice;
36
    private MidiDevice inputMidiDevice;
37
    private MidiDevice inputMidiDevice;
37
    private MidiDevice outputMidiDevice;
38
    private MidiDevice outputMidiDevice;
-
 
39
   
-
 
40
    private MidiDeviceManager midiDeviceManager;
38
41
39
    public SIDV2librarian() {
42
    public SIDV2librarian() {
40
43
41
        this(new MidiDeviceRouting());
-
 
-
 
44
        this(new MidiDeviceManager(), new MidiDeviceRouting());
42
    }
45
    }
43
46
44
    public SIDV2librarian(MidiDeviceRouting midiDeviceRouting) {
-
 
-
 
47
    public SIDV2librarian(MidiDeviceManager midiDeviceManager, MidiDeviceRouting midiDeviceRouting) {
45
48
-
 
49
        this.midiDeviceManager = midiDeviceManager;
-
 
50
       
46
        this.midiDeviceRouting = midiDeviceRouting;
51
        this.midiDeviceRouting = midiDeviceRouting;
47
52
48
        sysexControllerDevice = new SysExControllerDevice(
53
        sysexControllerDevice = new SysExControllerDevice(
49
                "MidiBox SID V2 Editor");
54
                "MidiBox SID V2 Editor");
50
55
Line 52... Line 57...
52
57
53
        sidLibController = new SIDLibController(sysexControllerDevice
58
        sidLibController = new SIDLibController(sysexControllerDevice
54
                .getSysExController());
59
                .getSysExController());
55
60
56
        if (midiDeviceRouting != null) {
61
        if (midiDeviceRouting != null) {
57
            midiDeviceRouting.getMidiDeviceManager().rescanDevices();
-
 
58
-
 
59
            midiDeviceRouting.reorder();
-
 
-
 
62
            midiDeviceManager.rescanDevices();
-
 
63
            midiDeviceRouting.addMidiReadDevices(midiDeviceManager.getSelectedMidiReadDevices());
-
 
64
            midiDeviceRouting.addMidiWriteDevices(midiDeviceManager.getSelectedMidiWriteDevices());
60
        }
65
        }
-
 
66
    }
-
 
67
-
 
68
    public MidiDeviceManager getMidiDeviceManager() {
-
 
69
        return midiDeviceManager;
61
    }
70
    }
62
71
63
    public MidiDeviceRouting getMidiDeviceRouting() {
72
    public MidiDeviceRouting getMidiDeviceRouting() {
64
        return midiDeviceRouting;
73
        return midiDeviceRouting;
65
    }
74
    }