git subrepo clone --branch=sono6good https://github.com/essej/JUCE.git deps/juce
subrepo: subdir: "deps/juce" merged: "b13f9084e" upstream: origin: "https://github.com/essej/JUCE.git" branch: "sono6good" commit: "b13f9084e" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596"
This commit is contained in:
73
deps/juce/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode1.cpp
vendored
Normal file
73
deps/juce/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode1.cpp
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2020 - Raw Material Software Limited
|
||||
|
||||
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 6 End-User License
|
||||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
|
||||
|
||||
End User License Agreement: www.juce.com/juce-6-licence
|
||||
Privacy Policy: www.juce.com/juce-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.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <juce_core/system/juce_TargetPlatform.h>
|
||||
#include "../utility/juce_CheckSettingMacros.h"
|
||||
|
||||
#if JucePlugin_Build_RTAS
|
||||
|
||||
#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
|
||||
locations.
|
||||
|
||||
Important note on Windows: In your project settings for the three juce_RTAS_DigiCode.cpp files and
|
||||
the juce_RTAS_Wrapper.cpp file, you need to set the calling convention to "__stdcall".
|
||||
If you don't do this, you'll get some unresolved externals and will spend a long time wondering what's
|
||||
going on... All the other files in your project can be set to use the normal __cdecl convention.
|
||||
|
||||
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
|
||||
#endif
|
||||
|
||||
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wnon-virtual-dtor",
|
||||
"-Wcomment",
|
||||
"-Wreorder",
|
||||
"-Wextra-tokens",
|
||||
"-Wunused-variable",
|
||||
"-Wdeprecated")
|
||||
|
||||
#include <CEffectGroup.cpp>
|
||||
#include <CEffectGroupMIDI.cpp>
|
||||
#include <CEffectMIDIUtils.cpp>
|
||||
#include <CEffectProcess.cpp>
|
||||
#include <CEffectProcessAS.cpp>
|
||||
#include <CEffectType.cpp>
|
||||
#include <CEffectTypeRTAS.cpp>
|
||||
#include <ChunkDataParser.cpp>
|
||||
|
||||
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
|
||||
|
||||
#endif
|
61
deps/juce/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode2.cpp
vendored
Normal file
61
deps/juce/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode2.cpp
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2020 - Raw Material Software Limited
|
||||
|
||||
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 6 End-User License
|
||||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
|
||||
|
||||
End User License Agreement: www.juce.com/juce-6-licence
|
||||
Privacy Policy: www.juce.com/juce-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.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <juce_core/system/juce_TargetPlatform.h>
|
||||
#include "../utility/juce_CheckSettingMacros.h"
|
||||
|
||||
#if JucePlugin_Build_RTAS
|
||||
|
||||
#include "juce_RTAS_DigiCode_Header.h"
|
||||
|
||||
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wcomment",
|
||||
"-Wextra-tokens",
|
||||
"-Wnon-virtual-dtor",
|
||||
"-Wreorder",
|
||||
"-Wdeprecated")
|
||||
|
||||
/*
|
||||
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
|
||||
locations.
|
||||
|
||||
Important note on Windows: In your project settings for the three juce_RTAS_DigiCode.cpp files and
|
||||
the juce_RTAS_Wrapper.cpp file, you need to set the calling convention to "__stdcall".
|
||||
If you don't do this, you'll get some unresolved externals and will spend a long time wondering what's
|
||||
going on... All the other files in your project can be set to use the normal __cdecl convention.
|
||||
|
||||
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
|
||||
*/
|
||||
|
||||
#include <CEffectProcessMIDI.cpp>
|
||||
#include <PlugInUtils.cpp>
|
||||
|
||||
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
|
||||
|
||||
#endif
|
74
deps/juce/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode3.cpp
vendored
Normal file
74
deps/juce/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode3.cpp
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2020 - Raw Material Software Limited
|
||||
|
||||
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 6 End-User License
|
||||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
|
||||
|
||||
End User License Agreement: www.juce.com/juce-6-licence
|
||||
Privacy Policy: www.juce.com/juce-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.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <juce_core/system/juce_TargetPlatform.h>
|
||||
#include "../utility/juce_CheckSettingMacros.h"
|
||||
|
||||
#if JucePlugin_Build_RTAS
|
||||
|
||||
#include "../utility/juce_IncludeSystemHeaders.h"
|
||||
#include "juce_RTAS_DigiCode_Header.h"
|
||||
|
||||
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wnon-virtual-dtor", "-Wextra-tokens", "-Wreorder")
|
||||
|
||||
/*
|
||||
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
|
||||
locations.
|
||||
|
||||
Important note on Windows: In your project settings for the three juce_RTAS_DigiCode.cpp files and
|
||||
the juce_RTAS_Wrapper.cpp file, you need to set the calling convention to "__stdcall".
|
||||
If you don't do this, you'll get some unresolved externals and will spend a long time wondering what's
|
||||
going on... All the other files in your project can be set to use the normal __cdecl convention.
|
||||
|
||||
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
|
||||
#define DllMain DllMainRTAS
|
||||
#include <DLLMain.cpp>
|
||||
#undef DllMain
|
||||
#include <DefaultSwap.cpp>
|
||||
#else
|
||||
#include <PlugInInitialize.cpp>
|
||||
#include <Dispatcher.cpp>
|
||||
#endif
|
||||
|
||||
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
|
||||
|
||||
#else
|
||||
|
||||
#if _MSC_VER
|
||||
short __stdcall NewPlugIn (void*) { return 0; }
|
||||
short __stdcall _PI_GetRoutineDescriptor (long, void*) { return 0; }
|
||||
#endif
|
||||
|
||||
#endif
|
68
deps/juce/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode_Header.h
vendored
Normal file
68
deps/juce/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode_Header.h
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2020 - Raw Material Software Limited
|
||||
|
||||
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 6 End-User License
|
||||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
|
||||
|
||||
End User License Agreement: www.juce.com/juce-6-licence
|
||||
Privacy Policy: www.juce.com/juce-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.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if JucePlugin_Build_RTAS
|
||||
#ifdef _MSC_VER
|
||||
|
||||
#define kCompileAsCodeResource 0
|
||||
#define kBuildStandAlone 0
|
||||
#define kNoDSP 0
|
||||
#define kNoDAE 0
|
||||
#define kNoSDS 0
|
||||
#define kNoViews 0
|
||||
#define kUseDSPCodeDecode 0
|
||||
|
||||
#define WIN32 1
|
||||
#define WINDOWS_VERSION 1
|
||||
#define PLUGIN_SDK_BUILD 1
|
||||
#define PLUGIN_SDK_DIRECTMIDI 1
|
||||
#define _STDINT_H 1
|
||||
|
||||
// the Digidesign projects all use a struct alignment of 2..
|
||||
#pragma pack (2)
|
||||
#pragma warning (disable: 4267 4996 4311 4312 4103 4121 4100 4127 4189 4245 4389 4512 4701 4703)
|
||||
|
||||
#include <ForcedInclude.h>
|
||||
|
||||
#else
|
||||
|
||||
#define kCompileAsCodeResource 0
|
||||
#define kNoDSP 1
|
||||
#define kNoDAE 0
|
||||
#define kNoSDS 0
|
||||
#define kNoViews 0
|
||||
#define kUseDSPCodeDecode 0
|
||||
|
||||
#define MAC_VERSION 1
|
||||
#define PLUGIN_SDK_BUILD 1
|
||||
#define PLUGIN_SDK_DIRECTMIDI 1
|
||||
#define DIGI_PASCAL
|
||||
|
||||
#include <MacAlwaysInclude.h>
|
||||
|
||||
#endif
|
||||
#endif
|
169
deps/juce/modules/juce_audio_plugin_client/RTAS/juce_RTAS_MacUtilities.mm
vendored
Normal file
169
deps/juce/modules/juce_audio_plugin_client/RTAS/juce_RTAS_MacUtilities.mm
vendored
Normal file
@@ -0,0 +1,169 @@
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2020 - Raw Material Software Limited
|
||||
|
||||
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 6 End-User License
|
||||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
|
||||
|
||||
End User License Agreement: www.juce.com/juce-6-licence
|
||||
Privacy Policy: www.juce.com/juce-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_core/system/juce_TargetPlatform.h>
|
||||
#include "../utility/juce_CheckSettingMacros.h"
|
||||
|
||||
#if JucePlugin_Build_RTAS
|
||||
|
||||
// Horrible carbon-based fix for a cocoa bug, where an NSWindow that wraps a carbon
|
||||
// window fails to keep its position updated when the user drags the window around..
|
||||
#define WINDOWPOSITION_BODGE 1
|
||||
#define JUCE_MAC_WINDOW_VISIBITY_BODGE 1
|
||||
|
||||
#include "../utility/juce_IncludeSystemHeaders.h"
|
||||
#include "../utility/juce_IncludeModuleHeaders.h"
|
||||
#include "../utility/juce_CarbonVisibility.h"
|
||||
|
||||
using namespace juce;
|
||||
|
||||
//==============================================================================
|
||||
void initialiseMacRTAS();
|
||||
void initialiseMacRTAS()
|
||||
{
|
||||
#if ! JUCE_64BIT
|
||||
NSApplicationLoad();
|
||||
#endif
|
||||
}
|
||||
|
||||
void* attachSubWindow (void*, Component*);
|
||||
void* attachSubWindow (void* hostWindowRef, Component* comp)
|
||||
{
|
||||
JUCE_AUTORELEASEPOOL
|
||||
{
|
||||
#if 0
|
||||
// This was suggested as a way to improve passing keypresses to the host, but
|
||||
// a side-effect seems to be occasional rendering artifacts.
|
||||
HIWindowChangeClass ((WindowRef) hostWindowRef, kFloatingWindowClass);
|
||||
#endif
|
||||
|
||||
NSWindow* hostWindow = [[NSWindow alloc] initWithWindowRef: hostWindowRef];
|
||||
[hostWindow retain];
|
||||
[hostWindow setCanHide: YES];
|
||||
[hostWindow setReleasedWhenClosed: YES];
|
||||
NSRect oldWindowFrame = [hostWindow frame];
|
||||
|
||||
NSView* content = [hostWindow contentView];
|
||||
NSRect f = [content frame];
|
||||
f.size.width = comp->getWidth();
|
||||
f.size.height = comp->getHeight();
|
||||
[content setFrame: f];
|
||||
|
||||
const CGFloat mainScreenHeight = [[[NSScreen screens] objectAtIndex: 0] frame].size.height;
|
||||
|
||||
#if WINDOWPOSITION_BODGE
|
||||
{
|
||||
Rect winBounds;
|
||||
GetWindowBounds ((WindowRef) hostWindowRef, kWindowContentRgn, &winBounds);
|
||||
NSRect w = [hostWindow frame];
|
||||
w.origin.x = winBounds.left;
|
||||
w.origin.y = mainScreenHeight - winBounds.bottom;
|
||||
[hostWindow setFrame: w display: NO animate: NO];
|
||||
}
|
||||
#endif
|
||||
|
||||
NSPoint windowPos = [hostWindow convertBaseToScreen: f.origin];
|
||||
windowPos.x = windowPos.x + jmax (0.0f, (oldWindowFrame.size.width - f.size.width) / 2.0f);
|
||||
windowPos.y = mainScreenHeight - (windowPos.y + f.size.height);
|
||||
|
||||
comp->setTopLeftPosition ((int) windowPos.x, (int) windowPos.y);
|
||||
|
||||
#if ! JucePlugin_EditorRequiresKeyboardFocus
|
||||
comp->addToDesktop (ComponentPeer::windowIsTemporary | ComponentPeer::windowIgnoresKeyPresses);
|
||||
#else
|
||||
comp->addToDesktop (ComponentPeer::windowIsTemporary);
|
||||
#endif
|
||||
|
||||
comp->setVisible (true);
|
||||
|
||||
NSView* pluginView = (NSView*) comp->getWindowHandle();
|
||||
NSWindow* pluginWindow = [pluginView window];
|
||||
|
||||
[hostWindow addChildWindow: pluginWindow
|
||||
ordered: NSWindowAbove];
|
||||
[hostWindow orderFront: nil];
|
||||
[pluginWindow orderFront: nil];
|
||||
|
||||
attachWindowHidingHooks (comp, (WindowRef) hostWindowRef, hostWindow);
|
||||
|
||||
return hostWindow;
|
||||
}
|
||||
}
|
||||
|
||||
void removeSubWindow (void*, Component*);
|
||||
void removeSubWindow (void* nsWindow, Component* comp)
|
||||
{
|
||||
JUCE_AUTORELEASEPOOL
|
||||
{
|
||||
NSView* pluginView = (NSView*) comp->getWindowHandle();
|
||||
NSWindow* hostWindow = (NSWindow*) nsWindow;
|
||||
NSWindow* pluginWindow = [pluginView window];
|
||||
|
||||
removeWindowHidingHooks (comp);
|
||||
[hostWindow removeChildWindow: pluginWindow];
|
||||
comp->removeFromDesktop();
|
||||
[hostWindow release];
|
||||
}
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
bool isJuceWindow (WindowRef w)
|
||||
{
|
||||
for (int i = ComponentPeer::getNumPeers(); --i >= 0;)
|
||||
{
|
||||
ComponentPeer* peer = ComponentPeer::getPeer(i);
|
||||
NSView* view = (NSView*) peer->getNativeHandle();
|
||||
|
||||
if ([[view window] windowRef] == w)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void forwardCurrentKeyEventToHostWindow();
|
||||
void forwardCurrentKeyEventToHostWindow()
|
||||
{
|
||||
WindowRef w = FrontNonFloatingWindow();
|
||||
WindowRef original = w;
|
||||
|
||||
while (IsValidWindowPtr (w) && isJuceWindow (w))
|
||||
{
|
||||
w = GetNextWindowOfClass (w, kDocumentWindowClass, true);
|
||||
|
||||
if (w == original)
|
||||
break;
|
||||
}
|
||||
|
||||
if (! isJuceWindow (w))
|
||||
{
|
||||
ActivateWindow (w, true);
|
||||
repostCurrentNSEvent();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
4
deps/juce/modules/juce_audio_plugin_client/RTAS/juce_RTAS_WinExports.def
vendored
Normal file
4
deps/juce/modules/juce_audio_plugin_client/RTAS/juce_RTAS_WinExports.def
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
EXPORTS
|
||||
NewPlugIn @1
|
||||
_PI_GetRoutineDescriptor @2
|
||||
|
BIN
deps/juce/modules/juce_audio_plugin_client/RTAS/juce_RTAS_WinResources.rsr
vendored
Normal file
BIN
deps/juce/modules/juce_audio_plugin_client/RTAS/juce_RTAS_WinResources.rsr
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.1 KiB |
157
deps/juce/modules/juce_audio_plugin_client/RTAS/juce_RTAS_WinUtilities.cpp
vendored
Normal file
157
deps/juce/modules/juce_audio_plugin_client/RTAS/juce_RTAS_WinUtilities.cpp
vendored
Normal file
@@ -0,0 +1,157 @@
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2020 - Raw Material Software Limited
|
||||
|
||||
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 6 End-User License
|
||||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
|
||||
|
||||
End User License Agreement: www.juce.com/juce-6-licence
|
||||
Privacy Policy: www.juce.com/juce-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_core/system/juce_TargetPlatform.h>
|
||||
#include "../utility/juce_CheckSettingMacros.h"
|
||||
|
||||
#if JucePlugin_Build_RTAS
|
||||
|
||||
// (these functions are in their own file because of problems including windows.h
|
||||
// at the same time as the Digi headers)
|
||||
|
||||
#define _DO_NOT_DECLARE_INTERLOCKED_INTRINSICS_IN_MEMORY // (workaround for a VC build problem)
|
||||
|
||||
#undef _WIN32_WINNT
|
||||
#define _WIN32_WINNT 0x0500
|
||||
#undef STRICT
|
||||
#define STRICT
|
||||
#include <intrin.h>
|
||||
#include <windows.h>
|
||||
|
||||
#pragma pack (push, 8)
|
||||
#include "../utility/juce_IncludeModuleHeaders.h"
|
||||
#pragma pack (pop)
|
||||
|
||||
//==============================================================================
|
||||
void JUCE_CALLTYPE attachSubWindow (void* hostWindow,
|
||||
int& titleW, int& titleH,
|
||||
Component* comp)
|
||||
{
|
||||
using namespace juce;
|
||||
|
||||
RECT clientRect;
|
||||
GetClientRect ((HWND) hostWindow, &clientRect);
|
||||
|
||||
titleW = clientRect.right - clientRect.left;
|
||||
titleH = jmax (0, (int) (clientRect.bottom - clientRect.top) - comp->getHeight());
|
||||
comp->setTopLeftPosition (0, titleH);
|
||||
|
||||
comp->addToDesktop (0);
|
||||
|
||||
HWND plugWnd = (HWND) comp->getWindowHandle();
|
||||
SetParent (plugWnd, (HWND) hostWindow);
|
||||
|
||||
DWORD val = GetWindowLong (plugWnd, GWL_STYLE);
|
||||
val = (val & ~WS_POPUP) | WS_CHILD;
|
||||
SetWindowLong (plugWnd, GWL_STYLE, val);
|
||||
|
||||
val = GetWindowLong ((HWND) hostWindow, GWL_STYLE);
|
||||
SetWindowLong ((HWND) hostWindow, GWL_STYLE, val | WS_CLIPCHILDREN);
|
||||
}
|
||||
|
||||
void JUCE_CALLTYPE resizeHostWindow (void* hostWindow,
|
||||
int& titleW, int& titleH,
|
||||
Component* comp)
|
||||
{
|
||||
using namespace juce;
|
||||
|
||||
RECT clientRect, windowRect;
|
||||
GetClientRect ((HWND) hostWindow, &clientRect);
|
||||
GetWindowRect ((HWND) hostWindow, &windowRect);
|
||||
const int borderW = (windowRect.right - windowRect.left) - (clientRect.right - clientRect.left);
|
||||
const int borderH = (windowRect.bottom - windowRect.top) - (clientRect.bottom - clientRect.top);
|
||||
|
||||
SetWindowPos ((HWND) hostWindow, 0, 0, 0,
|
||||
borderW + jmax (titleW, comp->getWidth()),
|
||||
borderH + comp->getHeight() + titleH,
|
||||
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOOWNERZORDER);
|
||||
}
|
||||
|
||||
extern "C" BOOL WINAPI DllMainRTAS (HINSTANCE, DWORD, LPVOID);
|
||||
|
||||
extern "C" BOOL WINAPI DllMain (HINSTANCE instance, DWORD reason, LPVOID reserved)
|
||||
{
|
||||
if (reason == DLL_PROCESS_ATTACH)
|
||||
juce::Process::setCurrentModuleInstanceHandle (instance);
|
||||
|
||||
if (GetModuleHandleA ("DAE.DLL") != 0)
|
||||
return DllMainRTAS (instance, reason, reserved);
|
||||
|
||||
juce::ignoreUnused (reserved);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#if ! JucePlugin_EditorRequiresKeyboardFocus
|
||||
|
||||
namespace
|
||||
{
|
||||
HWND findMDIParentOf (HWND w)
|
||||
{
|
||||
const int frameThickness = GetSystemMetrics (SM_CYFIXEDFRAME);
|
||||
|
||||
while (w != 0)
|
||||
{
|
||||
HWND parent = GetParent (w);
|
||||
|
||||
if (parent == 0)
|
||||
break;
|
||||
|
||||
TCHAR windowType [32] = { 0 };
|
||||
GetClassName (parent, windowType, 31);
|
||||
|
||||
if (juce::String (windowType).equalsIgnoreCase ("MDIClient"))
|
||||
{
|
||||
w = parent;
|
||||
break;
|
||||
}
|
||||
|
||||
RECT windowPos, parentPos;
|
||||
GetWindowRect (w, &windowPos);
|
||||
GetWindowRect (parent, &parentPos);
|
||||
|
||||
int dw = (parentPos.right - parentPos.left) - (windowPos.right - windowPos.left);
|
||||
int dh = (parentPos.bottom - parentPos.top) - (windowPos.bottom - windowPos.top);
|
||||
|
||||
if (dw > 100 || dh > 100)
|
||||
break;
|
||||
|
||||
w = parent;
|
||||
|
||||
if (dw == 2 * frameThickness)
|
||||
break;
|
||||
}
|
||||
|
||||
return w;
|
||||
}
|
||||
}
|
||||
|
||||
void JUCE_CALLTYPE passFocusToHostWindow (void* hostWindow)
|
||||
{
|
||||
SetFocus (findMDIParentOf ((HWND) hostWindow));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
1053
deps/juce/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp
vendored
Normal file
1053
deps/juce/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user