summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-11-18 00:05:31 +0000
committerDavid Robillard <d@drobilla.net>2012-11-18 00:05:31 +0000
commitb4718b5cc8334489a1eb50df9db920bc0b01375c (patch)
treea082532a4d958c77217244b28c36bc764e71b564
parentd04ce4cb7d4aa3eb72bc79c09dfe5bb025ad79f4 (diff)
downloadingen-b4718b5cc8334489a1eb50df9db920bc0b01375c.tar.gz
ingen-b4718b5cc8334489a1eb50df9db920bc0b01375c.tar.bz2
ingen-b4718b5cc8334489a1eb50df9db920bc0b01375c.zip
Fix Plugin=>UI ring overflow handling.
Gracefully handle client receiving nodes with as-yet unknown plugins. Don't initially send all plugins to UI (kills LV2 in particular), request on demand instead. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4829 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/client/ClientStore.cpp2
-rw-r--r--src/client/PluginModel.cpp7
-rw-r--r--src/gui/App.cpp10
-rw-r--r--src/gui/App.hpp3
-rw-r--r--src/gui/GraphCanvas.cpp2
-rw-r--r--src/gui/WindowFactory.cpp2
-rw-r--r--src/gui/ingen_gui_lv2.cpp3
-rw-r--r--src/server/LV2Block.cpp4
-rw-r--r--src/server/ingen_lv2.cpp5
9 files changed, 27 insertions, 11 deletions
diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp
index 71e28c09..fe79336b 100644
--- a/src/client/ClientStore.cpp
+++ b/src/client/ClientStore.cpp
@@ -270,8 +270,6 @@ ClientStore::put(const Raul::URI& uri,
SharedPtr<PluginModel> plug;
if (p->second.is_valid() && p->second.type() == _uris.forge.URI) {
if (!(plug = _plugin(Raul::URI(p->second.get_uri())))) {
- _log.warn(Raul::fmt("Unable to find plugin <%1%>\n")
- % p->second.get_uri());
plug = SharedPtr<PluginModel>(
new PluginModel(uris(),
Raul::URI(p->second.get_uri()),
diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp
index 70713274..87d1aa92 100644
--- a/src/client/PluginModel.cpp
+++ b/src/client/PluginModel.cpp
@@ -47,6 +47,13 @@ PluginModel::PluginModel(URIs& uris,
: Plugin(uris, uri)
, _type(type_from_uri(type_uri))
{
+ if (_type == NIL) {
+ if (uri.find("ingen-internals") != string::npos) {
+ _type = Internal;
+ } else {
+ _type = LV2; // Assume LV2 and hope Lilv can tell us something
+ }
+ }
add_properties(properties);
assert(_rdf_world);
diff --git a/src/gui/App.cpp b/src/gui/App.cpp
index 96bb1254..4174fbac 100644
--- a/src/gui/App.cpp
+++ b/src/gui/App.cpp
@@ -72,6 +72,7 @@ App::App(Ingen::World* world)
, _world(world)
, _sample_rate(48000)
, _enable_signal(true)
+ , _requested_plugins(false)
{
Glib::set_application_name("Ingen");
gtk_window_set_default_icon_name("ingen");
@@ -187,6 +188,15 @@ App::detach()
}
}
+void
+App::request_plugins_if_necessary()
+{
+ if (!_requested_plugins) {
+ _world->interface()->get(Raul::URI("ingen:plugins"));
+ _requested_plugins = true;
+ }
+}
+
SharedPtr<Serialisation::Serialiser>
App::serialiser()
{
diff --git a/src/gui/App.hpp b/src/gui/App.hpp
index ac909b2f..8cf2b61e 100644
--- a/src/gui/App.hpp
+++ b/src/gui/App.hpp
@@ -78,6 +78,8 @@ public:
void detach();
+ void request_plugins_if_necessary();
+
void register_callbacks();
bool gtk_main_iteration();
@@ -170,6 +172,7 @@ protected:
ActivityPorts _activity_ports;
bool _enable_signal;
+ bool _requested_plugins;
};
} // namespace GUI
diff --git a/src/gui/GraphCanvas.cpp b/src/gui/GraphCanvas.cpp
index d6c4d01b..4eba15db 100644
--- a/src/gui/GraphCanvas.cpp
+++ b/src/gui/GraphCanvas.cpp
@@ -151,6 +151,8 @@ GraphCanvas::GraphCanvas(App& app,
void
GraphCanvas::show_menu(bool position, unsigned button, uint32_t time)
{
+ _app.request_plugins_if_necessary();
+
if (!_internal_menu)
build_menus();
diff --git a/src/gui/WindowFactory.cpp b/src/gui/WindowFactory.cpp
index 717f1f63..57a21536 100644
--- a/src/gui/WindowFactory.cpp
+++ b/src/gui/WindowFactory.cpp
@@ -191,6 +191,8 @@ void
WindowFactory::present_load_plugin(SharedPtr<const GraphModel> graph,
Node::Properties data)
{
+ _app.request_plugins_if_necessary();
+
GraphWindowMap::iterator w = _graph_windows.find(graph->path());
if (w != _graph_windows.end())
diff --git a/src/gui/ingen_gui_lv2.cpp b/src/gui/ingen_gui_lv2.cpp
index 49795a83..40f37dc7 100644
--- a/src/gui/ingen_gui_lv2.cpp
+++ b/src/gui/ingen_gui_lv2.cpp
@@ -132,9 +132,6 @@ instantiate(const LV2UI_Descriptor* descriptor,
ui->world->forge(),
*ui->client.get()));
- // Request plugins
- ui->world->interface()->get(Raul::URI("ingen:plugins"));
-
// Create empty root graph model
Ingen::Resource::Properties props;
props.insert(std::make_pair(ui->app->uris().rdf_type,
diff --git a/src/server/LV2Block.cpp b/src/server/LV2Block.cpp
index d63f9ae7..47a0af4f 100644
--- a/src/server/LV2Block.cpp
+++ b/src/server/LV2Block.cpp
@@ -307,10 +307,6 @@ LV2Block::instantiate(BufferFactory& bufs)
}
}
lilv_nodes_free(sizes);
-
- bufs.engine().log().info(
- Raul::fmt("Atom port %1% buffer size %2%\n")
- % path().c_str() % port_buffer_size);
}
enum { UNKNOWN, INPUT, OUTPUT } direction = UNKNOWN;
diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp
index fcada858..f64e9c45 100644
--- a/src/server/ingen_lv2.cpp
+++ b/src/server/ingen_lv2.cpp
@@ -337,7 +337,6 @@ public:
}
if (seq->atom.size + sizeof(LV2_Atom) + atom.size > _notify_capacity) {
- std::cerr << "Notify overflow" << std::endl;
break; // Output port buffer full, resume next time
}
@@ -357,7 +356,9 @@ public:
seq->atom.size += sizeof(LV2_Atom_Event) + ev->body.size;
}
- _to_ui_overflow_sem.post();
+ if (_to_ui_overflow) {
+ _to_ui_overflow_sem.post();
+ }
}
virtual SampleCount block_length() const { return _block_length; }