Browse Source

Update distrho

tags/1.9.6
falkTX 9 years ago
parent
commit
9ebc24c6ef
5 changed files with 32 additions and 3 deletions
  1. +6
    -0
      source/modules/distrho/DistrhoUI.hpp
  2. +5
    -0
      source/modules/distrho/src/DistrhoPluginLV2export.cpp
  3. +8
    -1
      source/modules/distrho/src/DistrhoPluginVST.cpp
  4. +4
    -0
      source/modules/distrho/src/DistrhoUI.cpp
  5. +9
    -2
      source/modules/distrho/src/DistrhoUIInternal.hpp

+ 6
- 0
source/modules/distrho/DistrhoUI.hpp View File

@@ -140,6 +140,12 @@ protected:
*/
virtual void d_uiIdle() {}

/**
File browser selected function.
@see Window::fileBrowserSelected(const char*)
*/
virtual void d_uiFileBrowserSelected(const char* filename);

/**
OpenGL window reshape function, called when parent window is resized.
You can reimplement this function for a custom OpenGL state.


+ 5
- 0
source/modules/distrho/src/DistrhoPluginLV2export.cpp View File

@@ -44,6 +44,11 @@
# define DISTRHO_PLUGIN_MINIMUM_BUFFER_SIZE 2048
#endif

#if DISTRHO_PLUGIN_HAS_UI && ! defined(HAVE_DGL)
# undef DISTRHO_PLUGIN_HAS_UI
# define DISTRHO_PLUGIN_HAS_UI 0
#endif

#define DISTRHO_LV2_USE_EVENTS_IN (DISTRHO_PLUGIN_HAS_MIDI_INPUT || DISTRHO_PLUGIN_WANT_TIMEPOS || (DISTRHO_PLUGIN_WANT_STATE && DISTRHO_PLUGIN_HAS_UI))
#define DISTRHO_LV2_USE_EVENTS_OUT (DISTRHO_PLUGIN_HAS_MIDI_OUTPUT || (DISTRHO_PLUGIN_WANT_STATE && DISTRHO_PLUGIN_HAS_UI))



+ 8
- 1
source/modules/distrho/src/DistrhoPluginVST.cpp View File

@@ -16,6 +16,11 @@

#include "DistrhoPluginInternal.hpp"

#if DISTRHO_PLUGIN_HAS_UI && ! defined(HAVE_DGL)
# undef DISTRHO_PLUGIN_HAS_UI
# define DISTRHO_PLUGIN_HAS_UI 0
#endif

#if DISTRHO_PLUGIN_HAS_UI
# include "DistrhoUIInternal.hpp"
#endif
@@ -371,8 +376,10 @@ public:
case effSetSampleRate:
fPlugin.setSampleRate(opt, true);

#if DISTRHO_PLUGIN_HAS_UI
if (fVstUI != nullptr)
fVstUI->setSampleRate(opt);
#endif
break;

case effSetBlockSize:
@@ -583,7 +590,7 @@ public:
case effCanDo:
if (const char* const canDo = (const char*)ptr)
{
# if DISTRHO_OS_MAC
# if DISTRHO_OS_MAC && DISTRHO_PLUGIN_HAS_UI
if (std::strcmp(canDo, "hasCockosViewAsConfig") == 0)
{
fUsingNsView = true;


+ 4
- 0
source/modules/distrho/src/DistrhoUI.cpp View File

@@ -90,6 +90,10 @@ void UI::d_sampleRateChanged(double) {}
/* ------------------------------------------------------------------------------------------------------------
* UI Callbacks (optional) */

void UI::d_uiFileBrowserSelected(const char*)
{
}

void UI::d_uiReshape(uint width, uint height)
{
glEnable(GL_BLEND);


+ 9
- 2
source/modules/distrho/src/DistrhoUIInternal.hpp View File

@@ -170,16 +170,23 @@ public:
}

protected:
// custom window reshape
void onReshape(uint width, uint height) override
{
DISTRHO_SAFE_ASSERT_RETURN(fUI != nullptr,);

// custom window reshape
fUI->d_uiReshape(width, height);

fIsReady = true;
}

// custom file-browser selected
void fileBrowserSelected(const char* filename) override
{
DISTRHO_SAFE_ASSERT_RETURN(fUI != nullptr,);

fUI->d_uiFileBrowserSelected(filename);
}

private:
UI* const fUI;
bool fIsReady;


Loading…
Cancel
Save