protected void acceptTargets() throws ZCommandTargetsNotSuitableException, ZCommandTargetsNotSpecifiedException { super.acceptTargets(); ContextEditablePreset.EditableVoice[] voices = getTargets().toArray(new ContextEditablePreset.EditableVoice[numTargets()]); int grp = -1; try { for (int i = 0; i < voices.length; i++) { int t_grp = voices[i].getVoiceParams(new Integer[] {IntPool.get(37)})[0].intValue(); if (grp == -1) grp = t_grp; else if (grp != t_grp) throw new ZCommandTargetsNotSuitableException(); } return; } catch (Exception e) { throw new ZCommandTargetsNotSuitableException(); } }
public void setTargets(Object[] targets) throws IllegalArgumentException, ZMTCommandTargetsNotSuitableException { super.setTargets(targets); if (mode == 1) { Integer grp; try { grp = getTargets()[0].getVoiceParams(new Integer[] {IntPool.get(37)})[0]; init("Combine G" + grp, "Combine voices in group " + grp, null, null); return; } catch (NoSuchPresetException e) { e.printStackTrace(); } catch (PresetEmptyException e) { e.printStackTrace(); } catch (IllegalParameterIdException e) { e.printStackTrace(); } catch (NoSuchVoiceException e) { e.printStackTrace(); } throw new ZMTCommandTargetsNotSuitableException(); } }