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; }
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); }
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); }
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; }
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); }
@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; }
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); }
@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; }