summaryrefslogtreecommitdiffstats
path: root/src/engine/QueuedEngineInterface.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-02-19 05:10:29 +0000
committerDavid Robillard <d@drobilla.net>2011-02-19 05:10:29 +0000
commit6b18de71d1c603255b263a64434005306f152f13 (patch)
tree09c6e87acca1fe76bc74b3b549fee7ad09751993 /src/engine/QueuedEngineInterface.cpp
parent8e07e115429a0869593d4f29dc3e6cf5c8b25049 (diff)
downloadingen-6b18de71d1c603255b263a64434005306f152f13.tar.gz
ingen-6b18de71d1c603255b263a64434005306f152f13.tar.bz2
ingen-6b18de71d1c603255b263a64434005306f152f13.zip
Save/load patches as nested bundles (fix ticket #520).
Sane (context-based, ala RDF quads) approach to the problem of externally visible / internally visible properties. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2993 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/QueuedEngineInterface.cpp')
-rw-r--r--src/engine/QueuedEngineInterface.cpp28
1 files changed, 7 insertions, 21 deletions
diff --git a/src/engine/QueuedEngineInterface.cpp b/src/engine/QueuedEngineInterface.cpp
index 3984ca39..c1051c0a 100644
--- a/src/engine/QueuedEngineInterface.cpp
+++ b/src/engine/QueuedEngineInterface.cpp
@@ -157,13 +157,11 @@ QueuedEngineInterface::bundle_end()
void
-QueuedEngineInterface::put(const URI& uri,
- const Resource::Properties& properties)
+QueuedEngineInterface::put(const URI& uri,
+ const Resource::Properties& properties,
+ const Shared::Resource::Graph ctx)
{
- bool meta = ResourceImpl::is_meta_uri(uri);
- URI subject(meta ? (string("path:/") + uri.substr(6)) : uri.str());
-
- push_queued(new Events::SetMetadata(_engine, _request, now(), true, meta, subject, properties));
+ push_queued(new Events::SetMetadata(_engine, _request, now(), true, ctx, uri, properties));
}
@@ -172,10 +170,7 @@ QueuedEngineInterface::delta(const URI& uri,
const Shared::Resource::Properties& remove,
const Shared::Resource::Properties& add)
{
- bool meta = ResourceImpl::is_meta_uri(uri);
- URI subject(meta ? (string("path:/") + uri.substr(6)) : uri.str());
-
- push_queued(new Events::SetMetadata(_engine, _request, now(), false, meta, subject, add, remove));
+ push_queued(new Events::SetMetadata(_engine, _request, now(), false, Resource::DEFAULT, uri, add, remove));
}
@@ -224,14 +219,11 @@ QueuedEngineInterface::set_property(const URI& uri,
const URI& predicate,
const Atom& value)
{
- size_t hash = uri.find("#");
- bool meta = (hash != string::npos);
- Path path = meta ? (string("/") + path.chop_start("/")) : uri.str();
Resource::Properties remove;
remove.insert(make_pair(predicate, _engine.world()->uris()->wildcard));
Resource::Properties add;
add.insert(make_pair(predicate, value));
- push_queued(new Events::SetMetadata(_engine, _request, now(), false, meta, path, add, remove));
+ push_queued(new Events::SetMetadata(_engine, _request, now(), false, Resource::DEFAULT, uri, add, remove));
}
// Requests //
@@ -257,13 +249,7 @@ QueuedEngineInterface::get(const URI& uri)
void
QueuedEngineInterface::request_property(const URI& uri, const URI& key)
{
- size_t hash = uri.find("#");
- bool meta = (hash != string::npos);
- const string path_str = string("/") + uri.chop_start("/");
- if (meta && Path::is_valid(path_str))
- push_queued(new Events::RequestMetadata(_engine, _request, now(), meta, path_str, key));
- else
- push_queued(new Events::RequestMetadata(_engine, _request, now(), meta, uri, key));
+ push_queued(new Events::RequestMetadata(_engine, _request, now(), Resource::DEFAULT, uri, key));
}