本文整理汇总了Java中javax.sound.midi.Soundbank.getInstruments方法的典型用法代码示例。如果您正苦于以下问题:Java Soundbank.getInstruments方法的具体用法?Java Soundbank.getInstruments怎么用?Java Soundbank.getInstruments使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.sound.midi.Soundbank
的用法示例。
在下文中一共展示了Soundbank.getInstruments方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAvailableInstruments
import javax.sound.midi.Soundbank; //导入方法依赖的package包/类
public Instrument[] getAvailableInstruments() {
Soundbank defsbk = getDefaultSoundbank();
if (defsbk == null)
return new Instrument[0];
Instrument[] inslist_array = defsbk.getInstruments();
Arrays.sort(inslist_array, new ModelInstrumentComparator());
return inslist_array;
}
示例2: loadAllInstruments
import javax.sound.midi.Soundbank; //导入方法依赖的package包/类
public boolean loadAllInstruments(Soundbank soundbank) {
List<ModelInstrument> instruments = new ArrayList<ModelInstrument>();
for (Instrument ins: soundbank.getInstruments()) {
if (ins == null || !(ins instanceof ModelInstrument)) {
throw new IllegalArgumentException(
"Unsupported instrument: " + ins);
}
instruments.add((ModelInstrument)ins);
}
return loadInstruments(instruments);
}
示例3: unloadAllInstruments
import javax.sound.midi.Soundbank; //导入方法依赖的package包/类
public void unloadAllInstruments(Soundbank soundbank) {
if (soundbank == null || !isSoundbankSupported(soundbank))
throw new IllegalArgumentException("Unsupported soundbank: " + soundbank);
if (!isOpen())
return;
for (Instrument ins: soundbank.getInstruments()) {
if (ins instanceof ModelInstrument) {
unloadInstrument(ins);
}
}
}
示例4: isSoundbankSupported
import javax.sound.midi.Soundbank; //导入方法依赖的package包/类
@Override
public boolean isSoundbankSupported(Soundbank soundbank) {
for (Instrument ins: soundbank.getInstruments())
if (!(ins instanceof ModelInstrument))
return false;
return true;
}
示例5: getAvailableInstruments
import javax.sound.midi.Soundbank; //导入方法依赖的package包/类
@Override
public Instrument[] getAvailableInstruments() {
Soundbank defsbk = getDefaultSoundbank();
if (defsbk == null)
return new Instrument[0];
Instrument[] inslist_array = defsbk.getInstruments();
Arrays.sort(inslist_array, new ModelInstrumentComparator());
return inslist_array;
}
示例6: loadAllInstruments
import javax.sound.midi.Soundbank; //导入方法依赖的package包/类
@Override
public boolean loadAllInstruments(Soundbank soundbank) {
List<ModelInstrument> instruments = new ArrayList<>();
for (Instrument ins: soundbank.getInstruments()) {
if (ins == null || !(ins instanceof ModelInstrument)) {
throw new IllegalArgumentException(
"Unsupported instrument: " + ins);
}
instruments.add((ModelInstrument)ins);
}
return loadInstruments(instruments);
}
示例7: unloadAllInstruments
import javax.sound.midi.Soundbank; //导入方法依赖的package包/类
@Override
public void unloadAllInstruments(Soundbank soundbank) {
if (soundbank == null || !isSoundbankSupported(soundbank))
throw new IllegalArgumentException("Unsupported soundbank: " + soundbank);
if (!isOpen())
return;
for (Instrument ins: soundbank.getInstruments()) {
if (ins instanceof ModelInstrument) {
unloadInstrument(ins);
}
}
}
示例8: addAllInstruments
import javax.sound.midi.Soundbank; //导入方法依赖的package包/类
public void addAllInstruments(Soundbank soundbank) {
for (Instrument ins : soundbank.getInstruments())
addInstrument(ins);
}
示例9: removeAllInstruments
import javax.sound.midi.Soundbank; //导入方法依赖的package包/类
public void removeAllInstruments(Soundbank soundbank) {
for (Instrument ins : soundbank.getInstruments())
removeInstrument(ins);
}
示例10: isSoundbankSupported
import javax.sound.midi.Soundbank; //导入方法依赖的package包/类
public boolean isSoundbankSupported(Soundbank soundbank) {
for (Instrument ins: soundbank.getInstruments())
if (!(ins instanceof ModelInstrument))
return false;
return true;
}