diff options
author | David Robillard <d@drobilla.net> | 2009-12-31 18:27:20 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-12-31 18:27:20 +0000 |
commit | 3dded8a655b6cad1925f160cb1012b8334e00c3e (patch) | |
tree | 5d743f58c6494ea7e5ed4010f9016c7d3c3f7665 /src/client/ClientStore.cpp | |
parent | c11b1bd6fe15f281c5e6b1ab2109590c17e739e9 (diff) | |
download | ingen-3dded8a655b6cad1925f160cb1012b8334e00c3e.tar.gz ingen-3dded8a655b6cad1925f160cb1012b8334e00c3e.tar.bz2 ingen-3dded8a655b6cad1925f160cb1012b8334e00c3e.zip |
Various fixes related to port values and metadata (fix ticket #459 among other things).
Fix jitterey behaviour of port controls (on module) while dragging.
Update value in status bar while dragging port slider (on module).
Update plugin data (e.g. port control range) if the plugin is sent to the
client after nodes that are instances of it (i.e. more robust plugin state
tracking via merging like with objects).
Correctly save and restore port values (ticket #459).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2327 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/client/ClientStore.cpp')
-rw-r--r-- | src/client/ClientStore.cpp | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index 74a0faad..64e84494 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -184,11 +184,13 @@ ClientStore::resource(const URI& uri) void ClientStore::add_plugin(SharedPtr<PluginModel> pm) { - // FIXME: dupes? merge, like with objects? - - (*_plugins)[pm->uri()] = pm; - signal_new_plugin(pm); - //cerr << "Plugin: " << pm->uri() << ", # plugins: " << _plugins->size() << endl; + SharedPtr<PluginModel> existing = this->plugin(pm->uri()); + if (existing) { + existing->set(pm); + } else { + _plugins->insert(make_pair(pm->uri(), pm)); + signal_new_plugin(pm); + } } @@ -300,15 +302,16 @@ ClientStore::put(const URI& uri, const Resource::Properties& properties) const Resource::Properties::const_iterator p = properties.find("rdf:instanceOf"); SharedPtr<PluginModel> plug; if (p->second.is_valid() && p->second.type() == Atom::URI) { - if ((plug = plugin(p->second.get_uri()))) { - SharedPtr<NodeModel> n(new NodeModel(plug, path)); - n->set_properties(properties); - add_object(n); - } else { - SharedPtr<NodeModel> n(new NodeModel(p->second.get_uri(), path)); - n->set_properties(properties); - add_object(n); + if (!(plug = plugin(p->second.get_uri()))) { + cout << "WARNING: Unable to find plugin " << p->second.get_uri() << endl; + plug = SharedPtr<PluginModel>( + new PluginModel(p->second.get_uri(), "ingen:nil", Resource::Properties())); + add_plugin(plug); } + + SharedPtr<NodeModel> n(new NodeModel(plug, path)); + n->set_properties(properties); + add_object(n); } else { cerr << "ERROR: Plugin with no type" << endl; } |