Skip to content

Commit

Permalink
Allow to pass winId to jack standalone, for special purposes
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Apr 2, 2022
1 parent 39cd498 commit 1bab226
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions distrho/src/DistrhoPluginJACK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ class PluginJack
#endif
{
public:
PluginJack(jack_client_t* const client)
PluginJack(jack_client_t* const client, const uintptr_t winId)
: fPlugin(this, writeMidiCallback, requestParameterValueChangeCallback, nullptr),
#if DISTRHO_PLUGIN_HAS_UI
fUI(this,
0, // winId
winId,
d_nextSampleRate,
nullptr, // edit param
setParameterValueCallback,
Expand Down Expand Up @@ -1030,7 +1030,13 @@ int main(int argc, char* argv[])
}
#endif

const PluginJack p(client);
uintptr_t winId = 0;
#if DISTRHO_PLUGIN_HAS_UI
if (argc == 3 && std::strcmp(argv[1], "embed") == 0)
winId = static_cast<uintptr_t>(std::atoll(argv[2]));
#endif

const PluginJack p(client, winId);

#if defined(DISTRHO_OS_WINDOWS) && DISTRHO_PLUGIN_HAS_UI
/* the code below is based on
Expand Down

0 comments on commit 1bab226

Please sign in to comment.