From 239825b92b1d4c79ebd67cb3766355bf8e699bc7 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 19 May 2008 23:52:44 +0000 Subject: Better global (engine/client) LV2 feature sharing. Provide URI map extension to plugin UIs. git-svn-id: http://svn.drobilla.net/lad/ingen@1217 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/client/PluginModel.cpp | 4 ++-- src/libs/client/PluginModel.hpp | 5 +++-- src/libs/client/PluginUI.cpp | 23 +++++++++++------------ src/libs/client/PluginUI.hpp | 25 ++++++++++++------------- 4 files changed, 28 insertions(+), 29 deletions(-) (limited to 'src/libs/client') diff --git a/src/libs/client/PluginModel.cpp b/src/libs/client/PluginModel.cpp index 1f11cc21..9e4df473 100644 --- a/src/libs/client/PluginModel.cpp +++ b/src/libs/client/PluginModel.cpp @@ -97,14 +97,14 @@ lv2_ui_write(LV2UI_Controller controller, #ifdef HAVE_SLV2 SharedPtr -PluginModel::ui(SharedPtr engine, SharedPtr node) const +PluginModel::ui(Ingen::Shared::World* world, SharedPtr node) const { if (_type != LV2) return SharedPtr(); Glib::Mutex::Lock(_rdf_world->mutex()); - return PluginUI::create(engine, node, _slv2_world, _slv2_plugin); + return PluginUI::create(world, node, _slv2_plugin); } diff --git a/src/libs/client/PluginModel.hpp b/src/libs/client/PluginModel.hpp index f5ac71f4..e19d1691 100644 --- a/src/libs/client/PluginModel.hpp +++ b/src/libs/client/PluginModel.hpp @@ -29,6 +29,7 @@ #endif #include "interface/EngineInterface.hpp" #include "interface/Plugin.hpp" +#include "module/World.hpp" using std::string; @@ -96,8 +97,8 @@ public: _slv2_plugins = slv2_world_get_all_plugins(_slv2_world); } - SharedPtr ui(SharedPtr engine, - SharedPtr node) const; + SharedPtr ui(Ingen::Shared::World* world, + SharedPtr node) const; const string& icon_path() const; static string get_lv2_icon_path(SLV2Plugin plugin); diff --git a/src/libs/client/PluginUI.cpp b/src/libs/client/PluginUI.cpp index 54ee0009..5215de25 100644 --- a/src/libs/client/PluginUI.cpp +++ b/src/libs/client/PluginUI.cpp @@ -33,7 +33,7 @@ lv2_ui_write(LV2UI_Controller controller, uint32_t format, const void* buffer) { - cerr << "********* LV2 UI WRITE (FORMAT " << format << ":" << endl; + cerr << "********* LV2 UI WRITE (FORMAT " << format << "):" << endl; /*lv2_osc_message_print((const LV2Message*)buffer);*/ fprintf(stderr, "RAW:\n"); @@ -51,16 +51,16 @@ lv2_ui_write(LV2UI_Controller controller, SharedPtr port = ui->node()->ports()[port_index]; if (format == 0) { - ui->engine()->set_port_value_immediate(port->path(), + ui->world()->engine->set_port_value_immediate(port->path(), port->type().uri(), buffer_size, buffer); } } -PluginUI::PluginUI(SharedPtr engine, - SharedPtr node) - : _engine(engine) +PluginUI::PluginUI(Ingen::Shared::World* world, + SharedPtr node) + : _world(world) , _node(node) , _instance(NULL) { @@ -74,14 +74,13 @@ PluginUI::~PluginUI() SharedPtr -PluginUI::create(SharedPtr engine, - SharedPtr node, - SLV2World world, - SLV2Plugin plugin) +PluginUI::create(Ingen::Shared::World* world, + SharedPtr node, + SLV2Plugin plugin) { SharedPtr ret; - SLV2Value gtk_gui_uri = slv2_value_new_uri(world, + SLV2Value gtk_gui_uri = slv2_value_new_uri(world->slv2_world, "http://lv2plug.in/ns/extensions/ui#GtkUI"); SLV2UIs uis = slv2_plugin_get_uis(plugin); @@ -99,9 +98,9 @@ PluginUI::create(SharedPtr engine, if (ui) { cout << "Found GTK Plugin UI: " << slv2_ui_get_uri(ui) << endl; - ret = SharedPtr(new PluginUI(engine, node)); + ret = SharedPtr(new PluginUI(world, node)); SLV2UIInstance inst = slv2_ui_instantiate( - plugin, ui, lv2_ui_write, ret.get(), NULL); + plugin, ui, lv2_ui_write, ret.get(), world->lv2_features->lv2_features()); if (inst) { ret->set_instance(inst); diff --git a/src/libs/client/PluginUI.hpp b/src/libs/client/PluginUI.hpp index fc14d5c9..d20dd16a 100644 --- a/src/libs/client/PluginUI.hpp +++ b/src/libs/client/PluginUI.hpp @@ -20,6 +20,7 @@ #include #include +#include "module/World.hpp" namespace Ingen { namespace Shared { class EngineInterface; } @@ -36,25 +37,23 @@ class PluginUI { public: ~PluginUI(); - static SharedPtr - create(SharedPtr engine, - SharedPtr node, - SLV2World world, - SLV2Plugin plugin); + static SharedPtr create(Ingen::Shared::World* world, + SharedPtr node, + SLV2Plugin plugin); - SharedPtr engine() { return _engine; } - SharedPtr node() { return _node; } - SLV2UIInstance instance() { return _instance; } + Ingen::Shared::World* world() const { return _world; } + SharedPtr node() const { return _node; } + SLV2UIInstance instance() const { return _instance; } private: - PluginUI(SharedPtr engine, - SharedPtr node); + PluginUI(Ingen::Shared::World* world, + SharedPtr node); void set_instance(SLV2UIInstance instance) { _instance = instance; } - SharedPtr _engine; - SharedPtr _node; - SLV2UIInstance _instance; + Ingen::Shared::World* _world; + SharedPtr _node; + SLV2UIInstance _instance; }; -- cgit v1.2.1