Subversion Repositories svn.mios

Rev

Rev 628 | Rev 642 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 628 Rev 641
Line 18... Line 18...
18
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
 */
19
 */
20
20
21
package org.midibox.apps.virtualkeyboard;
21
package org.midibox.apps.virtualkeyboard;
22
22
-
 
23
import org.midibox.midi.MidiDeviceManager;
23
import org.midibox.midi.MidiDeviceRouting;
24
import org.midibox.midi.MidiDeviceRouting;
24
import org.midibox.midi.MidiKeyboardControllerDevice;
25
import org.midibox.midi.MidiKeyboardControllerDevice;
25
26
26
public class VirtualKeyboard {
27
public class VirtualKeyboard {
-
 
28
   
-
 
29
    private MidiDeviceManager midiDeviceManager;
27
30
28
    private MidiDeviceRouting midiDeviceRouting;
31
    private MidiDeviceRouting midiDeviceRouting;
29
32
30
    private MidiKeyboardControllerDevice midiKeyboardControllerDevice;
33
    private MidiKeyboardControllerDevice midiKeyboardControllerDevice;
31
34
Line 36... Line 39...
36
        midiKeyboardControllerDevice = new MidiKeyboardControllerDevice(
39
        midiKeyboardControllerDevice = new MidiKeyboardControllerDevice(
37
                "Virtual MIDI Keyboard", 0);
40
                "Virtual MIDI Keyboard", 0);
38
41
39
        midiDeviceRouting.addMidiWriteDevice(midiKeyboardControllerDevice);
42
        midiDeviceRouting.addMidiWriteDevice(midiKeyboardControllerDevice);
40
        midiDeviceRouting.addMidiReadDevice(midiKeyboardControllerDevice);
43
        midiDeviceRouting.addMidiReadDevice(midiKeyboardControllerDevice);
41
        midiDeviceRouting.reorder();
-
 
-
 
44
       
-
 
45
        midiDeviceManager = new MidiDeviceManager();
-
 
46
       
-
 
47
        midiDeviceManager.rescanDevices();
-
 
48
       
-
 
49
        midiDeviceRouting.addMidiReadDevices(midiDeviceManager.getSelectedMidiReadDevices());
-
 
50
        midiDeviceRouting.addMidiWriteDevices(midiDeviceManager.getSelectedMidiWriteDevices());
42
    }
51
    }
43
52
44
    public MidiDeviceRouting getMidiDeviceRouting() {
53
    public MidiDeviceRouting getMidiDeviceRouting() {
45
        return midiDeviceRouting;
54
        return midiDeviceRouting;
46
    }
55
    }