header.setName(name);
header.setDeviceVersion(pc.getDeviceContext().getDeviceVersion());
header.setDeviceName(pc.getDeviceContext().getName());
// EVALUATE
IntegerUseMap presetUsageMap = evaluatePresetPackage(header.getName(), presets, deep, pc);
// MASTER
Integer[] masterIds = null;
Integer[] masterVals = null;
if (header.includingMasterSettings) {
Set mIds;
mIds = pc.getDeviceParameterContext().getMasterContext().getIds();
try {
masterVals = pc.getDeviceContext().getMasterContext().getMasterParams((Integer[]) mIds.toArray(new Integer[mIds.size()]));
masterIds = (Integer[]) mIds.toArray(new Integer[mIds.size()]);
} catch (IllegalParameterIdException e) {
throw new PackageGenerationException("could not generate master settings");
} catch (ZDeviceNotRunningException e) {
throw new PackageGenerationException("device not running");
}
}
// MULTIMODE
MultiModeMap multiModeMap = null;
if (header.includingMultimodeSettings)
try {
multiModeMap = pc.getDeviceContext().getMultiModeContext().getMultimodeMap();
} catch (ZDeviceNotRunningException e) {
throw new PackageGenerationException("device not running");
}
// ISOLATE PRESETS
IsolatedPreset[] isoPresets = generateIsolatedPresets(header.getName(), presetUsageMap.getIntegers(), pc);
// SAMPLES
SamplePackage spkg = null;
if (incSamples) {
spkg = createSamplePackage(pc.getRootSampleContext(), isoPresets, notes, name, null, format);