diff options
author | David Robillard <d@drobilla.net> | 2015-04-03 17:10:58 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2015-04-03 17:10:58 +0000 |
commit | e1ea99192e10149e0cac7a93f98fbec20e7cedb2 (patch) | |
tree | 97d8d9e63b6d2085c2b49e71fc2183c8058b4533 /src/server/events | |
parent | ac888fe3cb4a7bdf0f43e9474160e3b525edf774 (diff) | |
download | ingen-e1ea99192e10149e0cac7a93f98fbec20e7cedb2.tar.gz ingen-e1ea99192e10149e0cac7a93f98fbec20e7cedb2.tar.bz2 ingen-e1ea99192e10149e0cac7a93f98fbec20e7cedb2.zip |
Use lv2:prototype and deprecate ingen:prototype.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5652 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/events')
-rw-r--r-- | src/server/events/CreateBlock.cpp | 18 | ||||
-rw-r--r-- | src/server/events/CreateGraph.cpp | 8 |
2 files changed, 21 insertions, 5 deletions
diff --git a/src/server/events/CreateBlock.cpp b/src/server/events/CreateBlock.cpp index e14a3356..3ea009a4 100644 --- a/src/server/events/CreateBlock.cpp +++ b/src/server/events/CreateBlock.cpp @@ -69,9 +69,20 @@ CreateBlock::pre_process() return Event::pre_process_done(Status::PARENT_NOT_FOUND, _path.parent()); } - // Get prototype URI - const iterator t = _properties.find(uris.ingen_prototype); + // Map old ingen:prototype to new lv2:prototype + auto range = _properties.equal_range(uris.ingen_prototype); + for (auto i = range.first; i != range.second;) { + const auto& value = i->second; + auto next = i; + next = _properties.erase(i); + _properties.insert(std::make_pair(uris.lv2_prototype, i->second)); + i = next; + } + + // Get prototype + iterator t = _properties.find(uris.lv2_prototype); if (t == _properties.end() || t->second.type() != uris.forge.URI) { + // Missing/invalid prototype return Event::pre_process_done(Status::BAD_REQUEST); } @@ -98,7 +109,8 @@ CreateBlock::pre_process() /* Replace prototype with the ancestor's. This is less informative, but the client expects an actual LV2 plugin as prototype. */ _properties.erase(uris.ingen_prototype); - _properties.insert(std::make_pair(uris.ingen_prototype, + _properties.erase(uris.lv2_prototype); + _properties.insert(std::make_pair(uris.lv2_prototype, uris.forge.alloc_uri(ancestor->plugin()->uri()))); } else { // Prototype is a plugin diff --git a/src/server/events/CreateGraph.cpp b/src/server/events/CreateGraph.cpp index 06445a6b..b9661a13 100644 --- a/src/server/events/CreateGraph.cpp +++ b/src/server/events/CreateGraph.cpp @@ -76,8 +76,12 @@ CreateGraph::pre_process() const Raul::Symbol symbol((_path.is_root()) ? "root" : _path.symbol()); - // Create graph based on prototype - const iterator t = _properties.find(uris.ingen_prototype); + // Get graph prototype + iterator t = _properties.find(uris.lv2_prototype); + if (t == _properties.end()) { + t = _properties.find(uris.lv2_prototype); + } + if (t != _properties.end() && Raul::URI::is_valid(t->second.ptr<char>()) && Node::uri_is_path(Raul::URI(t->second.ptr<char>()))) { |