diff options
author | David Robillard <d@drobilla.net> | 2008-08-15 03:30:10 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-08-15 03:30:10 +0000 |
commit | 2b189b5979fed3f52a1bea082201a892d00aa38c (patch) | |
tree | 5b14a1b91fc228fa1aaa711378804d0d4a6ced3d /src | |
parent | 25c796a6f64038d47140a2023f25cfbe1b2fdd37 (diff) | |
download | ingen-2b189b5979fed3f52a1bea082201a892d00aa38c.tar.gz ingen-2b189b5979fed3f52a1bea082201a892d00aa38c.tar.bz2 ingen-2b189b5979fed3f52a1bea082201a892d00aa38c.zip |
Make refresh more complete.
git-svn-id: http://svn.drobilla.net/lad/ingen@1389 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/libs/client/NodeModel.cpp | 10 | ||||
-rw-r--r-- | src/libs/client/NodeModel.hpp | 1 | ||||
-rw-r--r-- | src/libs/client/ObjectModel.hpp | 2 | ||||
-rw-r--r-- | src/libs/client/PortModel.cpp | 13 | ||||
-rw-r--r-- | src/libs/client/PortModel.hpp | 2 | ||||
-rw-r--r-- | src/libs/client/Store.cpp | 4 | ||||
-rw-r--r-- | 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<PortModel> port, float& min, float& max) max = max_atom.get_float(); } + +void +NodeModel::set(SharedPtr<ObjectModel> model) +{ + SharedPtr<NodeModel> node = PtrCast<NodeModel>(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<ObjectModel> 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<ObjectModel> model); + virtual void set(SharedPtr<ObjectModel> 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<ObjectModel> model) +{ + SharedPtr<PortModel> port = PtrCast<PortModel>(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<PortModel> p) { ++_connections; signal_connection.emit(p); } void disconnected_from(SharedPtr<PortModel> p) { --_connections; signal_disconnection.emit(p); } + void set(SharedPtr<ObjectModel> 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<PluginModel> plugin) if (n != _plugin_orphans.end()) { list<SharedPtr<NodeModel> > spawn = n->second; // take a copy + cerr << "Missing dependant " << plugin->uri() << " received" << endl; _plugin_orphans.erase(plugin->uri()); // prevent infinite recursion for (list<SharedPtr<NodeModel> >::iterator i = spawn.begin(); i != spawn.end(); ++i) { + (*i)->_plugin = plugin; add_object(*i); } } @@ -126,6 +128,7 @@ Store::resolve_connection_orphans(SharedPtr<PortModel> 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<ObjectModel> subject) list<std::pair<string, Atom> > values = v->second; // take a copy _variable_orphans.erase(subject->path()); + cerr << "Missing dependant " << subject->path() << " received" << endl; for (list<std::pair<string, Atom> >::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<Shared::Patch> 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())); |