summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-04-22 02:07:08 +0000
committerDavid Robillard <d@drobilla.net>2012-04-22 02:07:08 +0000
commit6bef80f5e1bdf724a77ef989ce9a7205f426a378 (patch)
tree77d9ab0fed55cd34063a9e411615fe47effa9df6 /src
parent55316f80cbebdcae03c71b9ecd88706ed4133b50 (diff)
downloadingen-6bef80f5e1bdf724a77ef989ce9a7205f426a378.tar.gz
ingen-6bef80f5e1bdf724a77ef989ce9a7205f426a378.tar.bz2
ingen-6bef80f5e1bdf724a77ef989ce9a7205f426a378.zip
Show non-resizable plugin UIs properly.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4228 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/client/PluginUI.cpp28
-rw-r--r--src/gui/NodeModule.cpp3
2 files changed, 29 insertions, 2 deletions
diff --git a/src/client/PluginUI.cpp b/src/client/PluginUI.cpp
index 87f25d8f..ac54b2f5 100644
--- a/src/client/PluginUI.cpp
+++ b/src/client/PluginUI.cpp
@@ -22,6 +22,7 @@
#include "ingen/shared/LV2URIMap.hpp"
#include "ingen/shared/URIs.hpp"
#include "lv2/lv2plug.in/ns/ext/atom/atom.h"
+#include "lv2/lv2plug.in/ns/extensions/ui/ui.h"
using namespace std;
using namespace Raul;
@@ -75,16 +76,19 @@ lv2_ui_write(SuilController controller,
}
PluginUI::PluginUI(Ingen::Shared::World* world,
- SharedPtr<const NodeModel> node)
+ SharedPtr<const NodeModel> node,
+ const LilvNode* ui_node)
: _world(world)
, _node(node)
, _instance(NULL)
+ , _ui_node(lilv_node_duplicate(ui_node))
{
}
PluginUI::~PluginUI()
{
suil_instance_free(_instance);
+ lilv_node_free(_ui_node);
}
SharedPtr<PluginUI>
@@ -120,7 +124,7 @@ PluginUI::create(Ingen::Shared::World* world,
return SharedPtr<PluginUI>();
}
- SharedPtr<PluginUI> ret(new PluginUI(world, node));
+ SharedPtr<PluginUI> ret(new PluginUI(world, node, lilv_ui_get_uri(ui)));
ret->_features = world->lv2_features()->lv2_features(
world, const_cast<NodeModel*>(node.get()));
@@ -163,5 +167,25 @@ PluginUI::port_event(uint32_t port_index,
_instance, port_index, buffer_size, format, buffer);
}
+bool
+PluginUI::is_resizable() const
+{
+ const LilvNode* s = _ui_node;
+ LilvNode* p = lilv_new_uri(_world->lilv_world(), LV2_CORE__optionalFeature);
+ LilvNode* fs = lilv_new_uri(_world->lilv_world(), LV2_UI__fixedSize);
+ LilvNode* nrs = lilv_new_uri(_world->lilv_world(), LV2_UI__noUserResize);
+
+ LilvNodes* fs_matches = lilv_world_find_nodes(_world->lilv_world(), s, p, fs);
+ LilvNodes* nrs_matches = lilv_world_find_nodes(_world->lilv_world(), s, p, nrs);
+
+ lilv_nodes_free(nrs_matches);
+ lilv_nodes_free(fs_matches);
+ lilv_node_free(nrs);
+ lilv_node_free(fs);
+ lilv_node_free(p);
+
+ return !fs_matches && !nrs_matches;
+}
+
} // namespace Client
} // namespace Ingen
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp
index 9719ed67..b4820008 100644
--- a/src/gui/NodeModule.cpp
+++ b/src/gui/NodeModule.cpp
@@ -307,6 +307,9 @@ NodeModule::popup_gui()
_gui_widget = Glib::wrap(c_widget);
_gui_window = new Gtk::Window();
+ if (!_plugin_ui->is_resizable()) {
+ _gui_window->set_resizable(false);
+ }
_gui_window->set_title(_node->path().chop_scheme() + " UI - Ingen");
_gui_window->set_role("plugin_ui");
_gui_window->add(*_gui_widget);