Package com.pcmsolutions.system

Examples of com.pcmsolutions.system.CommandFailedException


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


        }
    }

    private void erasePreset(ContextBasicEditablePreset p) throws CommandFailedException, NoSuchPresetException {
        if (p == null)
            throw new CommandFailedException("Null Target");
        try {
            p.erasePreset();
        } catch (PresetEmptyException 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().refreshBank(false);
        } catch (ZDeviceNotRunningException e) {
            throw new CommandFailedException("Device not running");
        }
    }
View Full Code Here

                if (oldName != null && !oldName.equals(arguments[1]))
                    getTarget().copyPreset(((AggRemoteName) arguments[0]).getIndex(), arguments[1].toString());
                else
                    getTarget().copyPreset(((AggRemoteName) arguments[0]).getIndex());
        } catch (NoSuchPresetException e) {
            throw new CommandFailedException("No Such Preset: " + e.getAggName());
        } catch (PresetEmptyException e) {
            throw new CommandFailedException("Source is Empty: " + e.getAggName());
        }
    }
View Full Code Here

    public void execute(Object invoker, Object[] arguments) throws IllegalArgumentException, CommandFailedException  // IllegalArgumentException thrown for insufficient number of arguments
    {
        samples = getTargets();

        if (!SampleContextMacros.areAllSameContext(samples))
            throw new CommandFailedException("Samples must be all from same context");

        sampleIndexes = SampleContextMacros.extractUniqueSampleIndexes(samples);
        sc = samples[0].getSampleContext();
        synchronized (this) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    new NewSamplePackageZMTC.CreateSamplePackageDialog(ZoeosFrame.getInstance(), "New Sample Package");
                }
            });

            while (!done) {
                try {
                    wait();
                } catch (InterruptedException e) {
                }
            }
        }

        if (err != null)
            throw new CommandFailedException(err.getMessage());
    }
View Full Code Here

    private void createAndSaveSamplePackage(SampleContext sc, Integer[] indexes, String name, String notes, AudioFileFormat.Type format) throws CommandFailedException {
        SamplePackage pkg = null;
        try {
            pkg = PackageFactory.createSamplePackage(sc, indexes, name, notes, null, format);
        } catch (PackageGenerationException e) {
            throw new CommandFailedException("Error saving sample package: " + e.getMessage());
        }
        File extFile = null;
        synchronized (this.getClass()) {
            assertChooser();
            fc.setSelectedFile(new File(name));
            int retval = fc.showSaveDialog(ZoeosFrame.getInstance());
            if (retval == JFileChooser.APPROVE_OPTION) {
                File f = fc.getSelectedFile();
                //File extFile = new File(f.getAbsolutePath() + "." + SamplePackage.SAMPLE_PKG_EXT);
                extFile = ZUtilities.replaceExtension(f, SamplePackage.SAMPLE_PKG_EXT);

                if (extFile.exists() && JOptionPane.showConfirmDialog(ZoeosFrame.getInstance(), "Overwrite " + extFile.getName() + " ?", "File Already Exists", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == 1)
                    return;

                ZPREF_lastDir.putValue(extFile.getAbsolutePath());

            }
        }
        if (extFile != null) {
            try {
                PackageFactory.saveSamplePackage(pkg, extFile);
            } catch (PackageGenerationException e) {
                throw new CommandFailedException("Error saving sample package: " + e.getMessage());
            } finally {
                try {
                    sc.getDeviceContext().sampleMemoryDefrag(false);
                } catch (ZDeviceNotRunningException e) {
                } catch (RemoteUnreachableException e) {
View Full Code Here

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

    {
        ContextEditablePreset.EditableVoice.EditableZone[] zones = getTargets();
        try {
            PresetContextMacros.autoMapZoneKeyWin(zones);
        } catch (NoSuchPresetException e) {
            throw new CommandFailedException("Preset Not Found");
        } catch (PresetEmptyException e) {
            throw new CommandFailedException("Preset Empty");
        }
    }
View Full Code Here

                    }
                    Thread.yield();
                }
            }
        } catch (NoSuchSampleException e) {
            throw new CommandFailedException("Sample Not Found.");
        }
    }
View Full Code Here

        }
    }

    private void refreshSample(ReadableSample p) throws CommandFailedException, NoSuchSampleException {
        if (p == null)
            throw new CommandFailedException("Null Target");
        p.refreshSample();
    }
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.