javax.sound.midi.MidiDevice.Info Java Examples

The following examples show how to use javax.sound.midi.MidiDevice.Info. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Midi2WavRenderer.java    From computoser with GNU Affero General Public License v3.0 7 votes vote down vote up
public static AudioSynthesizer findAudioSynthesizer() throws MidiUnavailableException, IOException, InvalidMidiDataException {
    // First check if default synthesizer is AudioSynthesizer.
    Synthesizer synth = MidiSystem.getSynthesizer();
    if (synth instanceof AudioSynthesizer) {
        return (AudioSynthesizer) synth;
    }

    // If default synhtesizer is not AudioSynthesizer, check others.
    Info[] infos = MidiSystem.getMidiDeviceInfo();
    for (int i = 0; i < infos.length; i++) {
        MidiDevice dev = MidiSystem.getMidiDevice(infos[i]);
        if (dev instanceof AudioSynthesizer) {
            return (AudioSynthesizer) dev;
        }
    }

    // No AudioSynthesizer was found, return null.
    return null;
}
 
Example #2
Source File: GetDevice.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    SoftProvider provider = new SoftProvider();
    Info[] infos = provider.getDeviceInfo();
    assertTrue(infos.length > 0);
    for (int i = 0; i < infos.length; i++) {
        assertTrue(infos[i] != null);
        MidiDevice d = provider.getDevice(infos[i]);
        assertTrue(d instanceof SoftSynthesizer);
    }
    assertTrue(provider.getDevice(new FakeInfo()) == null);

}
 
Example #3
Source File: GetDevice.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    SoftProvider provider = new SoftProvider();
    Info[] infos = provider.getDeviceInfo();
    assertTrue(infos.length > 0);
    for (int i = 0; i < infos.length; i++) {
        assertTrue(infos[i] != null);
        MidiDevice d = provider.getDevice(infos[i]);
        assertTrue(d instanceof SoftSynthesizer);
    }
    assertTrue(provider.getDevice(new FakeInfo()) == null);

}
 
Example #4
Source File: GetDevice.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    SoftProvider provider = new SoftProvider();
    Info[] infos = provider.getDeviceInfo();
    assertTrue(infos.length > 0);
    for (int i = 0; i < infos.length; i++) {
        assertTrue(infos[i] != null);
        MidiDevice d = provider.getDevice(infos[i]);
        assertTrue(d instanceof SoftSynthesizer);
    }
    assertTrue(provider.getDevice(new FakeInfo()) == null);

}
 
Example #5
Source File: GetDevice.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    SoftProvider provider = new SoftProvider();
    Info[] infos = provider.getDeviceInfo();
    assertTrue(infos.length > 0);
    for (int i = 0; i < infos.length; i++) {
        assertTrue(infos[i] != null);
        MidiDevice d = provider.getDevice(infos[i]);
        assertTrue(d instanceof SoftSynthesizer);
    }
    assertTrue(provider.getDevice(new FakeInfo()) == null);

}
 
Example #6
Source File: GetDevice.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    SoftProvider provider = new SoftProvider();
    Info[] infos = provider.getDeviceInfo();
    assertTrue(infos.length > 0);
    for (int i = 0; i < infos.length; i++) {
        assertTrue(infos[i] != null);
        MidiDevice d = provider.getDevice(infos[i]);
        assertTrue(d instanceof SoftSynthesizer);
    }
    assertTrue(provider.getDevice(new FakeInfo()) == null);

}
 
Example #7
Source File: GetDevice.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    SoftProvider provider = new SoftProvider();
    Info[] infos = provider.getDeviceInfo();
    assertTrue(infos.length > 0);
    for (int i = 0; i < infos.length; i++) {
        assertTrue(infos[i] != null);
        MidiDevice d = provider.getDevice(infos[i]);
        assertTrue(d instanceof SoftSynthesizer);
    }
}
 
Example #8
Source File: GetDevice.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    SoftProvider provider = new SoftProvider();
    Info[] infos = provider.getDeviceInfo();
    assertTrue(infos.length > 0);
    for (int i = 0; i < infos.length; i++) {
        assertTrue(infos[i] != null);
        MidiDevice d = provider.getDevice(infos[i]);
        assertTrue(d instanceof SoftSynthesizer);
    }
    assertTrue(provider.getDevice(new FakeInfo()) == null);

}
 
Example #9
Source File: GetDevice.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    SoftProvider provider = new SoftProvider();
    Info[] infos = provider.getDeviceInfo();
    assertTrue(infos.length > 0);
    for (int i = 0; i < infos.length; i++) {
        assertTrue(infos[i] != null);
        MidiDevice d = provider.getDevice(infos[i]);
        assertTrue(d instanceof SoftSynthesizer);
    }
    assertTrue(provider.getDevice(new FakeInfo()) == null);

}
 
Example #10
Source File: GetDevice.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    SoftProvider provider = new SoftProvider();
    Info[] infos = provider.getDeviceInfo();
    assertTrue(infos.length > 0);
    for (int i = 0; i < infos.length; i++) {
        assertTrue(infos[i] != null);
        MidiDevice d = provider.getDevice(infos[i]);
        assertTrue(d instanceof SoftSynthesizer);
    }
    assertTrue(provider.getDevice(new FakeInfo()) == null);

}
 
