diff options
author | David Robillard <d@drobilla.net> | 2012-08-12 15:56:21 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-08-12 15:56:21 +0000 |
commit | 21b1e2e485d9fa954ca742965d000f3273fcb862 (patch) | |
tree | 8f316c5adbf6d387d64ee895b862dae21614524a /src/server/events | |
parent | 65a81eec8943dc0504b8b8755f9866ee4993372c (diff) | |
download | ingen-21b1e2e485d9fa954ca742965d000f3273fcb862.tar.gz ingen-21b1e2e485d9fa954ca742965d000f3273fcb862.tar.bz2 ingen-21b1e2e485d9fa954ca742965d000f3273fcb862.zip |
Stricter symbol construction and conversion.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4670 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/events')
-rw-r--r-- | src/server/events/CreateNode.cpp | 6 | ||||
-rw-r--r-- | src/server/events/CreatePatch.cpp | 11 | ||||
-rw-r--r-- | src/server/events/CreatePort.cpp | 6 | ||||
-rw-r--r-- | src/server/events/Delete.cpp | 4 |
4 files changed, 17 insertions, 10 deletions
diff --git a/src/server/events/CreateNode.cpp b/src/server/events/CreateNode.cpp index f1b65fa3..27b5ce50 100644 --- a/src/server/events/CreateNode.cpp +++ b/src/server/events/CreateNode.cpp @@ -53,6 +53,10 @@ CreateNode::pre_process() typedef Resource::Properties::const_iterator iterator; + if (_path.is_root()) { + return Event::pre_process_done(BAD_URI, _path); + } + std::string plugin_uri; const iterator t = _properties.find(uris.ingen_prototype); if (t != _properties.end() && t->second.type() == uris.forge.URI) { @@ -81,7 +85,7 @@ CreateNode::pre_process() p->second.get_bool()); if (!(_node = plugin->instantiate(*_engine.buffer_factory(), - _path.symbol(), + Raul::Symbol(_path.symbol()), polyphonic, _patch, _engine))) { diff --git a/src/server/events/CreatePatch.cpp b/src/server/events/CreatePatch.cpp index b29ca667..0fe613ba 100644 --- a/src/server/events/CreatePatch.cpp +++ b/src/server/events/CreatePatch.cpp @@ -51,11 +51,9 @@ CreatePatch::pre_process() return Event::pre_process_done(EXISTS, _path); } - const Raul::Path& path = (const Raul::Path&)_path; - - _parent = _engine.engine_store()->find_patch(path.parent()); + _parent = _engine.engine_store()->find_patch(_path.parent()); if (!_parent) { - return Event::pre_process_done(PARENT_NOT_FOUND, path.parent()); + return Event::pre_process_done(PARENT_NOT_FOUND, _path.parent()); } const Ingen::URIs& uris = _engine.world()->uris(); @@ -70,14 +68,15 @@ CreatePatch::pre_process() } if (int_poly < 1 || int_poly > 128) { - return Event::pre_process_done(INVALID_POLY, path); + return Event::pre_process_done(INVALID_POLY, _path); } if (int_poly == _parent->internal_poly()) { ext_poly = int_poly; } - _patch = new PatchImpl(_engine, path.symbol(), ext_poly, _parent, + const Raul::Symbol symbol((_path.is_root()) ? "root" : _path.symbol()); + _patch = new PatchImpl(_engine, symbol, ext_poly, _parent, _engine.driver()->sample_rate(), int_poly); _patch->properties().insert(_properties.begin(), _properties.end()); _patch->add_property(uris.rdf_type, uris.ingen_Patch); diff --git a/src/server/events/CreatePort.cpp b/src/server/events/CreatePort.cpp index c156c13a..df9ebb6e 100644 --- a/src/server/events/CreatePort.cpp +++ b/src/server/events/CreatePort.cpp @@ -88,6 +88,10 @@ CreatePort::pre_process() if (_port_type == PortType::UNKNOWN) { return Event::pre_process_done(UNKNOWN_TYPE, _path); } + + if (_path.is_root()) { + return Event::pre_process_done(BAD_URI, _path); + } if (_engine.engine_store()->find_object(_path)) { return Event::pre_process_done(_status, _path); @@ -122,7 +126,7 @@ CreatePort::pre_process() poly_i->second.get_bool()); if (!(_patch_port = _patch->create_port( - *_engine.buffer_factory(), _path.symbol(), + *_engine.buffer_factory(), Raul::Symbol(_path.symbol()), _port_type, _buf_type, buf_size, _is_output, polyphonic))) { return Event::pre_process_done(CREATION_FAILED, _path); } diff --git a/src/server/events/Delete.cpp b/src/server/events/Delete.cpp index b16a1f8d..5a88de9f 100644 --- a/src/server/events/Delete.cpp +++ b/src/server/events/Delete.cpp @@ -87,7 +87,7 @@ Delete::pre_process() if (_node && !_path.is_root()) { assert(_node->parent_patch()); - _patch_node_listnode = _node->parent_patch()->remove_node(_path.symbol()); + _patch_node_listnode = _node->parent_patch()->remove_node(Raul::Symbol(_path.symbol())); if (_patch_node_listnode) { assert(_patch_node_listnode->elem() == _node.get()); @@ -100,7 +100,7 @@ Delete::pre_process() } } else if (_port) { assert(_port->parent_patch()); - _patch_port_listnode = _port->parent_patch()->remove_port(_path.symbol()); + _patch_port_listnode = _port->parent_patch()->remove_port(Raul::Symbol(_path.symbol())); if (_patch_port_listnode) { assert(_patch_port_listnode->elem() == _port.get()); |