1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-11 23:54:18 +00:00

Fix some warnings in the VST/VST3 wrappers

This commit is contained in:
hogliux 2015-09-04 13:16:52 +01:00
parent b7bca8ce5a
commit 98ebfdc1fa
6 changed files with 55 additions and 54 deletions

View file

@ -122,14 +122,14 @@ static juce::uint32 lastMasterIdleCall = 0;
namespace juce
{
#if JUCE_MAC
extern void initialiseMac();
extern void* attachComponentToWindowRef (Component*, void* parent, bool isNSView);
extern void detachComponentFromWindowRef (Component*, void* window, bool isNSView);
extern void setNativeHostWindowSize (void* window, Component*, int newWidth, int newHeight, bool isNSView);
extern void checkWindowVisibility (void* window, Component*, bool isNSView);
extern bool forwardCurrentKeyEventToHost (Component*, bool isNSView);
extern void initialiseMacVST();
extern void* attachComponentToWindowRefVST (Component*, void* parent, bool isNSView);
extern void detachComponentFromWindowRefVST (Component*, void* window, bool isNSView);
extern void setNativeHostWindowSizeVST (void* window, Component*, int newWidth, int newHeight, bool isNSView);
extern void checkWindowVisibilityVST (void* window, Component*, bool isNSView);
extern bool forwardCurrentKeyEventToHostVST (Component*, bool isNSView);
#if ! JUCE_64BIT
extern void updateEditorCompBounds (Component*);
extern void updateEditorCompBoundsVST (Component*);
#endif
#endif
@ -1053,7 +1053,7 @@ public:
#if JUCE_MAC
if (hostWindow != 0)
checkWindowVisibility (hostWindow, editorComp, useNSView);
checkWindowVisibilityVST (hostWindow, editorComp, useNSView);
#endif
tryMasterIdle();
@ -1147,7 +1147,7 @@ public:
#if JUCE_MAC
if (hostWindow != 0)
{
detachComponentFromWindowRef (editorComp, hostWindow, useNSView);
detachComponentFromWindowRefVST (editorComp, hostWindow, useNSView);
hostWindow = 0;
}
#endif
@ -1204,7 +1204,7 @@ public:
Window editorWnd = (Window) editorComp->getWindowHandle();
XReparentWindow (display, editorWnd, hostWindow, 0, 0);
#else
hostWindow = attachComponentToWindowRef (editorComp, ptr, useNSView);
hostWindow = attachComponentToWindowRefVST (editorComp, ptr, useNSView);
#endif
editorComp->setVisible (true);
@ -1259,7 +1259,7 @@ public:
{
// some hosts don't support the sizeWindow call, so do it manually..
#if JUCE_MAC
setNativeHostWindowSize (hostWindow, editorComp, newWidth, newHeight, useNSView);
setNativeHostWindowSizeVST (hostWindow, editorComp, newWidth, newHeight, useNSView);
#elif JUCE_LINUX
// (Currently, all linux hosts support sizeWindow, so this should never need to happen)
@ -1363,7 +1363,7 @@ public:
{
// If we have an unused keypress, move the key-focus to a host window
// and re-inject the event..
return forwardCurrentKeyEventToHost (this, wrapper.useNSView);
return forwardCurrentKeyEventToHostVST (this, wrapper.useNSView);
}
#endif
@ -1379,7 +1379,7 @@ public:
#if JUCE_MAC && ! JUCE_64BIT
if (! wrapper.useNSView)
updateEditorCompBounds (this);
updateEditorCompBoundsVST (this);
#endif
}
@ -1572,14 +1572,14 @@ namespace
JUCE_EXPORTED_FUNCTION AEffect* VSTPluginMain (audioMasterCallback audioMaster);
JUCE_EXPORTED_FUNCTION AEffect* VSTPluginMain (audioMasterCallback audioMaster)
{
initialiseMac();
initialiseMacVST();
return pluginEntryPoint (audioMaster);
}
JUCE_EXPORTED_FUNCTION AEffect* main_macho (audioMasterCallback audioMaster);
JUCE_EXPORTED_FUNCTION AEffect* main_macho (audioMasterCallback audioMaster)
{
initialiseMac();
initialiseMacVST();
return pluginEntryPoint (audioMaster);
}

View file

@ -42,8 +42,8 @@ namespace juce
{
#if ! JUCE_64BIT
void updateEditorCompBounds (Component*);
void updateEditorCompBounds (Component* comp)
void updateEditorCompBoundsVST (Component*);
void updateEditorCompBoundsVST (Component* comp)
{
HIViewRef dummyView = (HIViewRef) (void*) (pointer_sized_int)
comp->getProperties() ["dummyViewRef"].toString().getHexValue64();
@ -63,22 +63,22 @@ void updateEditorCompBounds (Component* comp)
static pascal OSStatus viewBoundsChangedEvent (EventHandlerCallRef, EventRef, void* user)
{
updateEditorCompBounds ((Component*) user);
updateEditorCompBoundsVST ((Component*) user);
return noErr;
}
#endif
//==============================================================================
void initialiseMac();
void initialiseMac()
void initialiseMacVST();
void initialiseMacVST()
{
#if ! JUCE_64BIT
NSApplicationLoad();
#endif
}
void* attachComponentToWindowRef (Component* comp, void* parentWindowOrView, bool isNSView);
void* attachComponentToWindowRef (Component* comp, void* parentWindowOrView, bool isNSView)
void* attachComponentToWindowRefVST (Component* comp, void* parentWindowOrView, bool isNSView);
void* attachComponentToWindowRefVST (Component* comp, void* parentWindowOrView, bool isNSView)
{
JUCE_AUTORELEASEPOOL
{
@ -133,7 +133,7 @@ void* attachComponentToWindowRef (Component* comp, void* parentWindowOrView, boo
InstallEventHandler (GetControlEventTarget (dummyView), NewEventHandlerUPP (viewBoundsChangedEvent), 1, &kControlBoundsChangedEvent, (void*) comp, &ref);
comp->getProperties().set ("boundsEventRef", String::toHexString ((pointer_sized_int) (void*) ref));
updateEditorCompBounds (comp);
updateEditorCompBoundsVST (comp);
#if ! JucePlugin_EditorRequiresKeyboardFocus
comp->addToDesktop (ComponentPeer::windowIsTemporary | ComponentPeer::windowIgnoresKeyPresses);
@ -181,8 +181,8 @@ void* attachComponentToWindowRef (Component* comp, void* parentWindowOrView, boo
}
}
void detachComponentFromWindowRef (Component* comp, void* window, bool isNSView);
void detachComponentFromWindowRef (Component* comp, void* window, bool isNSView)
void detachComponentFromWindowRefVST (Component* comp, void* window, bool isNSView);
void detachComponentFromWindowRefVST (Component* comp, void* window, bool isNSView)
{
JUCE_AUTORELEASEPOOL
{
@ -239,8 +239,8 @@ void detachComponentFromWindowRef (Component* comp, void* window, bool isNSView)
}
}
void setNativeHostWindowSize (void* window, Component* component, int newWidth, int newHeight, bool isNSView);
void setNativeHostWindowSize (void* window, Component* component, int newWidth, int newHeight, bool isNSView)
void setNativeHostWindowSizeVST (void* window, Component* component, int newWidth, int newHeight, bool isNSView);
void setNativeHostWindowSizeVST (void* window, Component* component, int newWidth, int newHeight, bool isNSView)
{
JUCE_AUTORELEASEPOOL
{
@ -277,8 +277,8 @@ void setNativeHostWindowSize (void* window, Component* component, int newWidth,
}
}
void checkWindowVisibility (void* window, Component* comp, bool isNSView);
void checkWindowVisibility (void* window, Component* comp, bool isNSView)
void checkWindowVisibilityVST (void* window, Component* comp, bool isNSView);
void checkWindowVisibilityVST (void* window, Component* comp, bool isNSView)
{
(void) window; (void) comp; (void) isNSView;
@ -288,8 +288,8 @@ void checkWindowVisibility (void* window, Component* comp, bool isNSView)
#endif
}
bool forwardCurrentKeyEventToHost (Component* comp, bool isNSView);
bool forwardCurrentKeyEventToHost (Component* comp, bool isNSView)
bool forwardCurrentKeyEventToHostVST (Component* comp, bool isNSView);
bool forwardCurrentKeyEventToHostVST (Component* comp, bool isNSView)
{
#if ! JUCE_64BIT
if (! isNSView)

View file

@ -62,10 +62,10 @@ using namespace Steinberg;
//==============================================================================
#if JUCE_MAC
extern void initialiseMac();
extern void* attachComponentToWindowRef (Component*, void* parent, bool isNSView);
extern void detachComponentFromWindowRef (Component*, void* window, bool isNSView);
extern void setNativeHostWindowSize (void* window, Component*, int newWidth, int newHeight, bool isNSView);
extern void initialiseMacVST3();
extern void* attachComponentToWindowRefVST3 (Component*, void* parent, bool isNSView);
extern void detachComponentFromWindowRefVST3 (Component*, void* window, bool isNSView);
extern void setNativeHostWindowSizeVST3 (void* window, Component*, int newWidth, int newHeight, bool isNSView);
#endif
//==============================================================================
@ -552,7 +552,7 @@ private:
component->setVisible (true);
#else
isNSView = (strcmp (type, kPlatformTypeNSView) == 0);
macHostWindow = juce::attachComponentToWindowRef (component, parent, isNSView);
macHostWindow = juce::attachComponentToWindowRefVST3 (component, parent, isNSView);
#endif
component->resizeHostWindow();
@ -571,7 +571,7 @@ private:
#else
if (macHostWindow != nullptr)
{
juce::detachComponentFromWindowRef (component, macHostWindow, isNSView);
juce::detachComponentFromWindowRefVST3 (component, macHostWindow, isNSView);
macHostWindow = nullptr;
}
#endif
@ -683,7 +683,7 @@ private:
setSize (w, h);
#else
if (owner.macHostWindow != nullptr && ! getHostType().isWavelab())
juce::setNativeHostWindowSize (owner.macHostWindow, this, w, h, owner.isNSView);
juce::setNativeHostWindowSizeVST3 (owner.macHostWindow, this, w, h, owner.isNSView);
#endif
if (owner.plugFrame != nullptr)
@ -1769,7 +1769,7 @@ DEF_CLASS_IID (JuceAudioProcessor)
bool initModule()
{
#if JUCE_MAC
initialiseMac();
initialiseMacVST3();
#endif
return true;

View file

@ -42,7 +42,7 @@
//==============================================================================
namespace juce
{
static void initialiseMac()
void initialiseMacVST3()
{
#if ! JUCE_64BIT
NSApplicationLoad();
@ -50,7 +50,7 @@ namespace juce
}
#if ! JUCE_64BIT
static void updateComponentPos (Component* const comp)
static void updateComponentPosVST3 (Component* const comp)
{
DBG ("updateComponentPos()");
@ -70,14 +70,14 @@ namespace juce
(int) (windowPos.top + r.origin.y));
}
static pascal OSStatus viewBoundsChangedEvent (EventHandlerCallRef, EventRef, void* user)
static pascal OSStatus viewBoundsChangedEventVST3 (EventHandlerCallRef, EventRef, void* user)
{
updateComponentPos ((Component*) user);
updateComponentPosVST3 ((Component*) user);
return noErr;
}
#endif
static void* attachComponentToWindowRef (Component* comp, void* windowRef, bool isHIView)
void* attachComponentToWindowRefVST3 (Component* comp, void* windowRef, bool isHIView)
{
DBG ("attachComponentToWindowRef()");
@ -163,10 +163,10 @@ namespace juce
EventHandlerRef ref;
const EventTypeSpec kControlBoundsChangedEvent = { kEventClassControl, kEventControlBoundsChanged };
InstallEventHandler (GetControlEventTarget (dummyView), NewEventHandlerUPP (viewBoundsChangedEvent), 1, &kControlBoundsChangedEvent, (void*) comp, &ref);
InstallEventHandler (GetControlEventTarget (dummyView), NewEventHandlerUPP (viewBoundsChangedEventVST3), 1, &kControlBoundsChangedEvent, (void*) comp, &ref);
comp->getProperties().set ("boundsEventRef", String::toHexString ((pointer_sized_int) (void*) ref));
updateComponentPos (comp);
updateComponentPosVST3 (comp);
#if ! JucePlugin_EditorRequiresKeyboardFocus
comp->addToDesktop (ComponentPeer::windowIsTemporary | ComponentPeer::windowIgnoresKeyPresses);
@ -194,7 +194,7 @@ namespace juce
}
}
static void detachComponentFromWindowRef (Component* comp, void* nsWindow, bool isHIView)
void detachComponentFromWindowRefVST3 (Component* comp, void* nsWindow, bool isHIView)
{
JUCE_AUTORELEASEPOOL
{
@ -242,7 +242,7 @@ namespace juce
}
}
static void setNativeHostWindowSize (void* nsWindow, Component* component, int newWidth, int newHeight, bool isHIView)
void setNativeHostWindowSizeVST3 (void* nsWindow, Component* component, int newWidth, int newHeight, bool isHIView)
{
JUCE_AUTORELEASEPOOL
{

View file

@ -60,12 +60,12 @@ static bool doUIDsMatch (const Steinberg::TUID a, const Steinberg::TUID b) noexc
}
//==============================================================================
static juce::String toString (const Steinberg::char8* string) noexcept { return juce::String (string); }
static juce::String toString (const Steinberg::char16* string) noexcept { return juce::String (juce::CharPointer_UTF16 ((juce::CharPointer_UTF16::CharType*) string)); }
inline juce::String toString (const Steinberg::char8* string) noexcept { return juce::String (string); }
inline juce::String toString (const Steinberg::char16* string) noexcept { return juce::String (juce::CharPointer_UTF16 ((juce::CharPointer_UTF16::CharType*) string)); }
// NB: The casts are handled by a Steinberg::UString operator
static juce::String toString (const Steinberg::UString128& string) noexcept { return toString (static_cast<const Steinberg::char16*> (string)); }
static juce::String toString (const Steinberg::UString256& string) noexcept { return toString (static_cast<const Steinberg::char16*> (string)); }
inline juce::String toString (const Steinberg::UString128& string) noexcept { return toString (static_cast<const Steinberg::char16*> (string)); }
inline juce::String toString (const Steinberg::UString256& string) noexcept { return toString (static_cast<const Steinberg::char16*> (string)); }
static void toString128 (Steinberg::Vst::String128 result, const char* source)
{
@ -396,7 +396,7 @@ namespace VST3BufferExchange
channelIndexOffset += numChansForBus;
}
static void mapBufferToBusses (Array<Steinberg::Vst::AudioBusBuffers>& result, BusMap& busMapToUse,
inline void mapBufferToBusses (Array<Steinberg::Vst::AudioBusBuffers>& result, BusMap& busMapToUse,
const Array<Steinberg::Vst::SpeakerArrangement>& arrangements,
AudioSampleBuffer& source)
{
@ -407,7 +407,7 @@ namespace VST3BufferExchange
arrangements.getUnchecked (i), source);
}
static void mapBufferToBusses (Array<Steinberg::Vst::AudioBusBuffers>& result,
inline void mapBufferToBusses (Array<Steinberg::Vst::AudioBusBuffers>& result,
Steinberg::Vst::IAudioProcessor& processor,
BusMap& busMapToUse, bool isInput, int numBusses,
AudioSampleBuffer& source)

View file

@ -44,6 +44,7 @@
#pragma clang diagnostic ignored "-Woverloaded-virtual"
#pragma clang diagnostic ignored "-Wshadow"
#pragma clang diagnostic ignored "-Wdeprecated-register"
#pragma clang diagnostic ignored "-Wunused-function"
#endif
/* These files come with the Steinberg VST3 SDK - to get them, you'll need to