From 2b189b5979fed3f52a1bea082201a892d00aa38c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 15 Aug 2008 03:30:10 +0000 Subject: Make refresh more complete. git-svn-id: http://svn.drobilla.net/lad/ingen@1389 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/client/NodeModel.cpp | 10 ++++++++++ src/libs/client/NodeModel.hpp | 1 + src/libs/client/ObjectModel.hpp | 2 +- src/libs/client/PortModel.cpp | 13 +++++++++++++ src/libs/client/PortModel.hpp | 2 ++ src/libs/client/Store.cpp | 4 ++++ src/libs/serialisation/Serialiser.cpp | 2 +- 7 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/libs/client/NodeModel.cpp b/src/libs/client/NodeModel.cpp index 7cee66f9..4e81d6dd 100644 --- a/src/libs/client/NodeModel.cpp +++ b/src/libs/client/NodeModel.cpp @@ -192,6 +192,16 @@ NodeModel::port_value_range(SharedPtr port, float& min, float& max) max = max_atom.get_float(); } + +void +NodeModel::set(SharedPtr model) +{ + SharedPtr node = PtrCast(model); + if (node) + _plugin = node->_plugin; + + ObjectModel::set(model); +} } // namespace Client diff --git a/src/libs/client/NodeModel.hpp b/src/libs/client/NodeModel.hpp index 72665e66..700027b6 100644 --- a/src/libs/client/NodeModel.hpp +++ b/src/libs/client/NodeModel.hpp @@ -79,6 +79,7 @@ protected: void remove_port(const Path& port_path); void add_program(int bank, int program, const string& name); void remove_program(int bank, int program); + void set(SharedPtr model); virtual void clear(); diff --git a/src/libs/client/ObjectModel.hpp b/src/libs/client/ObjectModel.hpp index 61ac62bb..5655222f 100644 --- a/src/libs/client/ObjectModel.hpp +++ b/src/libs/client/ObjectModel.hpp @@ -97,7 +97,7 @@ protected: void add_variable(const Variables& data); void set_polyphonic(bool); - void set(SharedPtr model); + virtual void set(SharedPtr model); Store& _store; Path _path; diff --git a/src/libs/client/PortModel.cpp b/src/libs/client/PortModel.cpp index ecf1070b..fa3cb345 100644 --- a/src/libs/client/PortModel.cpp +++ b/src/libs/client/PortModel.cpp @@ -45,5 +45,18 @@ PortModel::is_toggle() const return (hint.is_valid() && hint.get_bool() > 0); } + +void +PortModel::set(SharedPtr model) +{ + SharedPtr port = PtrCast(model); + if (port) { + _current_val = port->_current_val; + signal_value_changed.emit(_current_val); + } + + ObjectModel::set(model); +} + } // namespace Client } // namespace Ingen diff --git a/src/libs/client/PortModel.hpp b/src/libs/client/PortModel.hpp index 759b8c1e..a452c338 100644 --- a/src/libs/client/PortModel.hpp +++ b/src/libs/client/PortModel.hpp @@ -91,6 +91,8 @@ private: void connected_to(SharedPtr p) { ++_connections; signal_connection.emit(p); } void disconnected_from(SharedPtr p) { --_connections; signal_disconnection.emit(p); } + void set(SharedPtr model); + uint32_t _index; DataType _type; Direction _direction; diff --git a/src/libs/client/Store.cpp b/src/libs/client/Store.cpp index 53b99f8d..6bb3b767 100644 --- a/src/libs/client/Store.cpp +++ b/src/libs/client/Store.cpp @@ -93,11 +93,13 @@ Store::resolve_plugin_orphans(SharedPtr plugin) if (n != _plugin_orphans.end()) { list > spawn = n->second; // take a copy + cerr << "Missing dependant " << plugin->uri() << " received" << endl; _plugin_orphans.erase(plugin->uri()); // prevent infinite recursion for (list >::iterator i = spawn.begin(); i != spawn.end(); ++i) { + (*i)->_plugin = plugin; add_object(*i); } } @@ -126,6 +128,7 @@ Store::resolve_connection_orphans(SharedPtr port) ++next; if (c->first == port->path() || c->second == port->path()) { + cerr << "Missing dependant (" << c->first << " -> " << c->second << ") received" << endl; bool success = attempt_connection(c->first, c->second); if (success) _connection_orphans.erase(c); @@ -185,6 +188,7 @@ Store::resolve_variable_orphans(SharedPtr subject) list > values = v->second; // take a copy _variable_orphans.erase(subject->path()); + cerr << "Missing dependant " << subject->path() << " received" << endl; for (list >::iterator i = values.begin(); i != values.end(); ++i) { diff --git a/src/libs/serialisation/Serialiser.cpp b/src/libs/serialisation/Serialiser.cpp index c4341069..5deb17e9 100644 --- a/src/libs/serialisation/Serialiser.cpp +++ b/src/libs/serialisation/Serialiser.cpp @@ -278,7 +278,7 @@ Serialiser::serialise_patch(SharedPtr patch) "rdf:type", Redland::Node(_model->world(), Redland::Node::RESOURCE, "http://drobilla.net/ns/ingen#Patch")); - if (patch->path().name().length() > 0) { + if (patch->path() != "/") { _model->add_statement( patch_id, "ingen:symbol", Redland::Node(_model->world(), Redland::Node::LITERAL, patch->path().name())); -- cgit v1.2.1