Package com.pcmsolutions.device.EMU.E4.zcommands

Examples of com.pcmsolutions.device.EMU.E4.zcommands.AbstractReadableSampleZMTCommand


        super(dev);
        this.ids = new Integer[ids.length];
        this.vals = new Integer[ids.length];
        //this.valStrings = new String[ids.length];
        this.category = category;
        MasterContext mc = dev.getMasterContext();
        DeviceParameterContext dpc = dev.getDeviceParameterContext();
        this.ids = (Integer[]) ids.clone();
        vals = mc.getMasterParams(ids);

        /*for (int i = 0, n = ids.length; i < n; i++) {
            try {
                valStrings[i] = deviceParameterContext.getMasterContext().getParameterDescriptor(ids[i]).getStringForValue(vals[i]);
            } catch (ParameterValueOutOfRangeException e) {
View Full Code Here


            return has32Channels;
        }

        private void assertCh(Integer ch) throws IllegalMidiChannelException {
            if (ch.intValue() < 1 || (has32Channels && ch.intValue() > 32) || (!has32Channels && ch.intValue() > 16))
                throw new IllegalMidiChannelException(ch);
        }
View Full Code Here

    protected JMenuItem[] getCustomMenuItems() {
        final int[] selRows = this.getSelectedRows();
        Action sda = new AbstractAction("Disable Channel") {
            public void actionPerformed(ActionEvent e) {
                MultiModeContext mmc = null;
                try {
                    mmc = device.getMultiModeContext();
                    for (int i = 0,j = selRows.length; i < j; i++) {
                        try {
                            mmc.setPreset(IntPool.get(selRows[i] + 1), IntPool.get(-1));
                        } catch (IllegalMidiChannelException e1) {
                            e1.printStackTrace();
                        }
                    }
                } catch (ZDeviceNotRunningException e1) {
                    e1.printStackTrace();
                }
            }
        };
        JMenuItem pmi = null;
        try {
            ArrayList selPresets = new ArrayList();
            PresetContext dpc = device.getDefaultPresetContext();
            MultiModeContext mmc = device.getMultiModeContext();
            for (int i = 0; i < selRows.length; i++) {
                Integer preset = mmc.getPreset(IntPool.get(selRows[i] + 1));        // +1 because midi channels indexed from 1
                if (preset.intValue() >= 0)
                    selPresets.add(dpc.getReadablePreset(preset));
            }
            if (selPresets.size() > 0) {
View Full Code Here

    }

    public boolean checkPopup(MouseEvent e) {
        if (e.isPopupTrigger()) {
            Object[] sels = new Object[0];
            MultiModeContext mmc;
            try {
                mmc = this.device.getMultiModeContext();
            } catch (ZDeviceNotRunningException e1) {
                return false;
            }
View Full Code Here

        private final Integer[] values = new Integer[4];
        private final String[] valueStrings = new String[4];

        public Impl_MultiModeChannelSelection(MultiModeContext mmc, int[] selCols, int row) {
            channel = IntPool.get(row + 1);
            MultiModeDescriptor mmd = mmc.getMultiModeDescriptor();
            GeneralParameterDescriptor preset_pd = mmd.getPresetParameterDescriptor();
            GeneralParameterDescriptor vol_pd = mmd.getVolumeParameterDescriptor();
            GeneralParameterDescriptor pan_pd = mmd.getPanParameterDescriptor();
            GeneralParameterDescriptor submix_pd = mmd.getSubmixParameterDescriptor();

            MultiModeMap m = mmc.getMultimodeMap();

            for (int i = 0, n = selCols.length; i < n; i++) {
                if (selCols[i] == 0) {
View Full Code Here

            GeneralParameterDescriptor preset_pd = mmd.getPresetParameterDescriptor();
            GeneralParameterDescriptor vol_pd = mmd.getVolumeParameterDescriptor();
            GeneralParameterDescriptor pan_pd = mmd.getPanParameterDescriptor();
            GeneralParameterDescriptor submix_pd = mmd.getSubmixParameterDescriptor();

            MultiModeMap m = mmc.getMultimodeMap();

            for (int i = 0, n = selCols.length; i < n; i++) {
                if (selCols[i] == 0) {
                    try {
                        values[0] = m.getPreset(channel);
                        valueStrings[0] = preset_pd.getStringForValue(values[0]);
                    } catch (IllegalMidiChannelException e) {
                        e.printStackTrace();
                    } catch (ParameterValueOutOfRangeException e) {
                        e.printStackTrace();
                    }
                }

                if (selCols[i] == 1) {
                    try {
                        values[1] = m.getVolume(channel);
                        valueStrings[1] = vol_pd.getStringForValue(values[1]);
                    } catch (IllegalMidiChannelException e) {
                        e.printStackTrace();
                    } catch (ParameterValueOutOfRangeException e) {
                        e.printStackTrace();
                    }
                }
                if (selCols[i] == 2) {
                    try {
                        values[2] = m.getPan(channel);
                        valueStrings[2] = pan_pd.getStringForValue(values[2]);
                    } catch (IllegalMidiChannelException e) {
                        e.printStackTrace();
                    } catch (ParameterValueOutOfRangeException e) {
                        e.printStackTrace();
                    }
                }
                if (selCols[i] == 3) {
                    try {
                        values[3] = m.getSubmix(channel);
                        valueStrings[3] = submix_pd.getStringForValue(values[3]);
                    } catch (IllegalMidiChannelException e) {
                        e.printStackTrace();
                    } catch (ParameterValueOutOfRangeException e) {
                        e.printStackTrace();
View Full Code Here

        dropOverExtent = -1;
    }

    public void setSelection(VoiceParameterSelection sel) {
        try {
            DeviceParameterContext dpc = voices[0].getPreset().getDeviceParameterContext();
            Integer[] ids = sel.getIds();
            Integer[] vals = sel.getVals();
            int thisCat = VoiceParameterSelection.voiceCategoryStringToEnum(category);
            int selCat = sel.getCategory();
            if (thisCat != selCat) {
                for (int i = 0,j = ids.length; i < j; i++) {
                    // need convert ids first
                    ids[i] = ParameterUtilities.convertVoiceEnvelopeId(thisCat, selCat, ids[i]);
                    vals[i] = dpc.getParameterDescriptor(ids[i]).constrainValue(vals[i]);
                }
            }

            try {
                PresetContextMacros.setContextVoicesParam(voices, ids, vals);
View Full Code Here

        this.ids = new Integer[ids.length];
        this.vals = new Integer[ids.length];
        //this.valStrings = new String[ids.length];
        this.category = category;
        MasterContext mc = dev.getMasterContext();
        DeviceParameterContext dpc = dev.getDeviceParameterContext();
        this.ids = (Integer[]) ids.clone();
        vals = mc.getMasterParams(ids);

        /*for (int i = 0, n = ids.length; i < n; i++) {
            try {
View Full Code Here

    public boolean isCellEditable(int rowIndex, int columnIndex) {
        if (columnIndex == 1 && rowIndex >= 0 && rowIndex < tableRowObjects.size()) {
            Object o = getValueAt(rowIndex, columnIndex);
            if (o instanceof EditableParameterModel) {
                EditableParameterModel epm = (EditableParameterModel) o;
                if (epm.getParameterDescriptor() instanceof FilterParameterDescriptor && !((FilterParameterDescriptor) epm.getParameterDescriptor()).isCurrentlyActive())
                    return false;
            }
            return true;
        }
        return false;
View Full Code Here

        private final String[] valueStrings = new String[4];

        public Impl_MultiModeChannelSelection(MultiModeContext mmc, int[] selCols, int row) {
            channel = IntPool.get(row + 1);
            MultiModeDescriptor mmd = mmc.getMultiModeDescriptor();
            GeneralParameterDescriptor preset_pd = mmd.getPresetParameterDescriptor();
            GeneralParameterDescriptor vol_pd = mmd.getVolumeParameterDescriptor();
            GeneralParameterDescriptor pan_pd = mmd.getPanParameterDescriptor();
            GeneralParameterDescriptor submix_pd = mmd.getSubmixParameterDescriptor();

            MultiModeMap m = mmc.getMultimodeMap();

            for (int i = 0, n = selCols.length; i < n; i++) {
                if (selCols[i] == 0) {
                    try {
                        values[0] = m.getPreset(channel);
                        valueStrings[0] = preset_pd.getStringForValue(values[0]);
                    } catch (IllegalMidiChannelException e) {
                        e.printStackTrace();
                    } catch (ParameterValueOutOfRangeException e) {
                        e.printStackTrace();
                    }
                }

                if (selCols[i] == 1) {
                    try {
                        values[1] = m.getVolume(channel);
                        valueStrings[1] = vol_pd.getStringForValue(values[1]);
                    } catch (IllegalMidiChannelException e) {
                        e.printStackTrace();
                    } catch (ParameterValueOutOfRangeException e) {
                        e.printStackTrace();
                    }
                }
                if (selCols[i] == 2) {
                    try {
                        values[2] = m.getPan(channel);
                        valueStrings[2] = pan_pd.getStringForValue(values[2]);
                    } catch (IllegalMidiChannelException e) {
                        e.printStackTrace();
                    } catch (ParameterValueOutOfRangeException e) {
                        e.printStackTrace();
                    }
                }
                if (selCols[i] == 3) {
                    try {
                        values[3] = m.getSubmix(channel);
                        valueStrings[3] = submix_pd.getStringForValue(values[3]);
                    } catch (IllegalMidiChannelException e) {
                        e.printStackTrace();
                    } catch (ParameterValueOutOfRangeException e) {
                        e.printStackTrace();
                    }
View Full Code Here

TOP

Related Classes of com.pcmsolutions.device.EMU.E4.zcommands.AbstractReadableSampleZMTCommand

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.