Browse Source

Fix LV2 UI bridges to work with newer lilv

tags/1.9.5
falkTX 10 years ago
parent
commit
ee5afc2400
6 changed files with 31 additions and 14 deletions
  1. +3
    -2
      source/backend/plugin/CarlaPluginThread.cpp
  2. +1
    -1
      source/backend/plugin/Lv2Plugin.cpp
  3. +1
    -1
      source/bridges-ui/CarlaBridgeClient.cpp
  4. +1
    -1
      source/bridges-ui/CarlaBridgeClient.hpp
  5. +22
    -6
      source/bridges-ui/CarlaBridgeUI-LV2.cpp
  6. +3
    -3
      source/bridges-ui/CarlaBridgeUI-VST.cpp

+ 3
- 2
source/backend/plugin/CarlaPluginThread.cpp View File

@@ -172,8 +172,9 @@ void CarlaPluginThread::run()


case PLUGIN_THREAD_LV2_GUI: case PLUGIN_THREAD_LV2_GUI:
/* osc-url */ arguments.add(String(fEngine->getOscServerPathUDP()) + String("/") + String(fPlugin->getId())); /* osc-url */ arguments.add(String(fEngine->getOscServerPathUDP()) + String("/") + String(fPlugin->getId()));
/* URI */ arguments.add(fLabel.buffer());
/* ui-URI */ arguments.add(fExtra1.buffer());
/* URI */ arguments.add(fLabel.buffer()); // Plugin URI
/* ui-URI */ arguments.add(fExtra1.buffer()); // UI URI
/* ui-URI */ arguments.add(fExtra2.buffer()); // bundle
/* ui-title */ arguments.add(name + String(" (GUI)")); /* ui-title */ arguments.add(name + String(" (GUI)"));
break; break;




+ 1
- 1
source/backend/plugin/Lv2Plugin.cpp View File

@@ -5009,7 +5009,7 @@ public:
{ {
carla_stdout("Will use OSC-Bridge UI, binary: \"%s\"", bridgeBinary); carla_stdout("Will use OSC-Bridge UI, binary: \"%s\"", bridgeBinary);
fUI.type = UI::TYPE_OSC; fUI.type = UI::TYPE_OSC;
pData->osc.thread.setOscData(bridgeBinary, fDescriptor->URI, fUI.rdfDescriptor->URI);
pData->osc.thread.setOscData(bridgeBinary, fRdfDescriptor->URI, fUI.rdfDescriptor->URI, fUI.rdfDescriptor->Bundle);
delete[] bridgeBinary; delete[] bridgeBinary;
return; return;
} }


+ 1
- 1
source/bridges-ui/CarlaBridgeClient.cpp View File

@@ -39,7 +39,7 @@ CarlaBridgeClient::~CarlaBridgeClient()
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
// ui initialization // ui initialization


bool CarlaBridgeClient::uiInit(const char* const, const char* const)
bool CarlaBridgeClient::uiInit(const char*, const char* const, const char* const)
{ {
carla_debug("CarlaBridgeClient::uiInit()"); carla_debug("CarlaBridgeClient::uiInit()");




+ 1
- 1
source/bridges-ui/CarlaBridgeClient.hpp View File

@@ -34,7 +34,7 @@ public:
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
// ui initialization // ui initialization


virtual bool uiInit(const char* const, const char* const);
virtual bool uiInit(const char*, const char* const, const char* const);
virtual void uiIdle() {} virtual void uiIdle() {}
virtual void uiClose(); virtual void uiClose();




+ 22
- 6
source/bridges-ui/CarlaBridgeUI-LV2.cpp View File

@@ -350,12 +350,27 @@ public:
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
// ui initialization // ui initialization


bool uiInit(const char* pluginURI, const char* uiURI) override
bool uiInit(const char* pluginURI, const char* uiURI, const char* uiBundle) override
{ {
// -----------------------------------------------------------------
// load bundle

Lv2WorldClass& lv2World(Lv2WorldClass::getInstance());

Lilv::Node bundleNode(lv2World.new_file_uri(nullptr, uiBundle));
CARLA_SAFE_ASSERT_RETURN(bundleNode.is_uri(), false);

CarlaString sBundle(bundleNode.as_uri());

if (! sBundle.endsWith("/"))
sBundle += "/";

lv2World.load_bundle(sBundle);

// ----------------------------------------------------------------- // -----------------------------------------------------------------
// init // init


CarlaBridgeClient::uiInit(pluginURI, uiURI);
CarlaBridgeClient::uiInit(pluginURI, uiURI, uiBundle);


// ----------------------------------------------------------------- // -----------------------------------------------------------------
// get plugin from lv2_rdf (lilv) // get plugin from lv2_rdf (lilv)
@@ -1212,16 +1227,17 @@ int main(int argc, char* argv[])
{ {
CARLA_BRIDGE_USE_NAMESPACE CARLA_BRIDGE_USE_NAMESPACE


if (argc != 5)
if (argc != 6)
{ {
carla_stderr("usage: %s <osc-url|\"null\"> <plugin-uri> <ui-uri> <ui-title>", argv[0]);
carla_stderr("usage: %s <osc-url|\"null\"> <plugin-bundle> <plugin-uri> <ui-uri> <ui-title>", argv[0]);
return 1; return 1;
} }


const char* oscUrl = argv[1]; const char* oscUrl = argv[1];
const char* pluginURI = argv[2]; const char* pluginURI = argv[2];
const char* uiURI = argv[3]; const char* uiURI = argv[3];
const char* uiTitle = argv[4];
const char* uiBundle = argv[4];
const char* uiTitle = argv[5];


const bool useOsc(std::strcmp(oscUrl, "null") != 0); const bool useOsc(std::strcmp(oscUrl, "null") != 0);


@@ -1242,7 +1258,7 @@ int main(int argc, char* argv[])
// Load UI // Load UI
int ret; int ret;


if (client.uiInit(pluginURI, uiURI))
if (client.uiInit(pluginURI, uiURI, uiBundle))
{ {
client.toolkitExec(!useOsc); client.toolkitExec(!useOsc);
ret = 0; ret = 0;


+ 3
- 3
source/bridges-ui/CarlaBridgeUI-VST.cpp View File

@@ -51,12 +51,12 @@ public:
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
// ui initialization // ui initialization


bool uiInit(const char* binary, const char*) override
bool uiInit(const char* binary, const char*, const char*) override
{ {
// ----------------------------------------------------------------- // -----------------------------------------------------------------
// init // init


CarlaBridgeClient::uiInit(binary, nullptr);
CarlaBridgeClient::uiInit(binary, nullptr, nullptr);


// ----------------------------------------------------------------- // -----------------------------------------------------------------
// open DLL // open DLL
@@ -541,7 +541,7 @@ int main(int argc, char* argv[])
// Load UI // Load UI
int ret; int ret;


if (client.uiInit(binary, nullptr))
if (client.uiInit(binary, nullptr, nullptr))
{ {
client.toolkitExec(!useOsc); client.toolkitExec(!useOsc);
ret = 0; ret = 0;


Loading…
Cancel
Save