Package com.pcmsolutions.system

Examples of com.pcmsolutions.system.CommandFailedException


                    links[n].copyLink();
                    Thread.yield();
                }
            }
        } catch (NoSuchPresetException e) {
            throw new CommandFailedException("Preset Not Found.");
        } catch (NoSuchLinkException e) {
            throw new CommandFailedException("No such link ");
        } catch (PresetEmptyException e) {
            throw new CommandFailedException("Preset Empty");
        } catch (TooManyVoicesException e) {
            throw new CommandFailedException("Too many voices");
        }
    }
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("No target");
        getTarget().refresh();
    }
View Full Code Here

        try {
            if (num == 0) {
                // try use primary target
                p = getTarget();
                if (p == null)
                    throw new CommandFailedException("Null Target");
                newPreset(p);
            }
            for (int n = 0; n < num; n++) {
                newPreset(presets[n]);
                Thread.yield();
            }
        } catch (NoSuchPresetException e) {
            throw new CommandFailedException("Preset Not Found.");
        }
    }
View Full Code Here

        }
    }

    private void newPreset(ContextEditablePreset p) throws CommandFailedException, NoSuchPresetException {
        if (p == null)
            throw new CommandFailedException("Null Target");
        p.newPreset(p.getPresetNumber(), DeviceContext.UNTITLED_PRESET);
    }
View Full Code Here

        try {
            if (num == 0) {
                // try use primary target
                p = getTarget();
                if (p == null)
                    throw new CommandFailedException("Null Target");
                eraseSample(p);
            }
            for (int n = 0; n < num; n++) {
                eraseSample(samples[n]);
                Thread.yield();
            }
        } catch (NoSuchSampleException e) {
            throw new CommandFailedException("Sample Not Found.");
        }
    }
View Full Code Here

        }
    }

    private void eraseSample(ContextBasicEditableSample s) throws CommandFailedException, NoSuchSampleException {
        if (s == null)
            throw new CommandFailedException("Null Target");
        try {
            s.eraseSample();
        } catch (SampleEmptyException e) {
        }
    }
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();
        try {
            getTarget().setSampleName((String) arguments[0]);
        } catch (NoSuchSampleException e) {
            throw new CommandFailedException("Sample Not Found.");
        } catch (SampleEmptyException e) {
            throw new CommandFailedException("Sample is Empty.");
        }
    }
View Full Code Here

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

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

                    SampleContextMacros.loadSamplesToContext(files, (Integer[]) emptyList.toArray(new Integer[emptyList.size()]), beginSample.getSampleContext(), true, stripIndex);
                } catch (NoSuchContextException e) {
                    throw new CommandFailedException("Problem with sample context");
                }
            }
        }
    }
View Full Code Here

                if (oldName != null && !oldName.equals(arguments[1]))
                    getTarget().getSampleContext().setSampleName(((AggRemoteName) arguments[0]).getIndex(), arguments[1].toString());
            }

        } catch (NoSuchSampleException e) {
            throw new CommandFailedException("No Such Sample: " + e.getAggName());
        } catch (SampleEmptyException e) {
            throw new CommandFailedException("Source is Empty: " + e.getAggName());
        } catch (IsolatedSampleUnavailableException e) {
            throw new CommandFailedException("Could not isolate source sample: " + e.getMessage());
        } catch (NoSuchContextException e) {
            throw new CommandFailedException("Could not name destination sample");
        } finally {
            try {
                getTarget().getDeviceContext().sampleMemoryDefrag(false);
            } catch (ZDeviceNotRunningException e) {
            } catch (RemoteUnreachableException e) {
View Full Code Here

    {
        if (custom) {
            try {
                unitStep = Double.parseDouble(arguments[0].toString());
            } catch (NumberFormatException e) {
                throw new CommandFailedException("Not a valid number");
            }
        }

        EditableParameterModel[] params = getTargets();
        int num = params.length;
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.