1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-17 00:44:19 +00:00

Added JUCE_USE_STUDIO_ONE_COMPATIBLE_PARAMETERS option to workaround a Studio One bug

This commit is contained in:
hogliux 2016-11-17 14:18:00 +00:00
parent 9a7ee9fdbb
commit e49022bfba
3 changed files with 29 additions and 1 deletions

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());
}

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());
}

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"