*/
public static Sequencer getDefaultSequencer() {
for (MidiDeviceProvider provider : providers) {
for (MidiDevice.Info info : provider.getDeviceInfo()) {
MidiDevice device = provider.getDevice(info);
String name = null;
try {
byte[] bytes = info.getName().getBytes("ISO8859-1");
name = new String(bytes /* , "Windows-31J" */);
} catch (IOException e) {
Debug.println(e);
}
if (Sequencer.class.isInstance(device)) {
if (sequencerDeviceName != null) {
if (sequencerDeviceName.equals(name)) {
Debug.println("default sequencer: " + provider.getClass().getName() + ", " + device.getClass().getName() + ", " + name + ", " + device.hashCode());
return (Sequencer) device;
}
} else {
if (device.getClass().getName().equals(sequencerClassName)) {
Debug.println("default sequencer: " + provider.getClass().getName() + ", " + device.getClass().getName() + ", " + name + ", " + device.hashCode());
return (Sequencer) device;
}
}
}
}