Browse Source

Fix parameters and state in JACK export

gh-pages
falkTX 9 years ago
parent
commit
e0a6cf3f22
2 changed files with 37 additions and 1 deletions
  1. +1
    -0
      dgl/src/Window.cpp
  2. +36
    -1
      distrho/src/DistrhoPluginJack.cpp

+ 1
- 0
dgl/src/Window.cpp View File

@@ -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);


+ 36
- 1
distrho/src/DistrhoPluginJack.cpp View File

@@ -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);


Loading…
Cancel
Save