Package com.pcmsolutions.system

Examples of com.pcmsolutions.system.CommandFailedException


        }
    }

    private void midValue(EditableParameterModel p) throws ParameterValueOutOfRangeException, ParameterUnavailableException, CommandFailedException, IllegalParameterIdException, NoSuchPresetException, NoSuchLinkException, NoSuchContextException, PresetEmptyException {
        if (p == null)
            throw new CommandFailedException("Null Target");
        int min = p.getParameterDescriptor().getMinValue().intValue();
        int max = p.getParameterDescriptor().getMaxValue().intValue();
        p.setValue(IntPool.get((int) (min + (max - min) * 0.5)));
    }
View Full Code Here


                    }
                    Thread.yield();
                }
            }
        } catch (NoSuchPresetException e) {
            throw new CommandFailedException("Preset Not Found");
        } catch (PresetEmptyException e) {
            throw new CommandFailedException("Preset Empty");
        } catch (TooManyVoicesException e) {
            throw new CommandFailedException("Too Many Voices");
        }
    }
View Full Code Here

        Integer lowPreset = ((AggRemoteName) arguments[0]).getIndex();
        Integer highPreset = ((AggRemoteName) arguments[1]).getIndex();

        if (lowPreset.intValue() > highPreset.intValue())
            throw new CommandFailedException("Invalid Range");

        ContextReadablePreset targ = getTarget();
        int num = highPreset.intValue() - lowPreset.intValue() + 1;
        Integer[] destIndexes = ZUtilities.fillIncrementally(new Integer[num], lowPreset.intValue());
        Integer[] srcIndexes = new Integer[destIndexes.length];
        Arrays.fill(srcIndexes, targ.getPresetNumber());
        try {
            PresetContextMacros.copyPresets(targ.getPresetContext(), srcIndexes, destIndexes, false, true, "Preset Copy to Range");
        } catch (NoSuchPresetException e) {
            throw new CommandFailedException("No preset: " + e.getAggName());
        } catch (NoSuchContextException e) {
            throw new CommandFailedException("No preset context");
        }
    }
View Full Code Here

    }

    public void execute(Object invoker, Object[] arguments) throws IllegalArgumentException, CommandFailedException  // IllegalArgumentException thrown for insufficient number of arguments
    {
        if (getTarget() == null)
            throw new CommandFailedException();
        getTarget().getViewManager().takeSnapshot(arguments[0].toString());
    }
View Full Code Here

                }

                Thread.yield();
            }
        } catch (NoSuchPresetException e) {
            throw new CommandFailedException("Preset Not Found.");
        } catch (NoSuchZoneException e) {
            throw new CommandFailedException("No such zone ");
        } catch (PresetEmptyException e) {
            throw new CommandFailedException("Preset Empty");
        } catch (NoSuchVoiceException e) {
            throw new CommandFailedException("No such voice ");
        }
    }
