diff options
author | David Robillard <d@drobilla.net> | 2010-02-13 22:07:26 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-02-13 22:07:26 +0000 |
commit | ad07c414d557629251b2f4ea4078c22f241cc865 (patch) | |
tree | dafecc5dd8758e0273105bb2a2a8d481509d19fb /src/client/ClientStore.cpp | |
parent | b8cf49d04a2600f83767ddda46929d4d47adc3fd (diff) | |
download | ingen-ad07c414d557629251b2f4ea4078c22f241cc865.tar.gz ingen-ad07c414d557629251b2f4ea4078c22f241cc865.tar.bz2 ingen-ad07c414d557629251b2f4ea4078c22f241cc865.zip |
Learn and remove bindings exclusively through property interface.
Note this commit breaks some aspects of OSC and HTTP control for now.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2442 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/client/ClientStore.cpp')
-rw-r--r-- | src/client/ClientStore.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index e5fbab6a..cf05e599 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -48,6 +48,7 @@ ClientStore::ClientStore(SharedPtr<EngineInterface> engine, SharedPtr<SigClientI emitter->signal_object_deleted.connect(sigc::mem_fun(this, &ClientStore::del)); emitter->signal_object_moved.connect(sigc::mem_fun(this, &ClientStore::move)); emitter->signal_put.connect(sigc::mem_fun(this, &ClientStore::put)); + emitter->signal_delta.connect(sigc::mem_fun(this, &ClientStore::delta)); emitter->signal_connection.connect(sigc::mem_fun(this, &ClientStore::connect)); emitter->signal_disconnection.connect(sigc::mem_fun(this, &ClientStore::disconnect)); emitter->signal_property_change.connect(sigc::mem_fun(this, &ClientStore::set_property)); @@ -338,6 +339,28 @@ ClientStore::put(const URI& uri, const Resource::Properties& properties) void +ClientStore::delta(const URI& uri, const Resource::Properties& remove, const Resource::Properties& add) +{ + bool is_meta = ResourceImpl::is_meta_uri(uri); + string path_str = is_meta ? (string("/") + uri.chop_start("#")) : uri.str(); + if (!Path::is_valid(path_str)) { + LOG(error) << "Bad path: " << uri.str() << " - " << path_str << endl; + return; + } + + Path path(is_meta ? (string("/") + uri.chop_start("#")) : uri.str()); + + SharedPtr<ObjectModel> obj = object(path); + if (obj) { + obj->remove_properties(remove); + obj->add_properties(add); + } else { + LOG(warn) << "Failed to find object `" << path << "'" << endl; + } +} + + +void ClientStore::set_property(const URI& subject_uri, const URI& predicate, const Atom& value) { SharedPtr<Resource> subject = resource(subject_uri); |