mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-18 00:54:19 +00:00
Audio plugins: new DllMain handling.
This commit is contained in:
parent
a7a16116d0
commit
e7f77abc68
4 changed files with 66 additions and 57 deletions
|
|
@ -51,14 +51,10 @@
|
|||
#include "AAX_IViewContainer.h"
|
||||
|
||||
#if JUCE_WINDOWS
|
||||
static HINSTANCE moduleInstance = 0;
|
||||
|
||||
extern "C" BOOL WINAPI DllMain (HINSTANCE instance, DWORD selector, LPVOID)
|
||||
void __stdcall DllMainAAX (HINSTANCE instance, DWORD reason)
|
||||
{
|
||||
if (selector == DLL_PROCESS_ATTACH)
|
||||
moduleInstance = instance;
|
||||
|
||||
return true;
|
||||
if (reason == DLL_PROCESS_ATTACH)
|
||||
Process::setCurrentModuleInstanceHandle (instance);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -140,10 +136,6 @@ struct AAXClasses
|
|||
private:
|
||||
static void initialise()
|
||||
{
|
||||
#if JUCE_WINDOWS
|
||||
Process::setCurrentModuleInstanceHandle (moduleInstance);
|
||||
#endif
|
||||
|
||||
initialiseJuce_GUI();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,9 +31,9 @@
|
|||
|
||||
#if JucePlugin_Build_RTAS
|
||||
|
||||
#include "juce_RTAS_DigiCode_Header.h"
|
||||
#include "juce_RTAS_DigiCode_Header.h"
|
||||
|
||||
/*
|
||||
/*
|
||||
This file is used to include and build the required digidesign CPP files without your project
|
||||
needing to reference the files directly. Because these files will be found via your include path,
|
||||
this means that the project doesn't have to change to cope with people's SDKs being in different
|
||||
|
|
@ -46,47 +46,63 @@
|
|||
|
||||
If you get an error building the includes statements below, check your paths - there's a full
|
||||
list of the necessary Digidesign paths in juce_RTAS_Wrapper.cpp
|
||||
*/
|
||||
*/
|
||||
|
||||
#if WINDOWS_VERSION
|
||||
//==============================================================================
|
||||
|
||||
#undef _UNICODE
|
||||
#undef UNICODE
|
||||
|
||||
#if JucePlugin_Build_VST
|
||||
#if WINDOWS_VERSION
|
||||
#undef _UNICODE
|
||||
#undef UNICODE
|
||||
|
||||
#define DllMain DllMainRTAS
|
||||
#include <DLLMain.cpp>
|
||||
#undef DllMain
|
||||
#include <DefaultSwap.cpp>
|
||||
|
||||
extern BOOL WINAPI DllMainVST (HINSTANCE instance, DWORD dwReason, LPVOID);
|
||||
|
||||
// This overloaded DllMain can work as either an RTAS or a VST..
|
||||
extern "C" BOOL WINAPI DllMain (HINSTANCE hInstance, DWORD ul_reason_for_call, LPVOID lpReserved)
|
||||
{
|
||||
if (GetModuleHandleA ("DAE.DLL") != 0)
|
||||
return DllMainRTAS (hInstance, ul_reason_for_call, lpReserved);
|
||||
else
|
||||
return DllMainVST (hInstance, ul_reason_for_call, lpReserved);
|
||||
}
|
||||
#else
|
||||
#include <DLLMain.cpp>
|
||||
#include <PlugInInitialize.cpp>
|
||||
#include <Dispatcher.cpp>
|
||||
#endif
|
||||
|
||||
#include <DefaultSwap.cpp>
|
||||
#else
|
||||
|
||||
#if _MSC_VER
|
||||
short __stdcall NewPlugIn (void*) { return 0; }
|
||||
short __stdcall _PI_GetRoutineDescriptor (long, void*) { return 0; }
|
||||
#endif
|
||||
|
||||
#else
|
||||
//==============================================================================
|
||||
#include <PlugInInitialize.cpp>
|
||||
#include <Dispatcher.cpp>
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
//==============================================================================
|
||||
#if _MSC_VER
|
||||
short __stdcall NewPlugIn (void*) { return 0; }
|
||||
short __stdcall _PI_GetRoutineDescriptor (long, void*) { return 0; }
|
||||
#endif
|
||||
#if ! JucePlugin_Build_RTAS
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#if JucePlugin_Build_VST
|
||||
extern void __stdcall DllMainVST (HINSTANCE, DWORD);
|
||||
#endif
|
||||
|
||||
#if JucePlugin_Build_AAX
|
||||
extern void __stdcall DllMainAAX (HINSTANCE, DWORD);
|
||||
#endif
|
||||
|
||||
extern "C" BOOL WINAPI DllMain (HINSTANCE instance, DWORD reason, LPVOID reserved)
|
||||
{
|
||||
(void) reserved;
|
||||
|
||||
#if JucePlugin_Build_VST
|
||||
DllMainVST (instance, reason);
|
||||
#endif
|
||||
|
||||
#if JucePlugin_Build_AAX
|
||||
DllMainAAX (instance, reason);
|
||||
#endif
|
||||
|
||||
#if JucePlugin_Build_RTAS
|
||||
if (GetModuleHandleA ("DAE.DLL") != 0)
|
||||
return DllMainRTAS (instance, reason, reserved);
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1477,19 +1477,23 @@ namespace
|
|||
}
|
||||
}
|
||||
|
||||
#if ! JUCE_WINDOWS
|
||||
#define JUCE_EXPORTED_FUNCTION extern "C" __attribute__ ((visibility("default")))
|
||||
#endif
|
||||
|
||||
//==============================================================================
|
||||
// Mac startup code..
|
||||
#if JUCE_MAC
|
||||
|
||||
extern "C" __attribute__ ((visibility("default"))) AEffect* VSTPluginMain (audioMasterCallback audioMaster);
|
||||
extern "C" __attribute__ ((visibility("default"))) AEffect* VSTPluginMain (audioMasterCallback audioMaster)
|
||||
JUCE_EXPORTED_FUNCTION AEffect* VSTPluginMain (audioMasterCallback audioMaster);
|
||||
JUCE_EXPORTED_FUNCTION AEffect* VSTPluginMain (audioMasterCallback audioMaster)
|
||||
{
|
||||
initialiseMac();
|
||||
return pluginEntryPoint (audioMaster);
|
||||
}
|
||||
|
||||
extern "C" __attribute__ ((visibility("default"))) AEffect* main_macho (audioMasterCallback audioMaster);
|
||||
extern "C" __attribute__ ((visibility("default"))) AEffect* main_macho (audioMasterCallback audioMaster)
|
||||
JUCE_EXPORTED_FUNCTION AEffect* main_macho (audioMasterCallback audioMaster);
|
||||
JUCE_EXPORTED_FUNCTION AEffect* main_macho (audioMasterCallback audioMaster)
|
||||
{
|
||||
initialiseMac();
|
||||
return pluginEntryPoint (audioMaster);
|
||||
|
|
@ -1499,15 +1503,15 @@ namespace
|
|||
// Linux startup code..
|
||||
#elif JUCE_LINUX
|
||||
|
||||
extern "C" __attribute__ ((visibility("default"))) AEffect* VSTPluginMain (audioMasterCallback audioMaster)
|
||||
JUCE_EXPORTED_FUNCTION AEffect* VSTPluginMain (audioMasterCallback audioMaster);
|
||||
JUCE_EXPORTED_FUNCTION AEffect* VSTPluginMain (audioMasterCallback audioMaster)
|
||||
{
|
||||
SharedMessageThread::getInstance();
|
||||
return pluginEntryPoint (audioMaster);
|
||||
}
|
||||
|
||||
extern "C" __attribute__ ((visibility("default"))) AEffect* main_plugin (audioMasterCallback audioMaster) asm ("main");
|
||||
|
||||
extern "C" __attribute__ ((visibility("default"))) AEffect* main_plugin (audioMasterCallback audioMaster)
|
||||
JUCE_EXPORTED_FUNCTION AEffect* main_plugin (audioMasterCallback audioMaster) asm ("main");
|
||||
JUCE_EXPORTED_FUNCTION AEffect* main_plugin (audioMasterCallback audioMaster)
|
||||
{
|
||||
return VSTPluginMain (audioMaster);
|
||||
}
|
||||
|
|
@ -1532,16 +1536,10 @@ namespace
|
|||
}
|
||||
#endif
|
||||
|
||||
#if JucePlugin_Build_RTAS
|
||||
BOOL WINAPI DllMainVST (HINSTANCE instance, DWORD dwReason, LPVOID)
|
||||
#else
|
||||
extern "C" BOOL WINAPI DllMain (HINSTANCE instance, DWORD dwReason, LPVOID)
|
||||
#endif
|
||||
void __stdcall DllMainVST (HINSTANCE instance, DWORD reason)
|
||||
{
|
||||
if (dwReason == DLL_PROCESS_ATTACH)
|
||||
if (reason == DLL_PROCESS_ATTACH)
|
||||
Process::setCurrentModuleInstanceHandle (instance);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,9 @@ struct CustomMouseCursorInfo
|
|||
Image image;
|
||||
const Point<int> hotspot;
|
||||
float scaleFactor;
|
||||
|
||||
private:
|
||||
JUCE_DECLARE_NON_COPYABLE (CustomMouseCursorInfo);
|
||||
};
|
||||
|
||||
class MouseCursor::SharedCursorHandle
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue