From 46b2e1598ed75319735893ed039ac669aca2d8a7 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 28 May 2009 14:33:33 +0000 Subject: Make SetMetadataEvent do multiple properties at once. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2019 a436a847-0d15-0410-975c-d299462d15a1 --- src/client/ClientStore.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'src/client/ClientStore.cpp') diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index 7774e9c3..12bbdaf9 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -104,6 +104,14 @@ ClientStore::add_object(SharedPtr object) } + for (Resource::Properties::const_iterator i = object->meta().properties().begin(); + i != object->meta().properties().end(); ++i) + object->signal_property(i->first, i->second); + + for (Resource::Properties::const_iterator i = object->properties().begin(); + i != object->properties().end(); ++i) + object->signal_property(i->first, i->second); + /*cout << "[Store] Added " << object->path() << " {" << endl; for (iterator i = begin(); i != end(); ++i) { cout << "\t" << i->first << endl; @@ -279,6 +287,12 @@ ClientStore::put(const URI& uri, const Resource::Properties& properties) cerr << "\t" << i->first << " = " << i->second << " :: " << i->second.type() << endl; cerr << "}" << endl; + SharedPtr obj = PtrCast(object(path)); + if (obj) { + cerr << "OBJECT EXISTS " << path << endl; + obj->set_properties(properties); + } + bool is_patch, is_node, is_port, is_output; DataType data_type(DataType::UNKNOWN); ResourceImpl::type(properties, is_patch, is_node, is_port, is_output, data_type); @@ -289,7 +303,7 @@ ClientStore::put(const URI& uri, const Resource::Properties& properties) if (p != properties.end() && p->second.is_valid() && p->second.type() == Atom::INT) poly = p->second.get_int32(); SharedPtr model(new PatchModel(path, poly)); - model->merge_properties(properties); + model->set_properties(properties); add_object(model); } else if (is_node) { const Resource::Properties::const_iterator p = properties.find("rdf:instanceOf"); @@ -297,11 +311,11 @@ ClientStore::put(const URI& uri, const Resource::Properties& properties) if (p->second.is_valid() && p->second.type() == Atom::URI) { if ((plug = plugin(p->second.get_uri()))) { SharedPtr n(new NodeModel(plug, path)); - n->merge_properties(properties); + n->set_properties(properties); add_object(n); } else { SharedPtr n(new NodeModel(p->second.get_uri(), path)); - n->merge_properties(properties); + n->set_properties(properties); //add_plugin_orphan(n); add_object(n); } @@ -312,7 +326,7 @@ ClientStore::put(const URI& uri, const Resource::Properties& properties) if (data_type != DataType::UNKNOWN) { PortModel::Direction pdir = is_output ? PortModel::OUTPUT : PortModel::INPUT; SharedPtr p(new PortModel(path, 0, data_type, pdir)); - p->merge_properties(properties); + p->set_properties(properties); add_object(p); } else { cerr << "WARNING: Illegal port " << path << endl; -- cgit v1.2.1