use of javax.sound.midi.SoundbankResource in project jdk8u_jdk by JetBrains.
the class IsSoundbankSupported method main.
public static void main(String[] args) throws Exception {
AudioSynthesizer synth = new SoftSynthesizer();
synth.openStream(null, null);
SimpleSoundbank sbk = new SimpleSoundbank();
SimpleInstrument ins = new SimpleInstrument();
sbk.addInstrument(ins);
assertTrue(synth.isSoundbankSupported(sbk));
Soundbank dummysbk = new Soundbank() {
public String getName() {
return null;
}
public String getVersion() {
return null;
}
public String getVendor() {
return null;
}
public String getDescription() {
return null;
}
public SoundbankResource[] getResources() {
return null;
}
public Instrument[] getInstruments() {
Instrument ins = new Instrument(null, null, null, null) {
public Object getData() {
return null;
}
};
return new Instrument[] { ins };
}
public Instrument getInstrument(Patch patch) {
return null;
}
};
assertTrue(!synth.isSoundbankSupported(dummysbk));
synth.close();
}
use of javax.sound.midi.SoundbankResource in project jdk8u_jdk by JetBrains.
the class AddResource method main.
public static void main(String[] args) throws Exception {
SimpleSoundbank soundbank = new SimpleSoundbank();
SoundbankResource res = new SoundbankResource(soundbank, "test", null) {
public Object getData() {
return null;
}
};
soundbank.addResource(res);
assertEquals(soundbank.getResources().length, 1);
assertEquals(soundbank.getResources()[0], res);
}
Aggregations