diff options
author | David Robillard <d@drobilla.net> | 2011-02-22 07:04:37 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-02-22 07:04:37 +0000 |
commit | f53f07d814a4924c63c80af44553cd952a40d82c (patch) | |
tree | e6fe093a382cbd78a3b049ed686f9f17243d98e3 /src/client | |
parent | ee2d096d7160ea4426b060626392ce7a451e1d1e (diff) | |
download | ingen-f53f07d814a4924c63c80af44553cd952a40d82c.tar.gz ingen-f53f07d814a4924c63c80af44553cd952a40d82c.tar.bz2 ingen-f53f07d814a4924c63c80af44553cd952a40d82c.zip |
Better PluginUI abstraction.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3007 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/PluginUI.cpp | 21 | ||||
-rw-r--r-- | src/client/PluginUI.hpp | 15 |
2 files changed, 30 insertions, 6 deletions
diff --git a/src/client/PluginUI.cpp b/src/client/PluginUI.cpp index 5d21ea7e..9cdfa1b3 100644 --- a/src/client/PluginUI.cpp +++ b/src/client/PluginUI.cpp @@ -154,7 +154,7 @@ PluginUI::create(Ingen::Shared::World* world, plugin, ui, lv2_ui_write, ret.get(), ret->_features->array()); if (inst) { - ret->set_instance(inst); + ret->_instance = inst; } else { error << "Failed to instantiate Plugin UI" << endl; ret = SharedPtr<PluginUI>(); @@ -165,6 +165,25 @@ PluginUI::create(Ingen::Shared::World* world, return ret; } +LV2UI_Widget +PluginUI::get_widget() +{ + return (LV2UI_Widget*)slv2_ui_instance_get_widget(_instance); +} + +void +PluginUI::port_event(uint32_t port_index, + uint32_t buffer_size, + uint32_t format, + const void* buffer) +{ + const LV2UI_Descriptor* ui_desc = slv2_ui_instance_get_descriptor(_instance); + LV2UI_Handle ui = slv2_ui_instance_get_handle(_instance); + + if (ui_desc->port_event) { + ui_desc->port_event(ui, port_index, buffer_size, 0, buffer); + } +} } // namespace Client } // namespace Ingen diff --git a/src/client/PluginUI.hpp b/src/client/PluginUI.hpp index 312e69d5..bf60dcfa 100644 --- a/src/client/PluginUI.hpp +++ b/src/client/PluginUI.hpp @@ -43,16 +43,21 @@ public: SharedPtr<NodeModel> node, SLV2Plugin plugin); - Ingen::Shared::World* world() const { return _world; } - SharedPtr<NodeModel> node() const { return _node; } - SLV2UIInstance instance() const { return _instance; } + LV2UI_Widget get_widget(); + + void port_event(uint32_t port_index, + uint32_t buffer_size, + uint32_t format, + const void* buffer); + + + Ingen::Shared::World* world() const { return _world; } + SharedPtr<NodeModel> node() const { return _node; } private: PluginUI(Ingen::Shared::World* world, SharedPtr<NodeModel> node); - void set_instance(SLV2UIInstance instance) { _instance = instance; } - Ingen::Shared::World* _world; SharedPtr<NodeModel> _node; SLV2UIInstance _instance; |