diff options
author | falkTX <falktx@gmail.com> | 2017-08-02 10:13:15 +0200 |
---|---|---|
committer | falkTX <falktx@gmail.com> | 2017-08-02 10:13:15 +0200 |
commit | a186f083ca010739b73c13bc75b0973264871de2 (patch) | |
tree | b56d5ad6d80ec6717f1929d7f3341b5161e83d4d | |
parent | bf326114bda07014e09e2a4ba9b3f41dc0de885f (diff) |
Add vst product string test, to know if we should capture keys
-rw-r--r-- | distrho/src/DistrhoPluginVST.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/distrho/src/DistrhoPluginVST.cpp b/distrho/src/DistrhoPluginVST.cpp index efeedace..e6b9f0f1 100644 --- a/distrho/src/DistrhoPluginVST.cpp +++ b/distrho/src/DistrhoPluginVST.cpp @@ -124,8 +124,20 @@ public: fEffect(effect), fUiHelper(uiHelper), fPlugin(plugin), - fUI(this, winId, editParameterCallback, setParameterCallback, setStateCallback, sendNoteCallback, setSizeCallback, plugin->getInstancePointer()) + fUI(this, winId, editParameterCallback, setParameterCallback, setStateCallback, sendNoteCallback, setSizeCallback, plugin->getInstancePointer()), + fShouldCaptureVstKeys(false) { + // FIXME only needed for windows? +//#ifdef DISTRHO_OS_WINDOWS + char strBuf[0xff+1]; + std::memset(strBuf, 0, sizeof(char)*(0xff+1)); + hostCallback(audioMasterGetProductString, 0, 0, strBuf); + d_stdout("Plugin UI running in '%s'", strBuf); + + // TODO make a white-list of needed hosts + if (/*std::strcmp(strBuf, "") == 0*/ true) + fShouldCaptureVstKeys = true; +//#endif } // ------------------------------------------------------------------- @@ -172,6 +184,9 @@ public: int handlePluginKeyEvent(const bool down, int32_t index, const intptr_t value) { # if !DISTRHO_PLUGIN_HAS_EXTERNAL_UI + if (! fShouldCaptureVstKeys) + return 0; + d_stdout("handlePluginKeyEvent %i %i %li\n", down, index, (long int)value); int special = 0; @@ -284,6 +299,7 @@ private: // Plugin UI UIExporter fUI; + bool fShouldCaptureVstKeys; // ------------------------------------------------------------------- // Callbacks |