void CabbagePluginAudioProcessor::setParameter (int index, float newValue) { if(isPositiveAndBelow(index, getGUICtrlsSize())) { String stringMessage; #ifndef Cabbage_No_Csound float range, min, comboRange; //add index of control that was changed to dirty control vector, unless it's a combobox. #ifdef Cabbage_Build_Standalone if(!getGUICtrls(index).getStringProp("filetype").contains("snaps")) dirtyControls.addIfNotAlreadyThere(index); #else if(getGUICtrls(index).getStringProp(CabbageIDs::type)!=CabbageIDs::combobox) dirtyControls.addIfNotAlreadyThere(index); #endif if(index<(int)guiCtrls.size())//make sure index isn't out of range { #ifndef Cabbage_Build_Standalone //scaling in here because incoming values in plugin mode range from 0-1 range = getGUICtrls(index).getNumProp(CabbageIDs::range); comboRange = getGUICtrls(index).getNumProp(CabbageIDs::comborange); min = getGUICtrls(index).getNumProp(CabbageIDs::min); if(getGUICtrls(index).getStringProp(CabbageIDs::type)==CabbageIDs::xypad) newValue = (jmax(0.f, newValue)*range)+min; else if(getGUICtrls(index).getStringProp(CabbageIDs::type)==CabbageIDs::combobox)//combo box value need to be rounded... newValue = (newValue*comboRange); else if(getGUICtrls(index).getStringProp(CabbageIDs::type)==CabbageIDs::checkbox || getGUICtrls(index).getStringProp(CabbageIDs::type)==CabbageIDs::button) range=1; else newValue = (newValue*range)+min; #endif if(getGUICtrls(index).getStringProp(CabbageIDs::type)==CabbageIDs::combobox && getGUICtrls(index).getStringProp(CabbageIDs::channeltype)==CabbageIDs::stringchannel) { cUtils::debug(getGUICtrls(index).getStringArrayProp(CabbageIDs::text).size()); stringMessage = getGUICtrls(index).getStringArrayPropValue(CabbageIDs::text, newValue-1); messageQueue.addOutgoingChannelMessageToQueue(guiCtrls.getReference(index).getStringProp(CabbageIDs::channel), stringMessage, CabbageIDs::stringchannel); } else { messageQueue.addOutgoingChannelMessageToQueue(guiCtrls.getReference(index).getStringProp(CabbageIDs::channel), newValue, guiCtrls.getReference(index).getStringProp(CabbageIDs::type)); } //guiCtrls.getReference(index).setNumProp(CabbageIDs::value, newValue); } #endif } //updateCabbageControls(); }