From 76b602f1f834cb2c255848c5ba887b3d7c47171a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 14 Aug 2012 21:37:20 +0000 Subject: Replace use of old Raul Table stuff with std::map. Move most Store functionality into Ingen::Store and eliminate EngineStore. Much cleaner delete and move implementations. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4696 a436a847-0d15-0410-975c-d299462d15a1 --- src/server/events/CreatePort.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/server/events/CreatePort.cpp') diff --git a/src/server/events/CreatePort.cpp b/src/server/events/CreatePort.cpp index f45c200b..2782d654 100644 --- a/src/server/events/CreatePort.cpp +++ b/src/server/events/CreatePort.cpp @@ -16,6 +16,7 @@ #include +#include "ingen/Store.hpp" #include "ingen/URIMap.hpp" #include "ingen/URIs.hpp" #include "raul/Array.hpp" @@ -28,7 +29,6 @@ #include "Driver.hpp" #include "DuplexPort.hpp" #include "Engine.hpp" -#include "EngineStore.hpp" #include "PatchImpl.hpp" #include "PortImpl.hpp" @@ -93,14 +93,19 @@ CreatePort::pre_process() return Event::pre_process_done(BAD_URI, _path); } - if (_engine.engine_store()->find_object(_path)) { + if (_engine.store()->get(_path)) { return Event::pre_process_done(_status, _path); } - if (!(_patch = _engine.engine_store()->find_patch(_path.parent()))) { + GraphObject* parent = _engine.store()->get(_path.parent()); + if (!parent) { return Event::pre_process_done(PARENT_NOT_FOUND, _path.parent()); } + if (!(_patch = dynamic_cast(parent))) { + return Event::pre_process_done(INVALID_PARENT_PATH, _path.parent()); + } + const URIs& uris = _engine.world()->uris(); const BufferFactory& buffer_factory = *_engine.buffer_factory(); @@ -133,7 +138,7 @@ CreatePort::pre_process() _patch_port->properties().insert(_properties.begin(), _properties.end()); - _engine.engine_store()->add(_patch_port); + _engine.store()->add(_patch_port); if (_is_output) { _patch->add_output(new Raul::List::Node(_patch_port)); } else { -- cgit v1.2.1