本文整理汇总了Java中javax.sound.midi.SoundbankResource类的典型用法代码示例。如果您正苦于以下问题:Java SoundbankResource类的具体用法?Java SoundbankResource怎么用?Java SoundbankResource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SoundbankResource类属于javax.sound.midi包,在下文中一共展示了SoundbankResource类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getResources
import javax.sound.midi.SoundbankResource; //导入依赖的package包/类
public SoundbankResource[] getResources() {
SoundbankResource[] resources
= new SoundbankResource[layers.size() + samples.size()];
int j = 0;
for (int i = 0; i < layers.size(); i++)
resources[j++] = layers.get(i);
for (int i = 0; i < samples.size(); i++)
resources[j++] = samples.get(i);
return resources;
}
示例2: addResource
import javax.sound.midi.SoundbankResource; //导入依赖的package包/类
public void addResource(SoundbankResource resource) {
if (resource instanceof SF2Instrument)
instruments.add((SF2Instrument)resource);
if (resource instanceof SF2Layer)
layers.add((SF2Layer)resource);
if (resource instanceof SF2Sample)
samples.add((SF2Sample)resource);
}
示例3: removeResource
import javax.sound.midi.SoundbankResource; //导入依赖的package包/类
public void removeResource(SoundbankResource resource) {
if (resource instanceof SF2Instrument)
instruments.remove((SF2Instrument)resource);
if (resource instanceof SF2Layer)
layers.remove((SF2Layer)resource);
if (resource instanceof SF2Sample)
samples.remove((SF2Sample)resource);
}
示例4: getResources
import javax.sound.midi.SoundbankResource; //导入依赖的package包/类
public SoundbankResource[] getResources() {
SoundbankResource[] resources = new SoundbankResource[samples.size()];
int j = 0;
for (int i = 0; i < samples.size(); i++)
resources[j++] = samples.get(i);
return resources;
}
示例5: main
import javax.sound.midi.SoundbankResource; //导入依赖的package包/类
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);
}
示例6: getResources
import javax.sound.midi.SoundbankResource; //导入依赖的package包/类
@Override
public SoundbankResource[] getResources() {
SoundbankResource[] resources
= new SoundbankResource[layers.size() + samples.size()];
int j = 0;
for (int i = 0; i < layers.size(); i++)
resources[j++] = layers.get(i);
for (int i = 0; i < samples.size(); i++)
resources[j++] = samples.get(i);
return resources;
}
示例7: removeResource
import javax.sound.midi.SoundbankResource; //导入依赖的package包/类
public void removeResource(SoundbankResource resource) {
if (resource instanceof SF2Instrument)
instruments.remove(resource);
if (resource instanceof SF2Layer)
layers.remove(resource);
if (resource instanceof SF2Sample)
samples.remove(resource);
}
示例8: getResources
import javax.sound.midi.SoundbankResource; //导入依赖的package包/类
@Override
public SoundbankResource[] getResources() {
SoundbankResource[] resources = new SoundbankResource[samples.size()];
int j = 0;
for (int i = 0; i < samples.size(); i++)
resources[j++] = samples.get(i);
return resources;
}