diff options
Diffstat (limited to 'src/server')
-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>()))) { |