uc.putProperty(UserConfiguration.KEYBOARD_IN_DEVICE, keyInIndex);
if (keyInIndex > 0) {
keyInfo = keyboardInBoxModel.getSelectedItem();
}
try {
MidiDevice inDev;
inDev = MidiSystem.getMidiDevice(inInfo);
if (inDev.getMaxTransmitters() == 0) {
JOptionPane.showMessageDialog(getParentDialog(), bdl
.getString("message.no_transmitter"), bdl
.getString("title.midi_init_failed"),
JOptionPane.ERROR_MESSAGE);
}
MidiDevice outDev = MidiSystem.getMidiDevice(outInfo);
if (outDev.getMaxReceivers() == 0) {
JOptionPane.showMessageDialog(getParentDialog(), bdl
.getString("message.no_receiver"), bdl
.getString("title.midi_init_failed"),
JOptionPane.ERROR_MESSAGE);
}
if (keyInfo == null) {
flag = MidiThread.getInstance().init(inDev, outDev);
} else {
MidiDevice keyDev = MidiSystem.getMidiDevice(keyInfo);
if (keyDev.getMaxTransmitters() == 0) {
JOptionPane.showMessageDialog(getParentDialog(), bdl
.getString("message.no_transmitter"), bdl
.getString("title.midi_init_failed"),
JOptionPane.ERROR_MESSAGE);
}