commit e0a6cf3f22550e2c7d40a97b60a688771de93ce8
parent f333c7a90c664458d41828e8c2489e2e95ed5607
Author: falkTX <falktx@gmail.com>
Date: Sun, 25 May 2014 02:30:12 +0100
Fix parameters and state in JACK export
Diffstat:
2 files changed, 37 insertions(+), 1 deletion(-)
diff --git a/dgl/src/Window.cpp b/dgl/src/Window.cpp
@@ -576,6 +576,7 @@ struct Window::PrivateData {
if (widget->isVisible())
{
const int ypos = widget->fInvertedY ? fView->height - widget->getHeight() - widget->getAbsoluteY() : widget->getAbsoluteY();
+ //const int ypos = fView->height - widget->getHeight() - widget->getAbsoluteY();
// reset color
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
diff --git a/distrho/src/DistrhoPluginJack.cpp b/distrho/src/DistrhoPluginJack.cpp
@@ -30,6 +30,10 @@
START_NAMESPACE_DISTRHO
+#if ! DISTRHO_PLUGIN_WANT_STATE
+static const setStateFunc setStateCallback = nullptr;
+#endif
+
// -----------------------------------------------------------------------
class PluginJack
@@ -37,7 +41,7 @@ class PluginJack
public:
PluginJack(jack_client_t* const client)
: fPlugin(),
- fUI(this, 0, nullptr, nullptr, nullptr, nullptr, setSizeCallback, fPlugin.getInstancePointer()),
+ fUI(this, 0, nullptr, setParameterValueCallback, setStateCallback, nullptr, setSizeCallback, fPlugin.getInstancePointer()),
fClient(client)
{
char strBuf[0xff+1];
@@ -171,6 +175,11 @@ protected:
else
fTimePos.bbt.valid = false;
}
+ else
+ {
+ fTimePos.bbt.valid = false;
+ fTimePos.frame = 0;
+ }
fPlugin.setTimePos(fTimePos);
#endif
@@ -217,6 +226,20 @@ protected:
fUI.quit();
}
+ // -------------------------------------------------------------------
+
+ void setParameterValue(const uint32_t index, const float value)
+ {
+ fPlugin.setParameterValue(index, value);
+ }
+
+#if DISTRHO_PLUGIN_WANT_STATE
+ void setState(const char* const key, const char* const value)
+ {
+ fPlugin.setState(key, value);
+ }
+#endif
+
void setSize(const uint width, const uint height)
{
fUI.setSize(width, height);
@@ -271,6 +294,18 @@ private:
uiPtr->jackShutdown();
}
+ static void setParameterValueCallback(void* ptr, uint32_t index, float value)
+ {
+ uiPtr->setParameterValue(index, value);
+ }
+
+#if DISTRHO_PLUGIN_WANT_STATE
+ static void setStateCallback(void* ptr, const char* key, const char* value)
+ {
+ uiPtr->setState(key, value);
+ }
+#endif
+
static void setSizeCallback(void* ptr, uint width, uint height)
{
uiPtr->setSize(width, height);