Esempio n. 1
0
void MLPluginProcessor::doPropertyChangeAction(MLSymbol property, const MLProperty& newVal)
{
	int propertyType = newVal.getType();
	int paramIdx = getParameterIndex(property);
	float f = newVal.getFloatValue();
	
	switch(propertyType)
	{
		case MLProperty::kFloatProperty:
			setParameterWithoutProperty (property, f);
			if (paramIdx < 0) return;
			
			// convert to host units for VST
			f = newVal.getFloatValue();
			if (wrapperType == AudioProcessor::wrapperType_VST)
			{
				MLPublishedParamPtr p = mEngine.getParamPtr(paramIdx);
				if(p)
				{
					f = p->getValueAsLinearProportion();
				}
			}
			// send to wrapper in host units
			AudioProcessor::sendParamChangeMessageToListeners (paramIdx, f);
			
			break;
		case MLProperty::kStringProperty:
			break;
		case MLProperty::kSignalProperty:
			break;
		default:
			break;
	}
}
Esempio n. 2
0
void MLPluginProcessor::doPropertyChangeAction(MLSymbol propName, const MLProperty& newVal)
{
	int propertyType = newVal.getType();
	int paramIdx = getParameterIndex(propName);
	if (paramIdx < 0) return;
	float f = newVal.getFloatValue();
	
	switch(propertyType)
	{
		case MLProperty::kFloatProperty:
		{
			// update DSP engine parameters
			MLPublishedParamPtr p = mEngine.getParamPtr(paramIdx);
			if(p)
			{
				// set published float parameter in DSP engine.
				setParameterWithoutProperty (propName, f);
				
				// convert to host units for VST
				f = newVal.getFloatValue();
				if (wrapperType == AudioProcessor::wrapperType_VST)
				{
					f = p->getValueAsLinearProportion();
				}
				
				// either enqueue change, or send change immediately to host wrapper
				if(p->getNeedsQueue())
				{
					p->pushValue(f);
				}
				else
				{
					AudioProcessor::sendParamChangeMessageToListeners (paramIdx, f);
				}
			}
		}
		break;
		case MLProperty::kStringProperty:
		{
			// set published string parameter in DSP engine.
			const std::string& sigVal = newVal.getStringValue();
			setStringParameterWithoutProperty (propName, sigVal);
		}
		break;
		case MLProperty::kSignalProperty:
		{
			// set published signal parameter in DSP engine.
			const MLSignal& sigVal = newVal.getSignalValue();
			setSignalParameterWithoutProperty (propName, sigVal);
		}
		break;
		default:
		break;
	}
}