From dffe7813184e5bb838de2fe76cffe92fff51a105 Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 20 May 2015 16:55:55 +0100 Subject: [PATCH] Fix for RTAS parameter default values. --- .../RTAS/juce_RTAS_Wrapper.cpp | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp b/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp index 3cc690a626..50b8609d30 100644 --- a/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp @@ -471,7 +471,7 @@ public: DefineMasterBypassControlIndex (bypassControlIndex); for (int i = 0; i < juceFilter->getNumParameters(); ++i) - AddControl (new JucePluginControl (juceFilter, i)); + AddControl (new JucePluginControl (*juceFilter, i)); // we need to do this midi log-in to get timecode, regardless of whether // the plugin actually uses midi... @@ -807,17 +807,17 @@ private: { public: //============================================================================== - JucePluginControl (AudioProcessor* const juceFilter_, const int index_) - : juceFilter (juceFilter_), - index (index_) + JucePluginControl (AudioProcessor& p, const int i) + : processor (p), index (i) { + CPluginControl::SetValue (GetDefaultValue()); } //============================================================================== OSType GetID() const { return index + 1; } - long GetDefaultValue() const { return floatToLong (juceFilter->getParameterDefaultValue (index)); } + long GetDefaultValue() const { return floatToLong (processor.getParameterDefaultValue (index)); } void SetDefaultValue (long) {} - long GetNumSteps() const { return juceFilter->getParameterNumSteps (index); } + long GetNumSteps() const { return processor.getParameterNumSteps (index); } long ConvertStringToValue (const char* valueString) const { @@ -829,16 +829,16 @@ private: void GetNameOfLength (char* name, int maxLength, OSType inControllerType) const { // Pro-tools expects all your parameters to have valid names! - jassert (juceFilter->getParameterName (index, maxLength).isNotEmpty()); + jassert (processor.getParameterName (index, maxLength).isNotEmpty()); - juceFilter->getParameterName (index, maxLength).copyToUTF8 (name, (size_t) maxLength + 1); + processor.getParameterName (index, maxLength).copyToUTF8 (name, (size_t) maxLength + 1); } long GetPriority() const { return kFicCooperativeTaskPriority; } long GetOrientation() const { - return juceFilter->isParameterOrientationInverted (index) + return processor.isParameterOrientationInverted (index) ? kDAE_RightMinLeftMax | kDAE_TopMinBottomMax | kDAE_RotarySingleDotMode | kDAE_RotaryRightMinLeftMax : kDAE_LeftMinRightMax | kDAE_BottomMinTopMax | kDAE_RotarySingleDotMode | kDAE_RotaryLeftMinRightMax; } @@ -847,17 +847,17 @@ private: void GetValueString (char* valueString, int maxLength, long value) const { - juceFilter->getParameterText (index, maxLength).copyToUTF8 (valueString, (size_t) maxLength + 1); + processor.getParameterText (index, maxLength).copyToUTF8 (valueString, (size_t) maxLength + 1); } Cmn_Bool IsAutomatable() const { - return juceFilter->isParameterAutomatable (index); + return processor.isParameterAutomatable (index); } private: //============================================================================== - AudioProcessor* const juceFilter; + AudioProcessor& processor; const int index; JUCE_DECLARE_NON_COPYABLE (JucePluginControl)