From 4dfd69f3631e46e0cf06488103a30fe163649aae Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Tue, 22 Jan 2019 22:52:41 +1100 Subject: [PATCH] fixed non-mac issues --- effects/internal/vsthost.cpp | 12 ++++++------ effects/internal/vsthost.h | 2 +- io/crossplatformlib.cpp | 2 ++ project/effect.cpp | 4 ++-- project/effectloaders.cpp | 2 +- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/effects/internal/vsthost.cpp b/effects/internal/vsthost.cpp index fc4f05f7a..f6d29a0a6 100644 --- a/effects/internal/vsthost.cpp +++ b/effects/internal/vsthost.cpp @@ -1,6 +1,6 @@ #include "vsthost.h" -#if (defined(_WIN32) || defined(__APPLE__)) && !defined(NOVST) +#ifndef NOVST // adapted from http://teragonaudio.com/article/How-to-make-your-own-VST-host.html @@ -39,12 +39,12 @@ extern "C" { break; case audioMasterGetCurrentProcessLevel: return 0; - // Handle other opcodes here... there will be lots of them + // modulePtr other opcodes here... there will be lots of them case audioMasterEndEdit: // change made mainWindow->setWindowModified(true); break; default: - qInfo() << "Plugin requested unhandled opcode" << opcode; + qInfo() << "Plugin requested unmodulePtrd opcode" << opcode; break; } return 0; @@ -92,8 +92,8 @@ void VSTHost::loadPlugin() { return; } #else - handle = LibLoad(dll_fn); - if(handle == nullptr) { + modulePtr = LibLoad(dll_fn); + if(modulePtr == nullptr) { QString dll_error; #ifdef _WIN32 @@ -151,7 +151,7 @@ bool VSTHost::configurePluginCallbacks() { return false; } - // Create dispatcher handle + // Create dispatcher modulePtr dispatcher = reinterpret_cast(plugin->dispatcher); // Set up plugin callback functions diff --git a/effects/internal/vsthost.h b/effects/internal/vsthost.h index fd6a7afaf..58e6ddfa9 100644 --- a/effects/internal/vsthost.h +++ b/effects/internal/vsthost.h @@ -1,7 +1,7 @@ #ifndef VSTHOSTWIN_H #define VSTHOSTWIN_H -#if (defined(_WIN32) || defined(__APPLE__)) && !defined(NOVST) +#ifndef NOVST #include "project/effect.h" diff --git a/io/crossplatformlib.cpp b/io/crossplatformlib.cpp index ba0443451..8b4f45fe9 100644 --- a/io/crossplatformlib.cpp +++ b/io/crossplatformlib.cpp @@ -22,6 +22,7 @@ QStringList LibFilter() { #endif } +#ifdef __APPLE__ CFBundleRef BundleLoad(const QString &filename) { CFStringRef bundle_str = CFStringCreateWithCString(NULL, filename.toUtf8(), kCFStringEncodingUTF8); CFURLRef bundle_url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, bundle_str, kCFURLPOSIXPathStyle, true); @@ -40,3 +41,4 @@ void BundleClose(CFBundleRef bundle) { CFBundleUnloadExecutable(bundle); CFRelease(bundle); } +#endif diff --git a/project/effect.cpp b/project/effect.cpp index 95aa3e786..2b475d1eb 100644 --- a/project/effect.cpp +++ b/project/effect.cpp @@ -28,7 +28,7 @@ #include "effects/internal/paneffect.h" #include "effects/internal/shakeeffect.h" #include "effects/internal/cornerpineffect.h" -#if defined(_WIN32) || defined(__APPLE__) +#ifndef NOVST #include "effects/internal/vsthost.h" #endif #include "effects/internal/fillleftrighteffect.h" @@ -64,7 +64,7 @@ Effect* create_effect(Clip* c, const EffectMeta* em) { case EFFECT_INTERNAL_SHAKE: return new ShakeEffect(c, em); case EFFECT_INTERNAL_CORNERPIN: return new CornerPinEffect(c, em); case EFFECT_INTERNAL_FILLLEFTRIGHT: return new FillLeftRightEffect(c, em); -#if (defined(_WIN32) || defined(__APPLE__)) && !defined(NOVST) +#ifndef NOVST case EFFECT_INTERNAL_VST: return new VSTHost(c, em); #endif #ifndef NOFREI0R diff --git a/project/effectloaders.cpp b/project/effectloaders.cpp index cea30a598..716145695 100644 --- a/project/effectloaders.cpp +++ b/project/effectloaders.cpp @@ -34,7 +34,7 @@ void load_internal_effects() { em.internal = EFFECT_INTERNAL_PAN; effects.append(em); -#if (defined(_WIN32) || defined(__APPLE__)) && !defined(NOVST) +#ifndef NOVST em.name = "VST Plugin 2.x"; em.internal = EFFECT_INTERNAL_VST; effects.append(em);