Browse Source

Added JUCE_USE_STUDIO_ONE_COMPATIBLE_PARAMETERS option to workaround a Studio One bug

tags/2021-05-28
hogliux 9 years ago
parent
commit
e49022bfba
3 changed files with 29 additions and 1 deletions
  1. +9
    -1
      modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm
  2. +7
    -0
      modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
  3. +13
    -0
      modules/juce_audio_plugin_client/juce_audio_plugin_client.h

+ 9
- 1
modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm View File

@@ -1698,7 +1698,15 @@ private:
if (isPositiveAndBelow (paramIndex, n))
{
const String& juceParamID = juceFilter->getParameterID (paramIndex);
return usingManagedParameter ? static_cast<AudioUnitParameterID> (juceParamID.hashCode())
AudioUnitParameterID paramHash = static_cast<AudioUnitParameterID> (juceParamID.hashCode());
#if JUCE_USE_STUDIO_ONE_COMPATIBLE_PARAMETERS
// studio one doesn't like negative parameters
paramHash &= ~(1 << (sizeof (AudioUnitParameterID) * 8 - 1));
#endif
return usingManagedParameter ? paramHash
: static_cast<AudioUnitParameterID> (juceParamID.getIntValue());
}


+ 7
- 0
modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp View File

@@ -683,6 +683,13 @@ private:
if (isPositiveAndBelow (paramIndex, n))
{
const String& juceParamID = pluginFilter->getParameterID (paramIndex);
Vst::ParamID paramHash = static_cast<Vst::ParamID> (juceParamID.hashCode());
#if JUCE_USE_STUDIO_ONE_COMPATIBLE_PARAMETERS
// studio one doesn't like negative parameters
paramHash &= ~(1 << (sizeof (Vst::ParamID) * 8 - 1));
#endif
return managedParameter ? static_cast<Vst::ParamID> (juceParamID.hashCode())
: static_cast<Vst::ParamID> (juceParamID.getIntValue());
}


+ 13
- 0
modules/juce_audio_plugin_client/juce_audio_plugin_client.h View File

@@ -64,6 +64,19 @@
#define JUCE_FORCE_USE_LEGACY_PARAM_IDS 0
#endif
/** Config: JUCE_USE_STUDIO_ONE_COMPATIBLE_PARAMETERS
Enable this if you want JUCE to use parameter ids which are compatible
to Studio One. Studio One ignores any parameter ids which are negative.
Enabling this option will make JUCE generate only positive parameter ids.
Note that if you have already released a plug-in prio to JUCE 4.3.0 then
enabling this will change your parameter ids making your plug-in
incompatible to old automation data.
*/
#ifndef JUCE_USE_STUDIO_ONE_COMPATIBLE_PARAMETERS
#define JUCE_USE_STUDIO_ONE_COMPATIBLE_PARAMETERS 1
#endif
namespace juce
{
#include "utility/juce_PluginHostType.h"


Loading…
Cancel
Save