13
0

Add script to copy VST3 headers

This commit is contained in:
Robin Gareus 2019-09-03 16:33:02 +02:00
parent a2e4a09d55
commit 08b6d74078
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
3 changed files with 195 additions and 0 deletions

59
tools/update_vst3.sh Executable file
View File

@ -0,0 +1,59 @@
#!/bin/bash
if ! test -f wscript || ! test -d gtk2_ardour || ! test -d libs/vst3/; then
echo "This script needs to run from ardour's top-level src tree"
exit 1
fi
if test -z "`which rsync`" -o -z "`which git`"; then
echo "this script needs rsync and git"
exit 1
fi
ASRC=`pwd`
set -e
rm -rf libs/vst3/pluginterfaces/gui
rm -rf libs/vst3/pluginterfaces/vst
rm -rf libs/vst3/pluginterfaces/base
mkdir -p libs/vst3/pluginterfaces/gui
mkdir -p libs/vst3/pluginterfaces/vst
mkdir -p libs/vst3/pluginterfaces/base
TMP=`mktemp -d`
test -d $TMP
trap "rm -rf $TMP" EXIT
cd $TMP
git clone https://github.com/steinbergmedia/vst3_pluginterfaces.git
cd vst3_pluginterfaces/
git reset --hard a21cdf3779726b2fe8eea0a8c36ebd698f4f0e82
rsync -auc --info=name0 \
base/conststringtable.cpp \
base/conststringtable.h \
base/falignpop.h \
base/falignpush.h \
base/fplatform.h \
base/fstrdefs.h \
base/ftypes.h \
base/funknown.cpp \
base/funknown.h \
base/ibstream.h \
base/ipluginbase.h \
base/istringresult.h \
base/smartpointer.h \
base/typesizecheck.h \
"$ASRC/libs/vst3/pluginterfaces/base/"
rsync -auc --info=name0 \
vst gui \
"$ASRC/libs/vst3/pluginterfaces/"
cd "$ASRC"
patch -p1 < tools/vst3-patches/vst3-cxx98.diff
patch -p1 < tools/vst3-patches/vst3-uuid.diff
#git add libs/vst3/pluginterfaces/

View File