Example #11
Source File: GetDevice.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    SoftProvider provider = new SoftProvider();
    Info[] infos = provider.getDeviceInfo();
    assertTrue(infos.length > 0);
    for (int i = 0; i < infos.length; i++) {
        assertTrue(infos[i] != null);
        MidiDevice d = provider.getDevice(infos[i]);
        assertTrue(d instanceof SoftSynthesizer);
    }
    assertTrue(provider.getDevice(new FakeInfo()) == null);

}
 
Example #12
Source File: GetDevice.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    SoftProvider provider = new SoftProvider();
    Info[] infos = provider.getDeviceInfo();
    assertTrue(infos.length > 0);
    for (int i = 0; i < infos.length; i++) {
        assertTrue(infos[i] != null);
        MidiDevice d = provider.getDevice(infos[i]);
        assertTrue(d instanceof SoftSynthesizer);
    }
    assertTrue(provider.getDevice(new FakeInfo()) == null);

}
 
Example #13
Source File: GetDevice.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    SoftProvider provider = new SoftProvider();
    Info[] infos = provider.getDeviceInfo();
    assertTrue(infos.length > 0);
    for (int i = 0; i < infos.length; i++) {
        assertTrue(infos[i] != null);
        MidiDevice d = provider.getDevice(infos[i]);
        assertTrue(d instanceof SoftSynthesizer);
    }
    assertTrue(provider.getDevice(new FakeInfo()) == null);

}
 
Example #14
Source File: GetDevice.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    SoftProvider provider = new SoftProvider();
    Info[] infos = provider.getDeviceInfo();
    assertTrue(infos.length > 0);
    for (int i = 0; i < infos.length; i++) {
        assertTrue(infos[i] != null);
        MidiDevice d = provider.getDevice(infos[i]);
        assertTrue(d instanceof SoftSynthesizer);
    }
    assertTrue(provider.getDevice(new FakeInfo()) == null);

}
 
Example #15
Source File: SoftProvider.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public MidiDevice getDevice(MidiDevice.Info info) {
    if (info == softinfo) {
        return new SoftSynthesizer();
    }
    return null;
}
 
Example #16
Source File: SoftProvider.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public MidiDevice.Info[] getDeviceInfo() {
    return Arrays.copyOf(softinfos, softinfos.length);
}
 
Example #17
Source File: SoftProvider.java    From tuxguitar with GNU Lesser General Public License v2.1 4 votes vote down vote up
public MidiDevice getDevice(MidiDevice.Info info) {
    if (info == softinfo) {
        return new SoftSynthesizer();
    }
    return null;
}
 
Example #18
Source File: SoftProvider.java    From tuxguitar with GNU Lesser General Public License v2.1 4 votes vote down vote up
public MidiDevice.Info[] getDeviceInfo() {
    return softinfos;
}
 
Example #19
Source File: SoftProvider.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
public MidiDevice.Info[] getDeviceInfo() {
    return Arrays.copyOf(softinfos, softinfos.length);
}
 
Example #20
Source File: SoftProvider.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
public MidiDevice getDevice(MidiDevice.Info info) {
    if (info == softinfo) {
        return new SoftSynthesizer();
    }
    return null;
}
 
Example #21
Source File: SoftProvider.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
public MidiDevice getDevice(MidiDevice.Info info) {
    if (info == softinfo) {
        return new SoftSynthesizer();
    }
    return null;
}
 
Example #22
Source File: SoftProvider.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
public MidiDevice.Info[] getDeviceInfo() {
    return Arrays.copyOf(softinfos, softinfos.length);
}
 
Example #23
Source File: SoftProvider.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public MidiDevice getDevice(MidiDevice.Info info) {
    if (info == softinfo) {
        return new SoftSynthesizer();
    }
    return null;
}
 
Example #24
Source File: SoftProvider.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public MidiDevice.Info[] getDeviceInfo() {
    return Arrays.copyOf(softinfos, softinfos.length);
}
 
Example #25
Source File: SoftProvider.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public MidiDevice getDevice(MidiDevice.Info info) {
    if (info == softinfo) {
        return new SoftSynthesizer();
    }
    return null;
}
 
Example #26
Source File: SoftProvider.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public MidiDevice getDevice(MidiDevice.Info info) {
    if (info == softinfo) {
        return new SoftSynthesizer();
    }
    return null;
}
 
Example #27
Source File: SoftProvider.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public MidiDevice.Info[] getDeviceInfo() {
    return Arrays.copyOf(softinfos, softinfos.length);
}
 
Example #28
Source File: SoftProvider.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public MidiDevice.Info[] getDeviceInfo() {
    return Arrays.copyOf(softinfos, softinfos.length);
}
 
Example #29
Source File: SoftProvider.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public MidiDevice.Info[] getDeviceInfo() {
    return Arrays.copyOf(softinfos, softinfos.length);
}
 
Example #30
Source File: SoftProvider.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public MidiDevice getDevice(MidiDevice.Info info) {
    if (info == softinfo) {
        return new SoftSynthesizer();
    }
    return null;
}