public IntegerUseMap getSampleIndexesInUseForAllPresets(PresetContext pc) throws NoSuchContextException {
return getSampleIndexesInUseForPresetRange(pc, 0, getDBCount() - 1);
}
private IntegerUseMap getSampleIndexesInUseForPresetRange(PresetContext pc, int lowPreset, int highPreset) throws NoSuchContextException {
IntegerUseMap useMap = new IntegerUseMap();
PresetObject p;
Integer preset;
Set s = getReadablePresetIndexes(pc);
ArrayList targetPresets = new ArrayList(1000);
for (Iterator i = s.iterator(); i.hasNext();) {
preset = (Integer) i.next();
if (preset.intValue() >= lowPreset && preset.intValue() <= highPreset)
targetPresets.add(preset);
}
int size = targetPresets.size();
Zoeos.getInstance().beginProgressElement(this, "Determining unreferenced samples", size);
try {
for (int i = 0,j = targetPresets.size(); i < j; i++) {
preset = (Integer) targetPresets.get(i);
try {
p = getPresetRead(pc, preset);
try {
useMap.mergeUseMap(p.referencedSampleUsage());
} finally {
unlockPreset(preset);
}
} catch (NoSuchPresetException e) {
} catch (PresetEmptyException e) {