@ -0,0 +1,84 @@
diff --git b/libs/vst3/pluginterfaces/base/fplatform.h a/libs/vst3/pluginterfaces/base/fplatform.h
index 3a93738937..7db1c5d222 100644
--- b/libs/vst3/pluginterfaces/base/fplatform.h
+++ a/libs/vst3/pluginterfaces/base/fplatform.h
@@ -115,8 +115,8 @@
#ifndef SMTG_CPP11
#error unsupported compiler
#endif
- #define SMTG_CPP11_STDLIBSUPPORT 1
- #define SMTG_HAS_NOEXCEPT 1
+ #define SMTG_CPP11_STDLIBSUPPORT SMTG_CPP11
+ #define SMTG_HAS_NOEXCEPT SMTG_CPP11
#endif
//-----------------------------------------------------------------------------
// Mac and iOS
diff --git b/libs/vst3/pluginterfaces/vst/ivstnoteexpression.h a/libs/vst3/pluginterfaces/vst/ivstnoteexpression.h
index dd04d14f6a..87f5feac91 100644
--- b/libs/vst3/pluginterfaces/vst/ivstnoteexpression.h
+++ a/libs/vst3/pluginterfaces/vst/ivstnoteexpression.h
@@ -34,7 +34,10 @@ VST predefines some types like volume, pan, tuning by defining their ranges and
Used by NoteExpressionEvent::typeId and NoteExpressionTypeID::typeId
\see NoteExpressionTypeInfo
*/
-enum NoteExpressionTypeIDs : uint32
+enum NoteExpressionTypeIDs
+#if SMTG_CPP11
+ : uint32
+#endif
{
kVolumeTypeID = 0, ///< Volume, plain range [0 = -oo , 0.25 = 0dB, 0.5 = +6dB, 1 = +12dB]: plain = 20 * log (4 * norm)
kPanTypeID, ///< Panning (L-R), plain range [0 = left, 0.5 = center, 1 = right]
@@ -183,7 +186,10 @@ DECLARE_CLASS_IID (INoteExpressionController, 0xB7F8F859, 0x41234872, 0x91169581
/** KeyswitchTypeIDs describes the type of a key switch
\see KeyswitchInfo
*/
-enum KeyswitchTypeIDs : uint32
+enum KeyswitchTypeIDs
+#if SMTG_CPP11
+: uint32
+#endif
{
kNoteOnKeyswitchTypeID = 0, ///< press before noteOn is played
kOnTheFlyKeyswitchTypeID, ///< press while noteOn is played
diff --git b/libs/vst3/pluginterfaces/gui/iplugview.h a/libs/vst3/pluginterfaces/gui/iplugview.h
index 32e1fcb3bd..9d6ec9a0d4 100644
--- b/libs/vst3/pluginterfaces/gui/iplugview.h
+++ a/libs/vst3/pluginterfaces/gui/iplugview.h
@@ -213,8 +213,8 @@ DECLARE_CLASS_IID (IPlugFrame, 0x367FAF01, 0xAFA94693, 0x8D4DA2A0, 0xED0882A3)
//------------------------------------------------------------------------
namespace Linux {
-using TimerInterval = uint64;
-using FileDescriptor = int;
+#define TimerInterval uint64
+#define FileDescriptor int
//------------------------------------------------------------------------
/** Linux event handler interface
diff --git a/libs/vst3/pluginterfaces/base/ftypes.h b/libs/vst3/pluginterfaces/base/ftypes.h
index feda6b0b9b..5f61e0ac81 100644
--- a/libs/vst3/pluginterfaces/base/ftypes.h
+++ b/libs/vst3/pluginterfaces/base/ftypes.h
@@ -93,6 +93,8 @@ namespace Steinberg
typedef char char8;
#ifdef _NATIVE_WCHAR_T_DEFINED
typedef __wchar_t char16;
+#elif defined(__MINGW32__)
+ typedef wchar_t char16;
#elif SMTG_CPP11
typedef char16_t char16;
#else
diff --git a/libs/vst3/pluginterfaces/base/funknown.cpp b/libs/vst3/pluginterfaces/base/funknown.cpp
index 0419bbc4bb..f205ac88de 100644
--- a/libs/vst3/pluginterfaces/base/funknown.cpp
+++ b/libs/vst3/pluginterfaces/base/funknown.cpp
@@ -68,7 +68,7 @@ namespace FUnknownPrivate {
int32 PLUGIN_API atomicAdd (int32& var, int32 d)
{
#if SMTG_OS_WINDOWS
- return InterlockedExchangeAdd (&var, d) + d;
+ return InterlockedExchangeAdd ((volatile long int*)&var, d) + d;
#elif SMTG_OS_MACOS
return OSAtomicAdd32Barrier (d, (int32_t*)&var);
#elif SMTG_OS_LINUX

View File

@ -0,0 +1,52 @@
diff --git a/libs/vst3/pluginterfaces/base/funknown.cpp b/libs/vst3/pluginterfaces/base/funknown.cpp
index f205ac88de..09d5d27836 100644
--- a/libs/vst3/pluginterfaces/base/funknown.cpp
+++ b/libs/vst3/pluginterfaces/base/funknown.cpp
@@ -22,6 +22,14 @@
#if SMTG_OS_WINDOWS
#include <objbase.h>
+
+#if defined(__MINGW32__)
+/* UUID */
+#include <string>
+#include <boost/uuid/uuid.hpp>
+#include <boost/uuid/uuid_generators.hpp>
+#endif
+
#endif
#if SMTG_OS_MACOS
@@ -37,6 +45,10 @@
#if SMTG_OS_LINUX
#include <ext/atomicity.h>
+/* UUID */
+#include <string>
+#include <boost/uuid/uuid.hpp>
+#include <boost/uuid/uuid_generators.hpp>
#endif
namespace Steinberg {
@@ -124,6 +136,10 @@ bool FUID::generate ()
#if defined(_M_ARM64) || defined(_M_ARM)
//#warning implement me!
return false;
+#elif defined(__MINGW32__)
+ boost::uuids::uuid u = boost::uuids::random_generator()();
+ memcpy(data, (const void*)&u, 16);
+ return true;
#else
GUID guid;
HRESULT hr = CoCreateGuid (&guid);
@@ -147,6 +163,10 @@ bool FUID::generate ()
}
return false;
+#elif SMTG_OS_LINUX
+ boost::uuids::uuid u = boost::uuids::random_generator()();
+ memcpy(data, (const void*)&u, 16);
+ return true;
#else
#warning implement me!
return false;