Examples of ZDBModifyThread


Examples of com.pcmsolutions.system.threads.ZDBModifyThread

    public void eraseBank() throws ZDeviceNotRunningException {
        device.configure();
        try {
            if (sts.getState() != STATE_RUNNING)
                throw new ZDeviceNotRunningException(this, null);
            new ZDBModifyThread("Erase Bank") {
                public void run() {
                    device.configure();
                    try {
                        remote.getMasterContext().cmd_bankErase();
View Full Code Here

Examples of com.pcmsolutions.system.threads.ZDBModifyThread

    public void refreshBank(final boolean refreshData) throws ZDeviceNotRunningException {
        device.configure();
        try {
            if (sts.getState() != STATE_RUNNING)
                throw new ZDeviceNotRunningException(this, null);
            new ZDBModifyThread("Refresh Bank") {
                public void run() {
                    device.configure();
                    try {
                        presetDB.stopWorkerThreads();
                        sampleDB.stopWorkerThreads();
View Full Code Here

Examples of com.pcmsolutions.system.threads.ZDBModifyThread

            throw e;
        }

        Action rt = new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                new ZDBModifyThread("Refresh Tuning") {
                    public void run() {
                        try {
                            voice.getPreset().refreshVoiceParameters(voice.getVoiceNumber(), (Integer[]) tuningIds.toArray(new Integer[tuningIds.size()]));
                        } catch (NoSuchContextException e1) {
                            e1.printStackTrace();
                        } catch (PresetEmptyException e1) {
                            e1.printStackTrace();
                        } catch (NoSuchPresetException e1) {
                            e1.printStackTrace();
                        } catch (NoSuchVoiceException e1) {
                            e1.printStackTrace();
                        } catch (ParameterValueOutOfRangeException e1) {
                            e1.printStackTrace();
                        } catch (IllegalParameterIdException e1) {
                            e1.printStackTrace();
                        }

                    }
                }.start();
            }
        };
        rt.putValue("tip", "Refresh Tuning");
        Action rm = new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                new ZDBModifyThread("Refresh Tuning Modifiers") {
                    public void run() {
                        try {
                            voice.getPreset().refreshVoiceParameters(voice.getVoiceNumber(), (Integer[]) modifierIds.toArray(new Integer[modifierIds.size()]));
                        } catch (NoSuchContextException e1) {
                            e1.printStackTrace();
                        } catch (PresetEmptyException e1) {
                            e1.printStackTrace();
                        } catch (NoSuchPresetException e1) {
                            e1.printStackTrace();
                        } catch (NoSuchVoiceException e1) {
                            e1.printStackTrace();
                        } catch (ParameterValueOutOfRangeException e1) {
                            e1.printStackTrace();
                        } catch (IllegalParameterIdException e1) {
                            e1.printStackTrace();
                        }
                    }
                }.start();
            }
        };
        rm.putValue("tip", "Refresh Tuning Modifier");
        Action rs = new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                new ZDBModifyThread("REfresh Tuning Setup") {
                    public void run() {
                        try {
                            voice.getPreset().refreshVoiceParameters(voice.getVoiceNumber(), (Integer[]) setupIds.toArray(new Integer[setupIds.size()]));
                        } catch (NoSuchContextException e1) {
                            e1.printStackTrace();
View Full Code Here

Examples of com.pcmsolutions.system.threads.ZDBModifyThread

        for (int i = 0,j = models.length; i < j; i++)
            ids[i] = models[i].getParameterDescriptor().getId();

        Action ra = new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                new ZDBModifyThread("Refresh Envelope") {
                    public void run() {
                        try {
                            voice.getPreset().refreshVoiceParameters(voice.getVoiceNumber(), ids);
                        } catch (NoSuchContextException e1) {
                            e1.printStackTrace();
View Full Code Here

Examples of com.pcmsolutions.system.threads.ZDBModifyThread

        modifierModels = ParameterModelUtilities.getEditableParameterModelGroups(voices, (Integer[]) modifierIds.toArray(new Integer[modifierIds.size()]));
        setupModels = ParameterModelUtilities.getEditableParameterModelGroups(voices, (Integer[]) setupIds.toArray(new Integer[setupIds.size()]));
        this.setFocusable(false);
        Action rt = new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                new ZDBModifyThread("Refresh Tuning") {
                    public void run() {
                        try {
                            voices[0].getPreset().refreshVoiceParameters(voices[0].getVoiceNumber(), (Integer[]) tuningIds.toArray(new Integer[tuningIds.size()]));
                        } catch (NoSuchContextException e1) {
                            e1.printStackTrace();
                        } catch (PresetEmptyException e1) {
                            e1.printStackTrace();
                        } catch (NoSuchPresetException e1) {
                            e1.printStackTrace();
                        } catch (NoSuchVoiceException e1) {
                            e1.printStackTrace();
                        } catch (ParameterValueOutOfRangeException e1) {
                            e1.printStackTrace();
                        } catch (IllegalParameterIdException e1) {
                            e1.printStackTrace();
                        }

                    }
                }.start();
            }
        };
        rt.putValue("tip", "Refresh Tuning");
        Action rm = new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                new ZDBModifyThread("Refresh Tuning Modifiers") {
                    public void run() {
                        try {
                            voices[0].getPreset().refreshVoiceParameters(voices[0].getVoiceNumber(), (Integer[]) modifierIds.toArray(new Integer[modifierIds.size()]));
                        } catch (NoSuchContextException e1) {
                            e1.printStackTrace();
                        } catch (PresetEmptyException e1) {
                            e1.printStackTrace();
                        } catch (NoSuchPresetException e1) {
                            e1.printStackTrace();
                        } catch (NoSuchVoiceException e1) {
                            e1.printStackTrace();
                        } catch (ParameterValueOutOfRangeException e1) {
                            e1.printStackTrace();
                        } catch (IllegalParameterIdException e1) {
                            e1.printStackTrace();
                        }

                    }
                }.start();
            }
        };
        rm.putValue("tip", "Refresh Tuning Modifiers");

        Action rs = new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                new ZDBModifyThread("Refresh Tuning Setup") {
                    public void run() {
                        try {
                            voices[0].getPreset().refreshVoiceParameters(voices[0].getVoiceNumber(), (Integer[]) setupIds.toArray(new Integer[setupIds.size()]));
                        } catch (NoSuchContextException e1) {
                            e1.printStackTrace();
View Full Code Here

Examples of com.pcmsolutions.system.threads.ZDBModifyThread

    private RowHeaderedAndSectionedTablePanel pcp;

    public PresetContextEditorPanel(final PresetContext pc) throws ZDeviceNotRunningException {
        AbstractAction rpc = new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                new ZDBModifyThread("Refresh Preset Context") {
                    public void run() {
                    }
                }.start();
            }
        };
View Full Code Here

Examples of com.pcmsolutions.system.threads.ZDBModifyThread

    public boolean editCellAt(int row, int column, EventObject e) {
        if (e instanceof MouseEvent && ((MouseEvent) e).getClickCount() >= 2) {
            if (getValueAt(row, column) instanceof ReadablePreset) {
                final ReadablePreset p = (ReadablePreset) getValueAt(row, column);
                new ZDBModifyThread("Preset Default Action") {
                    public void run() {
                        p.performDefaultAction();
                    }
                }.start();
            }
View Full Code Here

Examples of com.pcmsolutions.system.threads.ZDBModifyThread

            cordIds[i] = IntPool.get(129 + i);
        EditableParameterModel[] cordModels = ParameterModelUtilities.getEditableParameterModelGroups(voices, cordIds);

        Action rct = new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                new ZDBModifyThread("Refresh Cords") {
                    public void run() {
                        try {
                            voices[0].getPreset().refreshVoiceParameters(voices[0].getVoiceNumber(), cordIds);
                        } catch (NoSuchContextException e1) {
                            e1.printStackTrace();
View Full Code Here

Examples of com.pcmsolutions.system.threads.ZDBModifyThread

    private static int progressLabelWidth = 72;

    private void dropIsolatedPresets(final ContextPresetSelection ips, final Object[] destRowObjects) {
        final Object progressOwner = new Object();
        final Thread mt = new ZDBModifyThread("D&D: Transfer IsolatedPresets") {
            public void run() {
                final Zoeos z = Zoeos.getInstance();
                z.beginProgressElement(progressOwner, ZUtilities.makeExactLengthString("Copying Presets", progressLabelWidth), destRowObjects.length * 2);
                int errors = 0;
                try {
                    final int j = destRowObjects.length;
                    for (int i = 0; i < j; i++) {
                        final int f_i = i;
                        final Object pobj = destRowObjects[i];
                        if (pobj instanceof ContextEditablePreset) {
                            final IsolatedPreset ip = ips.getIsolatedPreset(i);
                            z.updateProgressElement(progressOwner);
                            if (ip == null) {
                                z.updateProgressElement(progressOwner);
                                if (i >= j - 1)
                                    z.endProgressElement(progressOwner);
                                errors++;
                                continue;
                            }
                            new ZDBModifyThread("D&D: New Presets from IsolatedPresets") {
                                public void run() {
                                    // TODO!! should use a signal here to achieve correct ordering of threads
                                    try {
                                        z.updateProgressElementTitle(progressOwner, "Copying " + ip.getName() + " to " + ((ContextEditablePreset) pobj).getPresetDisplayName());
                                        ((ContextEditablePreset) pobj).newPreset(((ContextEditablePreset) pobj).getPresetNumber(), ip.getName(), ip);
                                    } catch (NoSuchPresetException e) {
                                        e.printStackTrace();
                                    } finally {
                                        z.updateProgressElement(progressOwner);
                                        if (f_i >= j - 1)
                                            z.endProgressElement(progressOwner);
                                    }
                                }
                            }.start();
                        } else {
                            z.updateProgressElement(progressOwner);
                            z.updateProgressElement(progressOwner);
                            if (i >= j - 1)
                                z.endProgressElement(progressOwner);
                            errors++;
                        }
                    }
                } finally {
                    if (errors == destRowObjects.length)
                        JOptionPane.showMessageDialog(ZoeosFrame.getInstance(), (destRowObjects.length > 1 ? "None of the source presets could be copied" : "The source preset could not be copied"), "Problem", JOptionPane.ERROR_MESSAGE);
                    else if (errors > 0)
                        JOptionPane.showMessageDialog(ZoeosFrame.getInstance(), errors + " of " + destRowObjects.length + " source presets could not be copied", "Problem", JOptionPane.ERROR_MESSAGE);
                }
            }
        };
        mt.start();
    }
View Full Code Here

Examples of com.pcmsolutions.system.threads.ZDBModifyThread

        };
        mt.start();
    }

    private void dropContextLocalPresets(final Object[] destRowObjects, final ReadablePreset[] readablePresets, final PresetContextTable pct) {
        new ZDBModifyThread("D&D: Copy Presets") {
            public void run() {
                final Zoeos z = Zoeos.getInstance();
                z.beginProgressElement(this, ZUtilities.makeExactLengthString("Copying Presets", progressLabelWidth), destRowObjects.length);
                int errors = 0;
                for (int i = readablePresets.length - 1; i >= 0; i--) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.