DPF

DISTRHO Plugin Framework
Log | Files | Refs | Submodules | README | LICENSE

commit 1a8954821d65d45c0e5a842879fb33fb1694c0b0
parent 22a06adda4573bf2ca9825c0820478713e7be98f
Author: falkTX <falktx@gmail.com>
Date:   Sat, 11 Oct 2014 14:44:45 +0100

Handle hasCockosViewAsConfig properly; Misc fixing

Diffstat:
Mdgl/src/pugl/pugl_osx.m | 4++--
Mdistrho/src/DistrhoPluginVST.cpp | 32+++++++++++++++++++++++++++-----
Mutils/lv2-ttl-generator/lv2_ttl_generator.c | 5+++--
3 files changed, 32 insertions(+), 9 deletions(-)

diff --git a/dgl/src/pugl/pugl_osx.m b/dgl/src/pugl/pugl_osx.m @@ -374,12 +374,12 @@ puglCreateWindow(PuglView* view, const char* title) [impl->glview setAutoresizingMask:NSViewWidthSizable|NSViewHeightSizable]; } - [impl->glview setBoundsSize:NSMakeSize(impl->glview->puglview->width, impl->glview->puglview->height)]; + //[impl->glview setBoundsSize:NSMakeSize(impl->glview->puglview->width, impl->glview->puglview->height)]; if (view->parent) { NSView* pview = (NSView*)view->parent; [pview addSubview:impl->glview]; - return 0; + return 0; } id window = [[PuglWindow new]retain]; diff --git a/distrho/src/DistrhoPluginVST.cpp b/distrho/src/DistrhoPluginVST.cpp @@ -295,7 +295,15 @@ public: parameterValues[i] = 0.0f; } } -#endif +# if DISTRHO_OS_MAC +# ifdef __LP64__ + fUsingNsView = true; +# else +# warning 32bit VST UIs on OSX only work if the host supports "hasCockosViewAsConfig" + fUsingNsView = false; +# endif +# endif // DISTRHO_OS_MAC +#endif // DISTRHO_PLUGIN_HAS_UI #if DISTRHO_PLUGIN_WANT_STATE fStateChunk = nullptr; @@ -407,12 +415,16 @@ public: case effEditOpen: if (fVstUI == nullptr) { -# if DISTRHO_OS_MAC && ! defined(__LP64__) - if ((fEffect->dispatcher(fEffect, effCanDo, 0, 0, (void*)"hasCockosViewAsConfig", 0.0f) & 0xffff0000) != 0xbeef0000) +# if DISTRHO_OS_MAC + if (! fUsingNsView) + { + d_stderr("Host doesn't support hasCockosViewAsConfig, cannot use UI"); return 0; + } # endif d_lastUiSampleRate = fPlugin.getSampleRate(); + d_stdout("effEditOpen with ptr = %p", ptr); fVstUI = new UIVst(fAudioMaster, fEffect, this, &fPlugin, (intptr_t)ptr); # if DISTRHO_PLUGIN_WANT_STATE @@ -568,10 +580,17 @@ public: } break; +#if DISTRHO_PLUGIN_HAS_MIDI_INPUT || DISTRHO_PLUGIN_HAS_MIDI_OUTPUT || DISTRHO_PLUGIN_WANT_TIMEPOS || DISTRHO_OS_MAC case effCanDo: -#if DISTRHO_PLUGIN_HAS_MIDI_INPUT || DISTRHO_PLUGIN_HAS_MIDI_OUTPUT || DISTRHO_PLUGIN_WANT_TIMEPOS if (const char* const canDo = (const char*)ptr) { +# if DISTRHO_OS_MAC + if (std::strcmp(canDo, "hasCockosViewAsConfig") == 0) + { + fUsingNsView = true; + return 0xbeef0000; + } +# endif # if DISTRHO_PLUGIN_HAS_MIDI_INPUT if (std::strcmp(canDo, "receiveVstEvents") == 0) return 1; @@ -589,8 +608,8 @@ public: return 1; # endif } -#endif break; +#endif //case effStartProcess: //case effStopProcess: @@ -712,6 +731,9 @@ private: #if DISTRHO_PLUGIN_HAS_UI UIVst* fVstUI; ERect fVstRect; +# if DISTRHO_OS_MAC + bool fUsingNsView; +# endif #endif #if DISTRHO_PLUGIN_WANT_STATE diff --git a/utils/lv2-ttl-generator/lv2_ttl_generator.c b/utils/lv2-ttl-generator/lv2_ttl_generator.c @@ -53,10 +53,11 @@ int main(int argc, char* argv[]) char basename[strlen(argv[1])+1]; #ifdef TTL_GENERATOR_WINDOWS - if (char* base2 = strrchr(argv[1], '\\')) + char* base2 = strrchr(argv[1], '\\'); #else - if (char* base2 = strrchr(argv[1], '/')) + char* base2 = strrchr(argv[1], '/'); #endif + if (base2 != NULL) { strcpy(basename, base2+1); basename[strrchr(base2, '.')-base2-1] = '\0';