View Full Code Here

                file2IndexMap.put(files[i], indexes[i]);

        File[] nnFiles = (File[]) file2IndexMap.keySet().toArray(new File[file2IndexMap.keySet().size()]);

        if (sample.getSampleNumber().intValue() + nnFiles.length > DeviceContext.BASE_ROM_SAMPLE)
            throw new CommandFailedException("Not enough user locations on or after S" + df.format(sample.getSampleNumber()) + " to load package");

        String opt1;
        String opt2;
        try {
            if (SampleContextMacros.areSampleIndexesEmpty(sample.getSampleContext(), sample.getSampleNumber(), nonNullFiles)) {
                indexes = ZUtilities.fillIncrementally(new Integer[nonNullFiles], sample.getSampleNumber().intValue());
                SampleContextMacros.loadSamplesToContext(nnFiles, indexes, sample.getSampleContext(), true, true);
                updateIndexMap(index2IndexMap, file2IndexMap, indexes, nnFiles);
                return index2IndexMap;
            }
        } catch (NoSuchSampleException e) {
            throw new CommandFailedException("No such sample");
        } catch (NoSuchContextException e) {
            throw new CommandFailedException("Problem with sample context");
        }
        if (nonNullFiles > 1) {
            opt1 = "At locations " + df.format(sample.getSampleNumber()) + " - " + df.format(sample.getSampleNumber().intValue() + nonNullFiles - 1);
            opt2 = "At first " + nonNullFiles + " empty locations searching from " + df.format(sample.getSampleNumber());
        } else {
            opt1 = "At location " + df.format(sample.getSampleNumber());
            opt2 = "At first empty location searching from " + df.format(sample.getSampleNumber());
        }
        int res = JOptionPane.showOptionDialog(ZoeosFrame.getInstance(), (nonNullFiles == 1 ? "Load 1 sample" : "Load " + nonNullFiles + " samples "), "Load Samples", JOptionPane.OK_OPTION, JOptionPane.QUESTION_MESSAGE, null, new Object[]{opt1, opt2}, opt1);
        if (res == JOptionPane.CLOSED_OPTION)
            return null;
        if (res == 0) {
            int si = sample.getSampleNumber().intValue();
            indexes = new Integer[nonNullFiles];
            for (int i = 0; i < indexes.length; i++)
                indexes[i] = IntPool.get(si + i);

            SampleContextMacros.loadSamplesToContext(nnFiles, indexes, sample.getSampleContext(), true, true);
            updateIndexMap(index2IndexMap, file2IndexMap, indexes, nnFiles);
        } else if (res == 1) {
            try {
                List emptyList = sample.getSampleContext().findEmptySamplesInContext(nonNullFiles, sample.getSampleNumber(), IntPool.get(DeviceContext.MAX_USER_SAMPLE));

                if (emptyList.size() < nonNullFiles)
                    throw new CommandFailedException("Could not find " + nonNullFiles + " empty user sample locations.");

                indexes = (Integer[]) emptyList.toArray(new Integer[emptyList.size()]);
                SampleContextMacros.loadSamplesToContext(nnFiles, indexes, sample.getSampleContext(), true, true);
                updateIndexMap(index2IndexMap, file2IndexMap, indexes, nnFiles);

            } catch (NoSuchContextException e) {
                throw new CommandFailedException("Problem with sample context");
            }
        }
        return index2IndexMap;
    }
View Full Code Here

                        // }
                    }
                    Thread.yield();
                }
                if (problemCount == targets.length && emptyCount == targets.length) {
                    throw new CommandFailedException((targets.length == 1 ? "Unable to create view - preset was empty" : "Unable to create views - all the presets were empty"));
                } else if (problemCount == targets.length && emptyCount == 0) {
                    throw new CommandFailedException((targets.length == 1 ? "Unable to create view" : "Unable to create views"));
                } else if (problemCount > 0 && emptyCount == 0)
                    throw new CommandFailedException("Unable to create view for some of the targets");
                else if (problemCount > 0 && problemCount == emptyCount)
                    throw new CommandFailedException("Unable to create view for some of the targets - some presets were empty");
            }
        } catch (NoSuchPresetException e) {
            throw new CommandFailedException("Preset Not Found.");
        }
    }
View Full Code Here

    }

    public void execute(Object invoker, Object[] arguments) throws IllegalArgumentException, CommandFailedException  // IllegalArgumentException thrown for insufficient number of arguments
    {
        if (getTarget() == null)
            throw new CommandFailedException();
        getTarget().refresh();
    }
View Full Code Here

        Integer[] srcIndexes = ZUtilities.extractIndexes(samples);
        Integer[] destIndexes = ZUtilities.fillIncrementally(new Integer[samples.length], destIndex);
        try {
            SampleContextMacros.copySamples(samples[0].getSampleContext(), srcIndexes, destIndexes, false, true, "Sample Block Copy");
        } catch (NoSuchContextException e) {
            throw new CommandFailedException("No preset context");
        } catch (NoSuchSampleException e) {
            throw new CommandFailedException("No sample: " + e.getAggName());
        } catch (IsolatedSampleUnavailableException e) {
            throw new CommandFailedException("Could not copy samples: " + e.getMessage());
        }
    }
View Full Code Here

    }

    public void execute(Object invoker, Object[] arguments) throws IllegalArgumentException, CommandFailedException  // IllegalArgumentException thrown for insufficient number of arguments
    {
        if (getTarget() == null)
            throw new CommandFailedException();
        getTarget().setName((String) arguments[0]);
    }
View Full Code Here

TOP

Related Classes of com.pcmsolutions.system.CommandFailedException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.