mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-11 23:54:18 +00:00
VST3 Host: Add cross-platform-compatible VST3 uid hash
This commit is contained in:
parent
be0c36001d
commit
241bb8d430
5 changed files with 24 additions and 4 deletions
|
|
@ -42,14 +42,15 @@ target_compile_definitions(AudioPluginHost PRIVATE
|
|||
JUCE_ALSA=1
|
||||
JUCE_DIRECTSOUND=1
|
||||
JUCE_PLUGINHOST_LADSPA=1
|
||||
JUCE_PLUGINHOST_VST=0
|
||||
JUCE_PLUGINHOST_VST3=1
|
||||
JUCE_PLUGINHOST_VST=0
|
||||
JUCE_USE_CAMERA=0
|
||||
JUCE_USE_CDBURNER=0
|
||||
JUCE_USE_CDREADER=0
|
||||
JUCE_USE_CURL=0
|
||||
JUCE_USE_FLAC=0
|
||||
JUCE_USE_OGGVORBIS=1
|
||||
JUCE_VST3_HOST_CROSS_PLATFORM_UID=1
|
||||
JUCE_WASAPI=1
|
||||
JUCE_WEB_BROWSER=0)
|
||||
|
||||
|
|
|
|||
|
|
@ -2257,7 +2257,9 @@ function(juce_add_pip header)
|
|||
|
||||
target_compile_definitions(${JUCE_PIP_NAME}
|
||||
PRIVATE ${pip_moduleflags}
|
||||
PUBLIC JUCE_VST3_CAN_REPLACE_VST2=0)
|
||||
PUBLIC
|
||||
JUCE_VST3_CAN_REPLACE_VST2=0
|
||||
JUCE_VST3_HOST_CROSS_PLATFORM_UID=1)
|
||||
|
||||
_juce_get_pip_targets(${JUCE_PIP_NAME} pip_targets)
|
||||
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ static void doBasicProjectSetup (Project& project, const NewProjectTemplates::Pr
|
|||
project.getMainGroup().addNewSubGroup ("Source", 0);
|
||||
|
||||
project.getConfigFlag ("JUCE_STRICT_REFCOUNTEDPOINTER") = true;
|
||||
project.getConfigFlag ("JUCE_VST3_HOST_CROSS_PLATFORM_UID") = true;
|
||||
project.getProjectValue (Ids::useAppConfig) = false;
|
||||
project.getProjectValue (Ids::addUsingNamespaceToJuceHeader) = false;
|
||||
|
||||
|
|
|
|||
|
|
@ -81,10 +81,17 @@ static int warnOnFailureIfImplemented (int result) noexcept
|
|||
//==============================================================================
|
||||
static int getHashForTUID (const TUID& tuid) noexcept
|
||||
{
|
||||
#if JUCE_VST3_HOST_CROSS_PLATFORM_UID
|
||||
const FUID fuid { tuid };
|
||||
const uint32 inputArray[] { fuid.getLong1(), fuid.getLong2(), fuid.getLong3(), fuid.getLong4() };
|
||||
#else
|
||||
const auto& inputArray = tuid;
|
||||
#endif
|
||||
|
||||
uint32 value = 0;
|
||||
|
||||
for (int i = 0; i < numElementsInArray (tuid); ++i)
|
||||
value = (value * 31) + (uint32) tuid[i];
|
||||
for (const auto& item : inputArray)
|
||||
value = (value * 31) + (uint32) item;
|
||||
|
||||
return (int) value;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,6 +102,15 @@
|
|||
#define JUCE_CUSTOM_VST3_SDK 0
|
||||
#endif
|
||||
|
||||
/** Config: JUCE_VST3_HOST_CROSS_PLATFORM_UID
|
||||
If enabled, ensures that PluginDescription::uid will produce consistent values for VST3 plugins on all platforms.
|
||||
It is recommended to enable this flag in all new projects.
|
||||
Projects which predate this flag should leave it disabled, in case they need to interact with uid values which they previously stored.
|
||||
*/
|
||||
#ifndef JUCE_VST3_HOST_CROSS_PLATFORM_UID
|
||||
#define JUCE_VST3_HOST_CROSS_PLATFORM_UID 0
|
||||
#endif
|
||||
|
||||
#if ! (JUCE_PLUGINHOST_AU || JUCE_PLUGINHOST_VST || JUCE_PLUGINHOST_VST3 || JUCE_PLUGINHOST_LADSPA)
|
||||
// #error "You need to set either the JUCE_PLUGINHOST_AU and/or JUCE_PLUGINHOST_VST and/or JUCE_PLUGINHOST_VST3 and/or JUCE_PLUGINHOST_LADSPA flags if you're using this module!"
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue