fix macOS build (following Projucer changes made in Windows, which removed /Applications/JUCE/modules from its headers). move JUCE headers under source control, so that Windows and macOS can both build against same version of JUCE. remove AUv3 target (I think it's an iOS thing, so it will never work with this macOS fluidsynth dylib).
This commit is contained in:
@ -0,0 +1,81 @@
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2017 - ROLI Ltd.
|
||||
|
||||
JUCE is an open source library subject to commercial or open-source
|
||||
licensing.
|
||||
|
||||
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
|
||||
Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
|
||||
27th April 2017).
|
||||
|
||||
End User License Agreement: www.juce.com/juce-5-licence
|
||||
Privacy Policy: www.juce.com/juce-5-privacy-policy
|
||||
|
||||
Or: You may also use this code under the terms of the GPL v3 (see
|
||||
www.gnu.org/licenses).
|
||||
|
||||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
||||
DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
namespace juce
|
||||
{
|
||||
|
||||
//==============================================================================
|
||||
#if JUCE_SUPPORT_CARBON && JUCE_MAC_WINDOW_VISIBITY_BODGE
|
||||
|
||||
/* When you wrap a WindowRef as an NSWindow, it seems to bugger up the HideWindow
|
||||
function, so when the host tries (and fails) to hide the window, this stuff catches
|
||||
the event and forces it to update.
|
||||
*/
|
||||
static pascal OSStatus windowVisibilityBodge (EventHandlerCallRef, EventRef e, void* user)
|
||||
{
|
||||
NSWindow* hostWindow = (NSWindow*) user;
|
||||
|
||||
switch (GetEventKind (e))
|
||||
{
|
||||
case kEventWindowInit: [hostWindow display]; break;
|
||||
case kEventWindowShown: [hostWindow orderFront: nil]; break;
|
||||
case kEventWindowHidden: [hostWindow orderOut: nil]; break;
|
||||
}
|
||||
|
||||
return eventNotHandledErr;
|
||||
}
|
||||
|
||||
inline void attachWindowHidingHooks (Component* comp, void* hostWindowRef, NSWindow* nsWindow)
|
||||
{
|
||||
const EventTypeSpec eventsToCatch[] =
|
||||
{
|
||||
{ kEventClassWindow, kEventWindowInit },
|
||||
{ kEventClassWindow, kEventWindowShown },
|
||||
{ kEventClassWindow, kEventWindowHidden }
|
||||
};
|
||||
|
||||
EventHandlerRef ref;
|
||||
InstallWindowEventHandler ((WindowRef) hostWindowRef,
|
||||
NewEventHandlerUPP (windowVisibilityBodge),
|
||||
GetEventTypeCount (eventsToCatch), eventsToCatch,
|
||||
(void*) nsWindow, &ref);
|
||||
|
||||
comp->getProperties().set ("carbonEventRef", String::toHexString ((pointer_sized_int) (void*) ref));
|
||||
}
|
||||
|
||||
inline void removeWindowHidingHooks (Component* comp)
|
||||
{
|
||||
if (comp != nullptr)
|
||||
RemoveEventHandler ((EventHandlerRef) (void*) (pointer_sized_int)
|
||||
comp->getProperties() ["carbonEventRef"].toString().getHexValue64());
|
||||
}
|
||||
|
||||
#elif JUCE_MAC
|
||||
inline void attachWindowHidingHooks (void*, void*, void*) {}
|
||||
inline void removeWindowHidingHooks (void*) {}
|
||||
#endif
|
||||
|
||||
} // namespace juce
|
@ -0,0 +1,120 @@
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2017 - ROLI Ltd.
|
||||
|
||||
JUCE is an open source library subject to commercial or open-source
|
||||
licensing.
|
||||
|
||||
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
|
||||
Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
|
||||
27th April 2017).
|
||||
|
||||
End User License Agreement: www.juce.com/juce-5-licence
|
||||
Privacy Policy: www.juce.com/juce-5-privacy-policy
|
||||
|
||||
Or: You may also use this code under the terms of the GPL v3 (see
|
||||
www.gnu.org/licenses).
|
||||
|
||||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
||||
DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
// The following checks should cause a compile error if you've forgotten to
|
||||
// define all your plugin settings properly..
|
||||
|
||||
#if ! (JucePlugin_Build_VST || JucePlugin_Build_VST3 \
|
||||
|| JucePlugin_Build_AU || JucePlugin_Build_AUv3 \
|
||||
||JucePlugin_Build_RTAS || JucePlugin_Build_AAX \
|
||||
|| JucePlugin_Build_Standalone || JucePlugin_Build_LV2)
|
||||
#error "You need to enable at least one plugin format!"
|
||||
#endif
|
||||
|
||||
#ifdef JUCE_CHECKSETTINGMACROS_H
|
||||
#error "This header should never be included twice! Otherwise something is wrong."
|
||||
#endif
|
||||
#define JUCE_CHECKSETTINGMACROS_H
|
||||
|
||||
#ifndef JucePlugin_IsSynth
|
||||
#error "You need to define the JucePlugin_IsSynth value!"
|
||||
#endif
|
||||
|
||||
#ifndef JucePlugin_ManufacturerCode
|
||||
#error "You need to define the JucePlugin_ManufacturerCode value!"
|
||||
#endif
|
||||
|
||||
#ifndef JucePlugin_PluginCode
|
||||
#error "You need to define the JucePlugin_PluginCode value!"
|
||||
#endif
|
||||
|
||||
#ifndef JucePlugin_ProducesMidiOutput
|
||||
#error "You need to define the JucePlugin_ProducesMidiOutput value!"
|
||||
#endif
|
||||
|
||||
#ifndef JucePlugin_WantsMidiInput
|
||||
#error "You need to define the JucePlugin_WantsMidiInput value!"
|
||||
#endif
|
||||
|
||||
#ifdef JucePlugin_Latency
|
||||
#error "JucePlugin_Latency is now deprecated - instead, call the AudioProcessor::setLatencySamples() method if your plugin has a non-zero delay"
|
||||
#endif
|
||||
|
||||
#ifndef JucePlugin_EditorRequiresKeyboardFocus
|
||||
#error "You need to define the JucePlugin_EditorRequiresKeyboardFocus value!"
|
||||
#endif
|
||||
|
||||
//==============================================================================
|
||||
#if _WIN64 || (__LP64__ && (defined (__APPLE_CPP__) || defined (__APPLE_CC__)))
|
||||
#undef JucePlugin_Build_RTAS
|
||||
#define JucePlugin_Build_RTAS 0
|
||||
#endif
|
||||
|
||||
#if ! (defined (_MSC_VER) || defined (__APPLE_CPP__) || defined (__APPLE_CC__))
|
||||
#undef JucePlugin_Build_VST3
|
||||
#define JucePlugin_Build_VST3 0
|
||||
#endif
|
||||
|
||||
//==============================================================================
|
||||
#if JucePlugin_Build_LV2 && ! defined (JucePlugin_LV2URI)
|
||||
#error "You need to define the JucePlugin_LV2URI value!"
|
||||
#endif
|
||||
|
||||
#if JucePlugin_Build_AAX && ! defined (JucePlugin_AAXIdentifier)
|
||||
#error "You need to define the JucePlugin_AAXIdentifier value!"
|
||||
#endif
|
||||
|
||||
#if defined (__ppc__)
|
||||
#undef JucePlugin_Build_AAX
|
||||
#define JucePlugin_Build_AAX 0
|
||||
#endif
|
||||
|
||||
//==============================================================================
|
||||
#if JucePlugin_Build_VST
|
||||
|
||||
#if JucePlugin_VersionCode < 0x010000 // Major < 0
|
||||
|
||||
#if (JucePlugin_VersionCode & 0x00FF00) > (9 * 0x100) // check if Minor number exceeeds 9
|
||||
#warning When version has "major" = 0, VST2 has trouble displaying "minor" exceeding 9
|
||||
#endif
|
||||
|
||||
#if (JucePlugin_VersionCode & 0xFF) > 9 // check if Bugfix number exceeeds 9
|
||||
#warning When version has "major" = 0, VST2 has trouble displaying "bugfix" exceeding 9
|
||||
#endif
|
||||
|
||||
#elif JucePlugin_VersionCode >= 0x650000 // Major >= 101
|
||||
|
||||
#if (JucePlugin_VersionCode & 0x00FF00) > (99 * 0x100) // check if Minor number exceeeds 99
|
||||
#warning When version has "major" > 100, VST2 has trouble displaying "minor" exceeding 99
|
||||
#endif
|
||||
|
||||
#if (JucePlugin_VersionCode & 0xFF) > 99 // check if Bugfix number exceeeds 99
|
||||
#warning When version has "major" > 100, VST2 has trouble displaying "bugfix" exceeding 99
|
||||
#endif
|
||||
|
||||
#endif // JucePlugin_VersionCode
|
||||
|
||||
#endif // JucePlugin_Build_VST
|
@ -0,0 +1,112 @@
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2017 - ROLI Ltd.
|
||||
|
||||
JUCE is an open source library subject to commercial or open-source
|
||||
licensing.
|
||||
|
||||
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
|
||||
Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
|
||||
27th April 2017).
|
||||
|
||||
End User License Agreement: www.juce.com/juce-5-licence
|
||||
Privacy Policy: www.juce.com/juce-5-privacy-policy
|
||||
|
||||
Or: You may also use this code under the terms of the GPL v3 (see
|
||||
www.gnu.org/licenses).
|
||||
|
||||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
||||
DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
namespace juce
|
||||
{
|
||||
|
||||
#ifndef DOXYGEN
|
||||
|
||||
#if JUCE_MAC
|
||||
|
||||
//==============================================================================
|
||||
// Helper class to workaround windows not getting mouse-moves...
|
||||
class FakeMouseMoveGenerator : private Timer
|
||||
{
|
||||
public:
|
||||
FakeMouseMoveGenerator()
|
||||
{
|
||||
startTimer (1000 / 30);
|
||||
}
|
||||
|
||||
static bool componentContainsAudioProcessorEditor (Component* comp) noexcept
|
||||
{
|
||||
if (dynamic_cast<AudioProcessorEditor*> (comp) != nullptr)
|
||||
return true;
|
||||
|
||||
for (auto* child : comp->getChildren())
|
||||
if (componentContainsAudioProcessorEditor (child))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void timerCallback() override
|
||||
{
|
||||
// Workaround for windows not getting mouse-moves...
|
||||
auto screenPos = Desktop::getInstance().getMainMouseSource().getScreenPosition();
|
||||
|
||||
if (screenPos != lastScreenPos)
|
||||
{
|
||||
lastScreenPos = screenPos;
|
||||
auto mods = ModifierKeys::currentModifiers;
|
||||
|
||||
if (! mods.isAnyMouseButtonDown())
|
||||
{
|
||||
if (auto* comp = Desktop::getInstance().findComponentAt (screenPos.roundToInt()))
|
||||
{
|
||||
if (componentContainsAudioProcessorEditor (comp->getTopLevelComponent()))
|
||||
{
|
||||
safeOldComponent = comp;
|
||||
|
||||
if (auto* peer = comp->getPeer())
|
||||
{
|
||||
if (! peer->isFocused())
|
||||
{
|
||||
peer->handleMouseEvent (MouseInputSource::InputSourceType::mouse, peer->globalToLocal (screenPos), mods,
|
||||
MouseInputSource::invalidPressure, MouseInputSource::invalidOrientation, Time::currentTimeMillis());
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (safeOldComponent != nullptr)
|
||||
{
|
||||
if (auto* peer = safeOldComponent->getPeer())
|
||||
{
|
||||
peer->handleMouseEvent (MouseInputSource::InputSourceType::mouse, { -1.0f, -1.0f }, mods,
|
||||
MouseInputSource::invalidPressure, MouseInputSource::invalidOrientation, Time::currentTimeMillis());
|
||||
}
|
||||
}
|
||||
|
||||
safeOldComponent = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
Point<float> lastScreenPos;
|
||||
WeakReference<Component> safeOldComponent;
|
||||
};
|
||||
|
||||
#else
|
||||
struct FakeMouseMoveGenerator {};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace juce
|
@ -0,0 +1,46 @@
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2017 - ROLI Ltd.
|
||||
|
||||
JUCE is an open source library subject to commercial or open-source
|
||||
licensing.
|
||||
|
||||
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
|
||||
Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
|
||||
27th April 2017).
|
||||
|
||||
End User License Agreement: www.juce.com/juce-5-licence
|
||||
Privacy Policy: www.juce.com/juce-5-privacy-policy
|
||||
|
||||
Or: You may also use this code under the terms of the GPL v3 (see
|
||||
www.gnu.org/licenses).
|
||||
|
||||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
||||
DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#include "../juce_audio_plugin_client.h"
|
||||
|
||||
namespace juce
|
||||
{
|
||||
#define Component juce::Component
|
||||
|
||||
#if JUCE_MAC
|
||||
#define Point juce::Point
|
||||
void repostCurrentNSEvent();
|
||||
#endif
|
||||
|
||||
//==============================================================================
|
||||
inline const PluginHostType& getHostType()
|
||||
{
|
||||
static PluginHostType hostType;
|
||||
return hostType;
|
||||
}
|
||||
}
|
||||
|
||||
extern juce::AudioProcessor* JUCE_API JUCE_CALLTYPE createPluginFilterOfType (juce::AudioProcessor::WrapperType);
|
@ -0,0 +1,74 @@
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2017 - ROLI Ltd.
|
||||
|
||||
JUCE is an open source library subject to commercial or open-source
|
||||
licensing.
|
||||
|
||||
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
|
||||
Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
|
||||
27th April 2017).
|
||||
|
||||
End User License Agreement: www.juce.com/juce-5-licence
|
||||
Privacy Policy: www.juce.com/juce-5-privacy-policy
|
||||
|
||||
Or: You may also use this code under the terms of the GPL v3 (see
|
||||
www.gnu.org/licenses).
|
||||
|
||||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
||||
DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#if JUCE_WINDOWS
|
||||
#undef _WIN32_WINNT
|
||||
#define _WIN32_WINNT 0x500
|
||||
#undef STRICT
|
||||
#define STRICT 1
|
||||
#include <windows.h>
|
||||
#include <float.h>
|
||||
#if ! JUCE_MINGW
|
||||
#pragma warning (disable : 4312 4355)
|
||||
#endif
|
||||
#ifdef __INTEL_COMPILER
|
||||
#pragma warning (disable : 1899)
|
||||
#endif
|
||||
|
||||
#elif JUCE_LINUX
|
||||
#include <float.h>
|
||||
#include <sys/time.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/Xatom.h>
|
||||
#undef Font
|
||||
#undef KeyPress
|
||||
#undef Drawable
|
||||
#undef Time
|
||||
#elif JUCE_ANDROID
|
||||
#else
|
||||
#if ! (defined (JUCE_SUPPORT_CARBON) || defined (__LP64__))
|
||||
#define JUCE_SUPPORT_CARBON 1
|
||||
#endif
|
||||
|
||||
#ifdef __OBJC__
|
||||
#if JUCE_MAC
|
||||
#include <Cocoa/Cocoa.h>
|
||||
#elif JUCE_IOS
|
||||
#include <UIKit/UIKit.h>
|
||||
#else
|
||||
#error
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if JUCE_SUPPORT_CARBON && (! JUCE_IOS)
|
||||
#include <Carbon/Carbon.h>
|
||||
#endif
|
||||
|
||||
#include <objc/runtime.h>
|
||||
#include <objc/objc.h>
|
||||
#include <objc/message.h>
|
||||
#endif
|
376
modules/juce_audio_plugin_client/utility/juce_PluginHostType.h
Normal file
376
modules/juce_audio_plugin_client/utility/juce_PluginHostType.h
Normal file
@ -0,0 +1,376 @@
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2017 - ROLI Ltd.
|
||||
|
||||
JUCE is an open source library subject to commercial or open-source
|
||||
licensing.
|
||||
|
||||
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
|
||||
Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
|
||||
27th April 2017).
|
||||
|
||||
End User License Agreement: www.juce.com/juce-5-licence
|
||||
Privacy Policy: www.juce.com/juce-5-privacy-policy
|
||||
|
||||
Or: You may also use this code under the terms of the GPL v3 (see
|
||||
www.gnu.org/licenses).
|
||||
|
||||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
||||
DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
namespace juce
|
||||
{
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
A useful utility class to determine the host or DAW in which your plugin is
|
||||
loaded.
|
||||
|
||||
Declare a PluginHostType object in your class to use it.
|
||||
|
||||
@tags{Audio}
|
||||
*/
|
||||
class PluginHostType
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
PluginHostType() : type (getHostType()) {}
|
||||
PluginHostType (const PluginHostType& other) noexcept : type (other.type) {}
|
||||
PluginHostType& operator= (const PluginHostType& other) noexcept { type = other.type; return *this; }
|
||||
|
||||
//==============================================================================
|
||||
/** Represents the host type and also its version for some hosts. */
|
||||
enum HostType
|
||||
{
|
||||
UnknownHost, /**< Represents an unknown host. */
|
||||
AbletonLive6, /**< Represents Ableton Live 6. */
|
||||
AbletonLive7, /**< Represents Ableton Live 7. */
|
||||
AbletonLive8, /**< Represents Ableton Live 8. */
|
||||
AbletonLiveGeneric, /**< Represents Ableton Live. */
|
||||
AdobeAudition, /**< Represents Adobe Audition. */
|
||||
AdobePremierePro, /**< Represents Adobe Premiere Pro. */
|
||||
AppleGarageBand, /**< Represents Apple GarageBand. */
|
||||
AppleLogic, /**< Represents Apple Logic Pro. */
|
||||
AppleMainStage, /**< Represents Apple Main Stage. */
|
||||
Ardour, /**< Represents Ardour. */
|
||||
AvidProTools, /**< Represents Avid Pro Tools. */
|
||||
BitwigStudio, /**< Represents Bitwig Studio. */
|
||||
CakewalkSonar8, /**< Represents Cakewalk Sonar 8. */
|
||||
CakewalkSonarGeneric, /**< Represents Cakewalk Sonar. */
|
||||
DaVinciResolve, /**< Represents DaVinci Resolve. */
|
||||
DigitalPerformer, /**< Represents Digital Performer. */
|
||||
FinalCut, /**< Represents Apple Final Cut Pro. */
|
||||
FruityLoops, /**< Represents Fruity Loops. */
|
||||
MagixSamplitude, /**< Represents Magix Samplitude. */
|
||||
MergingPyramix, /**< Represents Merging Pyramix. */
|
||||
MuseReceptorGeneric, /**< Represents Muse Receptor. */
|
||||
Reaper, /**< Represents Cockos Reaper. */
|
||||
Renoise, /**< Represents Renoise. */
|
||||
SADiE, /**< Represents SADiE. */
|
||||
SteinbergCubase4, /**< Represents Steinberg Cubase 4. */
|
||||
SteinbergCubase5, /**< Represents Steinberg Cubase 5. */
|
||||
SteinbergCubase5Bridged, /**< Represents Steinberg Cubase 5 Bridged. */
|
||||
SteinbergCubase6, /**< Represents Steinberg Cubase 6. */
|
||||
SteinbergCubase7, /**< Represents Steinberg Cubase 7. */
|
||||
SteinbergCubase8, /**< Represents Steinberg Cubase 8. */
|
||||
SteinbergCubase8_5, /**< Represents Steinberg Cubase 8.5. */
|
||||
SteinbergCubase9, /**< Represents Steinberg Cubase 9. */
|
||||
SteinbergCubaseGeneric, /**< Represents Steinberg Cubase. */
|
||||
SteinbergNuendo3, /**< Represents Steinberg Nuendo 3. */
|
||||
SteinbergNuendo4, /**< Represents Steinberg Nuendo 4. */
|
||||
SteinbergNuendo5, /**< Represents Steinberg Nuendo 5. */
|
||||
SteinbergNuendoGeneric, /**< Represents Steinberg Nuendo. */
|
||||
SteinbergWavelab5, /**< Represents Steinberg Wavelab 5. */
|
||||
SteinbergWavelab6, /**< Represents Steinberg Wavelab 6. */
|
||||
SteinbergWavelab7, /**< Represents Steinberg Wavelab 7. */
|
||||
SteinbergWavelab8, /**< Represents Steinberg Wavelab 8. */
|
||||
SteinbergWavelabGeneric, /**< Represents Steinberg Wavelab. */
|
||||
SteinbergTestHost, /**< Represents Steinberg's VST3 Test Host. */
|
||||
StudioOne, /**< Represents PreSonus Studio One. */
|
||||
Tracktion3, /**< Represents Tracktion 3. */
|
||||
TracktionGeneric, /**< Represents Tracktion. */
|
||||
TracktionWaveform, /**< Represents Tracktion Waveform. */
|
||||
VBVSTScanner, /**< Represents VB Audio VST Scanner. */
|
||||
WaveBurner /**< Represents Apple WaveBurner. */
|
||||
};
|
||||
|
||||
HostType type;
|
||||
|
||||
//==============================================================================
|
||||
/** Returns true if the host is any version of Ableton Live. */
|
||||
bool isAbletonLive() const noexcept { return type == AbletonLive6 || type == AbletonLive7 || type == AbletonLive8 || type == AbletonLiveGeneric; }
|
||||
/** Returns true if the host is Adobe Audition. */
|
||||
bool isAdobeAudition() const noexcept { return type == AdobeAudition; }
|
||||
/** Returns true if the host is Ardour. */
|
||||
bool isArdour() const noexcept { return type == Ardour; }
|
||||
/** Returns true if the host is Bitwig Studio. */
|
||||
bool isBitwigStudio() const noexcept { return type == BitwigStudio; }
|
||||
/** Returns true if the host is any version of Steinberg Cubase. */
|
||||
bool isCubase() const noexcept { return type == SteinbergCubase4 || type == SteinbergCubase5 || type == SteinbergCubase5Bridged || type == SteinbergCubase6 || type == SteinbergCubase7 || type == SteinbergCubase8 || type == SteinbergCubase8_5 || type == SteinbergCubase9 || type == SteinbergCubaseGeneric; }
|
||||
/** Returns true if the host is Steinberg Cubase 7 or later. */
|
||||
bool isCubase7orLater() const noexcept { return isCubase() && ! (type == SteinbergCubase4 || type == SteinbergCubase5 || type == SteinbergCubase6); }
|
||||
/** Returns true if the host is Steinberg Cubase 5 Bridged. */
|
||||
bool isCubaseBridged() const noexcept { return type == SteinbergCubase5Bridged; }
|
||||
/** Returns true if the host is DaVinci Resolve. */
|
||||
bool isDaVinciResolve() const noexcept { return type == DaVinciResolve; }
|
||||
/** Returns true if the host is Digital Performer. */
|
||||
bool isDigitalPerformer() const noexcept { return type == DigitalPerformer; }
|
||||
/** Returns true if the host is Apple Final Cut Pro. */
|
||||
bool isFinalCut() const noexcept { return type == FinalCut; }
|
||||
/** Returns true if the host is Fruity Loops. */
|
||||
bool isFruityLoops() const noexcept { return type == FruityLoops; }
|
||||
/** Returns true if the host is Apple GarageBand. */
|
||||
bool isGarageBand() const noexcept { return type == AppleGarageBand; }
|
||||
/** Returns true if the host is Apple Logic Pro. */
|
||||
bool isLogic() const noexcept { return type == AppleLogic; }
|
||||
/** Returns true if the host is Apple MainStage. */
|
||||
bool isMainStage() const noexcept { return type == AppleMainStage; }
|
||||
/** Returns true if the host is any version of Steinberg Nuendo. */
|
||||
bool isNuendo() const noexcept { return type == SteinbergNuendo3 || type == SteinbergNuendo4 || type == SteinbergNuendo5 || type == SteinbergNuendoGeneric; }
|
||||
/** Returns true if the host is Adobe Premiere Pro. */
|
||||
bool isPremiere() const noexcept { return type == AdobePremierePro; }
|
||||
/** Returns true if the host is Avid Pro Tools. */
|
||||
bool isProTools() const noexcept { return type == AvidProTools; }
|
||||
/** Returns true if the host is Merging Pyramix. */
|
||||
bool isPyramix() const noexcept { return type == MergingPyramix; }
|
||||
/** Returns true if the host is Muse Receptor. */
|
||||
bool isReceptor() const noexcept { return type == MuseReceptorGeneric; }
|
||||
/** Returns true if the host is Cockos Reaper. */
|
||||
bool isReaper() const noexcept { return type == Reaper; }
|
||||
/** Returns true if the host is Renoise. */
|
||||
bool isRenoise() const noexcept { return type == Renoise; }
|
||||
/** Returns true if the host is SADiE. */
|
||||
bool isSADiE() const noexcept { return type == SADiE; }
|
||||
/** Returns true if the host is Magix Samplitude. */
|
||||
bool isSamplitude() const noexcept { return type == MagixSamplitude; }
|
||||
/** Returns true if the host is any version of Cakewalk Sonar. */
|
||||
bool isSonar() const noexcept { return type == CakewalkSonar8 || type == CakewalkSonarGeneric; }
|
||||
/** Returns true if the host is Steinberg's VST3 Test Host. */
|
||||
bool isSteinbergTestHost() const noexcept { return type == SteinbergTestHost; }
|
||||
/** Returns true if the host is any product from Steinberg. */
|
||||
bool isSteinberg() const noexcept { return isCubase() || isNuendo() || isWavelab() || isSteinbergTestHost(); }
|
||||
/** Returns true if the host is PreSonus Studio One. */
|
||||
bool isStudioOne() const noexcept { return type == StudioOne; }
|
||||
/** Returns true if the host is any version of Tracktion. */
|
||||
bool isTracktion() const noexcept { return type == Tracktion3 || type == TracktionGeneric || isTracktionWaveform(); }
|
||||
/** Returns true if the host is Tracktion Waveform. */
|
||||
bool isTracktionWaveform() const noexcept { return type == TracktionWaveform; }
|
||||
/** Returns true if the host is VB Audio VST Scanner. */
|
||||
bool isVBVSTScanner() const noexcept { return type == VBVSTScanner; }
|
||||
/** Returns true if the host is Apple WaveBurner. */
|
||||
bool isWaveBurner() const noexcept { return type == WaveBurner; }
|
||||
/** Returns true if the host is any version of Steinberg WaveLab. */
|
||||
bool isWavelab() const noexcept { return isWavelabLegacy() || type == SteinbergWavelab7 || type == SteinbergWavelab8 || type == SteinbergWavelabGeneric; }
|
||||
/** Returns true if the host is Steinberg WaveLab 6 or below. */
|
||||
bool isWavelabLegacy() const noexcept { return type == SteinbergWavelab5 || type == SteinbergWavelab6; }
|
||||
|
||||
//==============================================================================
|
||||
/** Returns a human-readable description of the host. */
|
||||
const char* getHostDescription() const noexcept
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case AbletonLive6: return "Ableton Live 6";
|
||||
case AbletonLive7: return "Ableton Live 7";
|
||||
case AbletonLive8: return "Ableton Live 8";
|
||||
case AbletonLiveGeneric: return "Ableton Live";
|
||||
case AdobeAudition: return "Adobe Audition";
|
||||
case AdobePremierePro: return "Adobe Premiere";
|
||||
case AppleGarageBand: return "Apple GarageBand";
|
||||
case AppleLogic: return "Apple Logic";
|
||||
case AppleMainStage: return "Apple MainStage";
|
||||
case Ardour: return "Ardour";
|
||||
case AvidProTools: return "ProTools";
|
||||
case BitwigStudio: return "Bitwig Studio";
|
||||
case CakewalkSonar8: return "Cakewalk Sonar 8";
|
||||
case CakewalkSonarGeneric: return "Cakewalk Sonar";
|
||||
case DaVinciResolve: return "DaVinci Resolve";
|
||||
case DigitalPerformer: return "DigitalPerformer";
|
||||
case FinalCut: return "Final Cut";
|
||||
case FruityLoops: return "FruityLoops";
|
||||
case MagixSamplitude: return "Magix Samplitude";
|
||||
case MergingPyramix: return "Pyramix";
|
||||
case MuseReceptorGeneric: return "Muse Receptor";
|
||||
case Reaper: return "Reaper";
|
||||
case Renoise: return "Renoise";
|
||||
case SADiE: return "SADiE";
|
||||
case SteinbergCubase4: return "Steinberg Cubase 4";
|
||||
case SteinbergCubase5: return "Steinberg Cubase 5";
|
||||
case SteinbergCubase5Bridged: return "Steinberg Cubase 5 Bridged";
|
||||
case SteinbergCubase6: return "Steinberg Cubase 6";
|
||||
case SteinbergCubase7: return "Steinberg Cubase 7";
|
||||
case SteinbergCubase8: return "Steinberg Cubase 8";
|
||||
case SteinbergCubase8_5: return "Steinberg Cubase 8.5";
|
||||
case SteinbergCubase9: return "Steinberg Cubase 9";
|
||||
case SteinbergCubaseGeneric: return "Steinberg Cubase";
|
||||
case SteinbergNuendo3: return "Steinberg Nuendo 3";
|
||||
case SteinbergNuendo4: return "Steinberg Nuendo 4";
|
||||
case SteinbergNuendo5: return "Steinberg Nuendo 5";
|
||||
case SteinbergNuendoGeneric: return "Steinberg Nuendo";
|
||||
case SteinbergWavelab5: return "Steinberg Wavelab 5";
|
||||
case SteinbergWavelab6: return "Steinberg Wavelab 6";
|
||||
case SteinbergWavelab7: return "Steinberg Wavelab 7";
|
||||
case SteinbergWavelab8: return "Steinberg Wavelab 8";
|
||||
case SteinbergWavelabGeneric: return "Steinberg Wavelab";
|
||||
case SteinbergTestHost: return "Steinberg TestHost";
|
||||
case StudioOne: return "Studio One";
|
||||
case Tracktion3: return "Tracktion 3";
|
||||
case TracktionGeneric: return "Tracktion";
|
||||
case TracktionWaveform: return "Tracktion Waveform";
|
||||
case VBVSTScanner: return "VBVSTScanner";
|
||||
case WaveBurner: return "WaveBurner";
|
||||
default: break;
|
||||
}
|
||||
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
/** Returns true if the plugin is connected with Inter-App Audio on iOS. */
|
||||
bool isInterAppAudioConnected() const;
|
||||
/** Switches to the host application when Inter-App Audio is used on iOS. */
|
||||
void switchToHostApplication() const;
|
||||
|
||||
#if JUCE_MODULE_AVAILABLE_juce_gui_basics
|
||||
Image getHostIcon (int size) const;
|
||||
#endif
|
||||
|
||||
//==============================================================================
|
||||
/** Returns the complete absolute path of the host application executable. */
|
||||
static String getHostPath()
|
||||
{
|
||||
return File::getSpecialLocation (File::hostApplicationPath).getFullPathName();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
Returns the plug-in format via which the plug-in file was loaded. This value is
|
||||
identical to AudioProcessor::wrapperType of the main audio processor of this
|
||||
plug-in. This function is useful for code that does not have access to the
|
||||
plug-in's main audio processor.
|
||||
|
||||
@see AudioProcessor::wrapperType
|
||||
*/
|
||||
static AudioProcessor::WrapperType getPluginLoadedAs() noexcept { return jucePlugInClientCurrentWrapperType; }
|
||||
|
||||
//==============================================================================
|
||||
|
||||
#ifndef DOXYGEN
|
||||
// @internal
|
||||
static AudioProcessor::WrapperType jucePlugInClientCurrentWrapperType;
|
||||
#endif
|
||||
|
||||
private:
|
||||
static HostType getHostType()
|
||||
{
|
||||
auto hostPath = getHostPath();
|
||||
auto hostFilename = File (hostPath).getFileName();
|
||||
|
||||
#if JUCE_MAC
|
||||
if (hostPath.containsIgnoreCase ("Final Cut Pro.app")) return FinalCut;
|
||||
if (hostPath.containsIgnoreCase ("Final Cut Pro Trial.app")) return FinalCut;
|
||||
if (hostPath.containsIgnoreCase ("Live 6.")) return AbletonLive6;
|
||||
if (hostPath.containsIgnoreCase ("Live 7.")) return AbletonLive7;
|
||||
if (hostPath.containsIgnoreCase ("Live 8.")) return AbletonLive8;
|
||||
if (hostFilename.containsIgnoreCase ("Live")) return AbletonLiveGeneric;
|
||||
if (hostFilename.containsIgnoreCase ("Adobe Premiere")) return AdobePremierePro;
|
||||
if (hostFilename.containsIgnoreCase ("GarageBand")) return AppleGarageBand;
|
||||
if (hostFilename.containsIgnoreCase ("Logic")) return AppleLogic;
|
||||
if (hostFilename.containsIgnoreCase ("MainStage")) return AppleMainStage;
|
||||
if (hostFilename.containsIgnoreCase ("Pro Tools")) return AvidProTools;
|
||||
if (hostFilename.containsIgnoreCase ("Nuendo 3")) return SteinbergNuendo3;
|
||||
if (hostFilename.containsIgnoreCase ("Nuendo 4")) return SteinbergNuendo4;
|
||||
if (hostFilename.containsIgnoreCase ("Nuendo 5")) return SteinbergNuendo5;
|
||||
if (hostFilename.containsIgnoreCase ("Nuendo")) return SteinbergNuendoGeneric;
|
||||
if (hostFilename.containsIgnoreCase ("Cubase 4")) return SteinbergCubase4;
|
||||
if (hostFilename.containsIgnoreCase ("Cubase 5")) return SteinbergCubase5;
|
||||
if (hostFilename.containsIgnoreCase ("Cubase 6")) return SteinbergCubase6;
|
||||
if (hostFilename.containsIgnoreCase ("Cubase 7")) return SteinbergCubase7;
|
||||
if (hostPath.containsIgnoreCase ("Cubase 8.app")) return SteinbergCubase8;
|
||||
if (hostPath.containsIgnoreCase ("Cubase 8.5.app")) return SteinbergCubase8_5;
|
||||
if (hostPath.containsIgnoreCase ("Cubase 9.app")) return SteinbergCubase9;
|
||||
if (hostFilename.containsIgnoreCase ("Cubase")) return SteinbergCubaseGeneric;
|
||||
if (hostPath.containsIgnoreCase ("Wavelab 7")) return SteinbergWavelab7;
|
||||
if (hostPath.containsIgnoreCase ("Wavelab 8")) return SteinbergWavelab8;
|
||||
if (hostFilename.containsIgnoreCase ("Wavelab")) return SteinbergWavelabGeneric;
|
||||
if (hostFilename.containsIgnoreCase ("WaveBurner")) return WaveBurner;
|
||||
if (hostPath.containsIgnoreCase ("Digital Performer")) return DigitalPerformer;
|
||||
if (hostFilename.containsIgnoreCase ("reaper")) return Reaper;
|
||||
if (hostPath.containsIgnoreCase ("Studio One")) return StudioOne;
|
||||
if (hostFilename.startsWithIgnoreCase ("Waveform")) return TracktionWaveform;
|
||||
if (hostPath.containsIgnoreCase ("Tracktion 3")) return Tracktion3;
|
||||
if (hostFilename.containsIgnoreCase ("Tracktion")) return TracktionGeneric;
|
||||
if (hostFilename.containsIgnoreCase ("Renoise")) return Renoise;
|
||||
if (hostFilename.containsIgnoreCase ("Resolve")) return DaVinciResolve;
|
||||
if (hostFilename.startsWith ("Bitwig")) return BitwigStudio;
|
||||
|
||||
#elif JUCE_WINDOWS
|
||||
if (hostFilename.containsIgnoreCase ("Live 6.")) return AbletonLive6;
|
||||
if (hostFilename.containsIgnoreCase ("Live 7.")) return AbletonLive7;
|
||||
if (hostFilename.containsIgnoreCase ("Live 8.")) return AbletonLive8;
|
||||
if (hostFilename.containsIgnoreCase ("Live ")) return AbletonLiveGeneric;
|
||||
if (hostFilename.containsIgnoreCase ("Audition")) return AdobeAudition;
|
||||
if (hostFilename.containsIgnoreCase ("Adobe Premiere")) return AdobePremierePro;
|
||||
if (hostFilename.containsIgnoreCase ("ProTools")) return AvidProTools;
|
||||
if (hostPath.containsIgnoreCase ("SONAR 8")) return CakewalkSonar8;
|
||||
if (hostFilename.containsIgnoreCase ("SONAR")) return CakewalkSonarGeneric;
|
||||
if (hostFilename.containsIgnoreCase ("GarageBand")) return AppleGarageBand;
|
||||
if (hostFilename.containsIgnoreCase ("Logic")) return AppleLogic;
|
||||
if (hostFilename.containsIgnoreCase ("MainStage")) return AppleMainStage;
|
||||
if (hostFilename.startsWithIgnoreCase ("Waveform")) return TracktionWaveform;
|
||||
if (hostPath.containsIgnoreCase ("Tracktion 3")) return Tracktion3;
|
||||
if (hostFilename.containsIgnoreCase ("Tracktion")) return TracktionGeneric;
|
||||
if (hostFilename.containsIgnoreCase ("reaper")) return Reaper;
|
||||
if (hostFilename.containsIgnoreCase ("Cubase4")) return SteinbergCubase4;
|
||||
if (hostFilename.containsIgnoreCase ("Cubase5")) return SteinbergCubase5;
|
||||
if (hostFilename.containsIgnoreCase ("Cubase6")) return SteinbergCubase6;
|
||||
if (hostFilename.containsIgnoreCase ("Cubase7")) return SteinbergCubase7;
|
||||
if (hostFilename.containsIgnoreCase ("Cubase8.exe")) return SteinbergCubase8;
|
||||
if (hostFilename.containsIgnoreCase ("Cubase8.5.exe")) return SteinbergCubase8_5;
|
||||
// Cubase 9 scans plug-ins with a separate executable "vst2xscanner"
|
||||
if (hostFilename.containsIgnoreCase ("Cubase9.exe")
|
||||
|| hostPath.containsIgnoreCase ("Cubase 9")) return SteinbergCubase9;
|
||||
if (hostFilename.containsIgnoreCase ("Cubase")) return SteinbergCubaseGeneric;
|
||||
if (hostFilename.containsIgnoreCase ("VSTBridgeApp")) return SteinbergCubase5Bridged;
|
||||
if (hostPath.containsIgnoreCase ("Wavelab 5")) return SteinbergWavelab5;
|
||||
if (hostPath.containsIgnoreCase ("Wavelab 6")) return SteinbergWavelab6;
|
||||
if (hostPath.containsIgnoreCase ("Wavelab 7")) return SteinbergWavelab7;
|
||||
if (hostPath.containsIgnoreCase ("Wavelab 8")) return SteinbergWavelab8;
|
||||
if (hostPath.containsIgnoreCase ("Nuendo")) return SteinbergNuendoGeneric;
|
||||
if (hostFilename.containsIgnoreCase ("Wavelab")) return SteinbergWavelabGeneric;
|
||||
if (hostFilename.containsIgnoreCase ("TestHost")) return SteinbergTestHost;
|
||||
if (hostFilename.containsIgnoreCase ("rm-host")) return MuseReceptorGeneric;
|
||||
if (hostFilename.startsWith ("FL")) return FruityLoops;
|
||||
if (hostFilename.contains ("ilbridge.")) return FruityLoops;
|
||||
if (hostPath.containsIgnoreCase ("Studio One")) return StudioOne;
|
||||
if (hostPath.containsIgnoreCase ("Digital Performer")) return DigitalPerformer;
|
||||
if (hostFilename.containsIgnoreCase ("VST_Scanner")) return VBVSTScanner;
|
||||
if (hostPath.containsIgnoreCase ("Merging Technologies")) return MergingPyramix;
|
||||
if (hostFilename.startsWithIgnoreCase ("Sam")) return MagixSamplitude;
|
||||
if (hostFilename.containsIgnoreCase ("Renoise")) return Renoise;
|
||||
if (hostFilename.containsIgnoreCase ("Resolve")) return DaVinciResolve;
|
||||
if (hostPath.containsIgnoreCase ("Bitwig Studio")) return BitwigStudio;
|
||||
if (hostFilename.containsIgnoreCase ("Sadie")) return SADiE;
|
||||
|
||||
#elif JUCE_LINUX
|
||||
if (hostFilename.containsIgnoreCase ("Ardour")) return Ardour;
|
||||
if (hostFilename.startsWithIgnoreCase ("Waveform")) return TracktionWaveform;
|
||||
if (hostFilename.containsIgnoreCase ("Tracktion")) return TracktionGeneric;
|
||||
if (hostFilename.startsWith ("Bitwig")) return BitwigStudio;
|
||||
|
||||
#elif JUCE_IOS
|
||||
#elif JUCE_ANDROID
|
||||
#else
|
||||
#error
|
||||
#endif
|
||||
return UnknownHost;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace juce
|
@ -0,0 +1,215 @@
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2017 - ROLI Ltd.
|
||||
|
||||
JUCE is an open source library subject to commercial or open-source
|
||||
licensing.
|
||||
|
||||
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
|
||||
Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
|
||||
27th April 2017).
|
||||
|
||||
End User License Agreement: www.juce.com/juce-5-licence
|
||||
Privacy Policy: www.juce.com/juce-5-privacy-policy
|
||||
|
||||
Or: You may also use this code under the terms of the GPL v3 (see
|
||||
www.gnu.org/licenses).
|
||||
|
||||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
||||
DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#if _MSC_VER || defined (__MINGW32__) || defined (__MINGW64__)
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "../../juce_core/system/juce_TargetPlatform.h"
|
||||
#include "../utility/juce_CheckSettingMacros.h"
|
||||
#include "juce_IncludeModuleHeaders.h"
|
||||
|
||||
using namespace juce;
|
||||
|
||||
namespace juce
|
||||
{
|
||||
|
||||
AudioProcessor::WrapperType PluginHostType::jucePlugInClientCurrentWrapperType = AudioProcessor::wrapperType_Undefined;
|
||||
|
||||
#ifndef JUCE_VST3_CAN_REPLACE_VST2
|
||||
#define JUCE_VST3_CAN_REPLACE_VST2 1
|
||||
#endif
|
||||
|
||||
#if JucePlugin_Build_VST3 && (__APPLE_CPP__ || __APPLE_CC__ || _WIN32 || _WIN64) && JUCE_VST3_CAN_REPLACE_VST2
|
||||
#define VST3_REPLACEMENT_AVAILABLE 1
|
||||
|
||||
// NB: Nasty old-fashioned code in here because it's copied from the Steinberg example code.
|
||||
void JUCE_API getUUIDForVST2ID (bool forControllerUID, uint8 uuid[16])
|
||||
{
|
||||
char uidString[33];
|
||||
|
||||
const int vstfxid = (('V' << 16) | ('S' << 8) | (forControllerUID ? 'E' : 'T'));
|
||||
char vstfxidStr[7] = { 0 };
|
||||
sprintf (vstfxidStr, "%06X", vstfxid);
|
||||
|
||||
strcpy (uidString, vstfxidStr);
|
||||
|
||||
char uidStr[9] = { 0 };
|
||||
sprintf (uidStr, "%08X", JucePlugin_VSTUniqueID);
|
||||
strcat (uidString, uidStr);
|
||||
|
||||
char nameidStr[3] = { 0 };
|
||||
const size_t len = strlen (JucePlugin_Name);
|
||||
|
||||
for (size_t i = 0; i <= 8; ++i)
|
||||
{
|
||||
juce::uint8 c = i < len ? static_cast<juce::uint8> (JucePlugin_Name[i]) : 0;
|
||||
|
||||
if (c >= 'A' && c <= 'Z')
|
||||
c += 'a' - 'A';
|
||||
|
||||
sprintf (nameidStr, "%02X", c);
|
||||
strcat (uidString, nameidStr);
|
||||
}
|
||||
|
||||
unsigned long p0;
|
||||
unsigned int p1, p2;
|
||||
unsigned int p3[8];
|
||||
|
||||
#ifndef _MSC_VER
|
||||
sscanf
|
||||
#else
|
||||
sscanf_s
|
||||
#endif
|
||||
(uidString, "%08lX%04X%04X%02X%02X%02X%02X%02X%02X%02X%02X",
|
||||
&p0, &p1, &p2, &p3[0], &p3[1], &p3[2], &p3[3], &p3[4], &p3[5], &p3[6], &p3[7]);
|
||||
|
||||
union q0_u {
|
||||
uint32 word;
|
||||
uint8 bytes[4];
|
||||
} q0;
|
||||
|
||||
union q1_u {
|
||||
uint16 half;
|
||||
uint8 bytes[2];
|
||||
} q1, q2;
|
||||
|
||||
q0.word = static_cast<uint32> (p0);
|
||||
q1.half = static_cast<uint16> (p1);
|
||||
q2.half = static_cast<uint16> (p2);
|
||||
|
||||
// VST3 doesn't use COM compatible UUIDs on non windows platforms
|
||||
#ifndef _WIN32
|
||||
q0.word = ByteOrder::swap (q0.word);
|
||||
q1.half = ByteOrder::swap (q1.half);
|
||||
q2.half = ByteOrder::swap (q2.half);
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < 4; ++i)
|
||||
uuid[i+0] = q0.bytes[i];
|
||||
|
||||
for (int i = 0; i < 2; ++i)
|
||||
uuid[i+4] = q1.bytes[i];
|
||||
|
||||
for (int i = 0; i < 2; ++i)
|
||||
uuid[i+6] = q2.bytes[i];
|
||||
|
||||
for (int i = 0; i < 8; ++i)
|
||||
uuid[i+8] = static_cast<uint8> (p3[i]);
|
||||
}
|
||||
#else
|
||||
#define VST3_REPLACEMENT_AVAILABLE 0
|
||||
#endif
|
||||
|
||||
#if JucePlugin_Build_VST
|
||||
bool JUCE_API handleManufacturerSpecificVST2Opcode (int32 index, pointer_sized_int value, void* ptr, float)
|
||||
{
|
||||
#if VST3_REPLACEMENT_AVAILABLE
|
||||
if ((index == 'stCA' || index == 'stCa') && value == 'FUID' && ptr != nullptr)
|
||||
{
|
||||
uint8 fuid[16];
|
||||
getUUIDForVST2ID (false, fuid);
|
||||
::memcpy (ptr, fuid, 16);
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
ignoreUnused (index, value, ptr);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace juce
|
||||
|
||||
//==============================================================================
|
||||
/** Somewhere in the codebase of your plugin, you need to implement this function
|
||||
and make it return a new instance of the filter subclass that you're building.
|
||||
*/
|
||||
extern AudioProcessor* JUCE_CALLTYPE createPluginFilter();
|
||||
|
||||
#if JucePlugin_Enable_IAA && JucePlugin_Build_Standalone && JUCE_IOS && (! JUCE_USE_CUSTOM_PLUGIN_STANDALONE_APP)
|
||||
extern bool JUCE_CALLTYPE juce_isInterAppAudioConnected();
|
||||
extern void JUCE_CALLTYPE juce_switchToHostApplication();
|
||||
|
||||
#if JUCE_MODULE_AVAILABLE_juce_gui_basics
|
||||
extern Image JUCE_CALLTYPE juce_getIAAHostIcon (int);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
AudioProcessor* JUCE_API JUCE_CALLTYPE createPluginFilterOfType (AudioProcessor::WrapperType type)
|
||||
{
|
||||
AudioProcessor::setTypeOfNextNewPlugin (type);
|
||||
AudioProcessor* const pluginInstance = createPluginFilter();
|
||||
AudioProcessor::setTypeOfNextNewPlugin (AudioProcessor::wrapperType_Undefined);
|
||||
|
||||
// your createPluginFilter() method must return an object!
|
||||
jassert (pluginInstance != nullptr && pluginInstance->wrapperType == type);
|
||||
|
||||
return pluginInstance;
|
||||
}
|
||||
|
||||
bool PluginHostType::isInterAppAudioConnected() const
|
||||
{
|
||||
#if JucePlugin_Enable_IAA && JucePlugin_Build_Standalone && JUCE_IOS && (! JUCE_USE_CUSTOM_PLUGIN_STANDALONE_APP)
|
||||
if (getPluginLoadedAs() == AudioProcessor::wrapperType_Standalone)
|
||||
return juce_isInterAppAudioConnected();
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void PluginHostType::switchToHostApplication() const
|
||||
{
|
||||
#if JucePlugin_Enable_IAA && JucePlugin_Build_Standalone && JUCE_IOS && (! JUCE_USE_CUSTOM_PLUGIN_STANDALONE_APP)
|
||||
if (getPluginLoadedAs() == AudioProcessor::wrapperType_Standalone)
|
||||
juce_switchToHostApplication();
|
||||
#endif
|
||||
}
|
||||
|
||||
#if JUCE_MODULE_AVAILABLE_juce_gui_basics
|
||||
namespace juce {
|
||||
|
||||
extern Image JUCE_API getIconFromApplication (const String&, const int);
|
||||
|
||||
Image PluginHostType::getHostIcon (int size) const
|
||||
{
|
||||
ignoreUnused (size);
|
||||
|
||||
#if JucePlugin_Enable_IAA && JucePlugin_Build_Standalone && JUCE_IOS && (! JUCE_USE_CUSTOM_PLUGIN_STANDALONE_APP)
|
||||
if (isInterAppAudioConnected())
|
||||
return juce_getIAAHostIcon (size);
|
||||
#endif
|
||||
|
||||
#if JUCE_MAC
|
||||
String bundlePath (getHostPath().upToLastOccurrenceOf (".app", true, true));
|
||||
return getIconFromApplication (bundlePath, size);
|
||||
#endif
|
||||
|
||||
return Image();
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
111
modules/juce_audio_plugin_client/utility/juce_WindowsHooks.h
Normal file
111
modules/juce_audio_plugin_client/utility/juce_WindowsHooks.h
Normal file
@ -0,0 +1,111 @@
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2017 - ROLI Ltd.
|
||||
|
||||
JUCE is an open source library subject to commercial or open-source
|
||||
licensing.
|
||||
|
||||
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
|
||||
Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
|
||||
27th April 2017).
|
||||
|
||||
End User License Agreement: www.juce.com/juce-5-licence
|
||||
Privacy Policy: www.juce.com/juce-5-privacy-policy
|
||||
|
||||
Or: You may also use this code under the terms of the GPL v3 (see
|
||||
www.gnu.org/licenses).
|
||||
|
||||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
||||
DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#if JUCE_WINDOWS
|
||||
|
||||
namespace juce
|
||||
{
|
||||
|
||||
// This function is in juce_win32_Windowing.cpp
|
||||
extern bool offerKeyMessageToJUCEWindow (MSG&);
|
||||
|
||||
namespace
|
||||
{
|
||||
static HHOOK mouseWheelHook = 0, keyboardHook = 0;
|
||||
static int numHookUsers = 0;
|
||||
|
||||
struct WindowsHooks
|
||||
{
|
||||
WindowsHooks()
|
||||
{
|
||||
if (numHookUsers++ == 0)
|
||||
{
|
||||
mouseWheelHook = SetWindowsHookEx (WH_MOUSE, mouseWheelHookCallback,
|
||||
(HINSTANCE) juce::Process::getCurrentModuleInstanceHandle(),
|
||||
GetCurrentThreadId());
|
||||
|
||||
keyboardHook = SetWindowsHookEx (WH_GETMESSAGE, keyboardHookCallback,
|
||||
(HINSTANCE) juce::Process::getCurrentModuleInstanceHandle(),
|
||||
GetCurrentThreadId());
|
||||
}
|
||||
}
|
||||
|
||||
~WindowsHooks()
|
||||
{
|
||||
if (--numHookUsers == 0)
|
||||
{
|
||||
if (mouseWheelHook != 0)
|
||||
{
|
||||
UnhookWindowsHookEx (mouseWheelHook);
|
||||
mouseWheelHook = 0;
|
||||
}
|
||||
|
||||
if (keyboardHook != 0)
|
||||
{
|
||||
UnhookWindowsHookEx (keyboardHook);
|
||||
keyboardHook = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static LRESULT CALLBACK mouseWheelHookCallback (int nCode, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (nCode >= 0 && wParam == WM_MOUSEWHEEL)
|
||||
{
|
||||
// using a local copy of this struct to support old mingw libraries
|
||||
struct MOUSEHOOKSTRUCTEX_ : public MOUSEHOOKSTRUCT { DWORD mouseData; };
|
||||
|
||||
auto& hs = *(MOUSEHOOKSTRUCTEX_*) lParam;
|
||||
|
||||
if (auto* comp = Desktop::getInstance().findComponentAt ({ hs.pt.x, hs.pt.y }))
|
||||
if (comp->getWindowHandle() != 0)
|
||||
return PostMessage ((HWND) comp->getWindowHandle(), WM_MOUSEWHEEL,
|
||||
hs.mouseData & 0xffff0000, (hs.pt.x & 0xffff) | (hs.pt.y << 16));
|
||||
}
|
||||
|
||||
return CallNextHookEx (mouseWheelHook, nCode, wParam, lParam);
|
||||
}
|
||||
|
||||
static LRESULT CALLBACK keyboardHookCallback (int nCode, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
MSG& msg = *(MSG*) lParam;
|
||||
|
||||
if (nCode == HC_ACTION && wParam == PM_REMOVE
|
||||
&& offerKeyMessageToJUCEWindow (msg))
|
||||
{
|
||||
zerostruct (msg);
|
||||
msg.message = WM_USER;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return CallNextHookEx (keyboardHook, nCode, wParam, lParam);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
} // juce namespace
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user