1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-06 04:00:08 +00:00

Added a method AudioProcessor::isParameterInverted(), and support for this in AAX/RTAS

This commit is contained in:
jules 2014-05-28 16:44:02 +01:00
parent c830483129
commit d01a508217
4 changed files with 19 additions and 9 deletions

View file

@ -835,7 +835,7 @@ struct AAXClasses
AAX_IParameter* parameter
= new AAX_CParameter<float> (IndexAsParamID (parameterIndex),
audioProcessor.getParameterName (parameterIndex, 31).toRawUTF8(),
audioProcessor.getParameter (parameterIndex),
audioProcessor.getParameterDefaultValue (parameterIndex),
AAX_CLinearTaperDelegate<float, 0>(),
AAX_CNumberDisplayDelegate<float, 3>(),
audioProcessor.isParameterAutomatable (parameterIndex));
@ -847,6 +847,12 @@ struct AAXClasses
parameter->SetType (parameterNumSteps > 1000 ? AAX_eParameterType_Continuous
: AAX_eParameterType_Discrete);
parameter->SetOrientation (audioProcessor.isParameterOrientationInverted (parameterIndex)
? (AAX_eParameterOrientation_RightMinLeftMax | AAX_eParameterOrientation_TopMinBottomMax
| AAX_eParameterOrientation_RotarySingleDotMode | AAX_eParameterOrientation_RotaryRightMinLeftMax)
: (AAX_eParameterOrientation_LeftMinRightMax | AAX_eParameterOrientation_BottomMinTopMax
| AAX_eParameterOrientation_RotarySingleDotMode | AAX_eParameterOrientation_RotaryLeftMinRightMax));
mParameterManager.AddParameter (parameter);
}
}

View file

@ -856,8 +856,9 @@ private:
long GetOrientation() const
{
return kDAE_LeftMinRightMax | kDAE_BottomMinTopMax
| kDAE_RotarySingleDotMode | kDAE_RotaryLeftMinRightMax;
return juceFilter->isParameterOrientationInverted (index)
? kDAE_RightMinLeftMax | kDAE_TopMinBottomMax | kDAE_RotarySingleDotMode | kDAE_RotaryRightMinLeftMax
: kDAE_LeftMinRightMax | kDAE_BottomMinTopMax | kDAE_RotarySingleDotMode | kDAE_RotaryLeftMinRightMax;
}
long GetControlType() const { return kDAE_ContinuousValues; }

View file

@ -201,9 +201,10 @@ void AudioProcessor::updateHostDisplay()
l->audioProcessorChanged (this);
}
String AudioProcessor::getParameterLabel (int) const { return String(); }
bool AudioProcessor::isParameterAutomatable (int) const { return true; }
bool AudioProcessor::isMetaParameter (int) const { return false; }
String AudioProcessor::getParameterLabel (int) const { return String(); }
bool AudioProcessor::isParameterOrientationInverted (int) const { return false; }
bool AudioProcessor::isParameterAutomatable (int) const { return true; }
bool AudioProcessor::isMetaParameter (int) const { return false; }
void AudioProcessor::suspendProcessing (const bool shouldBeSuspended)
{

View file

@ -431,6 +431,11 @@ public:
*/
virtual String getParameterLabel (int index) const;
/** This can be overridden to tell the host that particular parameters operate in the
reverse direction. (Not all plugin formats or hosts will actually use this information).
*/
virtual bool isParameterOrientationInverted (int index) const;
/** The host will call this method to change the value of one of the filter's parameters.
The host may call this at any time, including during the audio processing
@ -459,16 +464,13 @@ public:
void setParameterNotifyingHost (int parameterIndex, float newValue);
/** Returns true if the host can automate this parameter.
By default, this returns true for all parameters.
*/
virtual bool isParameterAutomatable (int parameterIndex) const;
/** Should return true if this parameter is a "meta" parameter.
A meta-parameter is a parameter that changes other params. It is used
by some hosts (e.g. AudioUnit hosts).
By default this returns false.
*/
virtual bool isMetaParameter (int parameterIndex) const;