commit 29042aeca52a8cbe5ace2485084820c59f2ed1c7
parent a23c1f99fd38d394e145a01ffac051b5dad7e13c
Author: falkTX <falktx@gmail.com>
Date: Mon, 16 Feb 2015 16:07:53 +0000
Allow to receive fileBrowserSelected in plugin UIs
Diffstat:
3 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/distrho/DistrhoUI.hpp b/distrho/DistrhoUI.hpp
@@ -141,6 +141,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.
@see Window::onReshape(uint,uint)
diff --git a/distrho/src/DistrhoUI.cpp b/distrho/src/DistrhoUI.cpp
@@ -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);
diff --git a/distrho/src/DistrhoUIInternal.hpp b/distrho/src/DistrhoUIInternal.hpp
@@ -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;