summaryrefslogtreecommitdiffstats
path: root/src/server/events/Connect.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-08-14 21:37:20 +0000
committerDavid Robillard <d@drobilla.net>2012-08-14 21:37:20 +0000
commit76b602f1f834cb2c255848c5ba887b3d7c47171a (patch)
treecbe6588c70f2df4384231d9cbdfd06fb0aa7e45f /src/server/events/Connect.cpp
parenta8312be2d849b73ff0acc80a226095bcfee3556c (diff)
downloadingen-76b602f1f834cb2c255848c5ba887b3d7c47171a.tar.gz
ingen-76b602f1f834cb2c255848c5ba887b3d7c47171a.tar.bz2
ingen-76b602f1f834cb2c255848c5ba887b3d7c47171a.zip
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
Diffstat (limited to 'src/server/events/Connect.cpp')
-rw-r--r--src/server/events/Connect.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/server/events/Connect.cpp b/src/server/events/Connect.cpp
index 17b66192..f3a736ad 100644
--- a/src/server/events/Connect.cpp
+++ b/src/server/events/Connect.cpp
@@ -16,6 +16,7 @@
#include <glibmm/thread.h>
+#include "ingen/Store.hpp"
#include "raul/Maid.hpp"
#include "raul/Path.hpp"
@@ -23,7 +24,6 @@
#include "Connect.hpp"
#include "EdgeImpl.hpp"
#include "Engine.hpp"
-#include "EngineStore.hpp"
#include "InputPort.hpp"
#include "OutputPort.hpp"
#include "PatchImpl.hpp"
@@ -52,24 +52,26 @@ Connect::Connect(Engine& engine,
bool
Connect::pre_process()
{
- Glib::RWLock::ReaderLock rlock(_engine.engine_store()->lock());
+ Glib::RWLock::ReaderLock rlock(_engine.store()->lock());
- PortImpl* tail = _engine.engine_store()->find_port(_tail_path);
- PortImpl* head = _engine.engine_store()->find_port(_head_path);
+ GraphObject* tail = _engine.store()->get(_tail_path);
if (!tail) {
- return Event::pre_process_done(PORT_NOT_FOUND, _tail_path);
- } else if (!head) {
- return Event::pre_process_done(PORT_NOT_FOUND, _head_path);
+ return Event::pre_process_done(NOT_FOUND, _tail_path);
+ }
+
+ GraphObject* head = _engine.store()->get(_head_path);
+ if (!head) {
+ return Event::pre_process_done(NOT_FOUND, _head_path);
}
OutputPort* tail_output = dynamic_cast<OutputPort*>(tail);
_head = dynamic_cast<InputPort*>(head);
if (!tail_output || !_head) {
- return Event::pre_process_done(DIRECTION_MISMATCH, _head_path);
+ return Event::pre_process_done(BAD_REQUEST, _head_path);
}
- NodeImpl* const tail_node = tail->parent_node();
- NodeImpl* const head_node = head->parent_node();
+ NodeImpl* const tail_node = tail_output->parent_node();
+ NodeImpl* const head_node = _head->parent_node();
if (!tail_node || !head_node) {
return Event::pre_process_done(PARENT_NOT_FOUND, _head_path);
}
@@ -109,7 +111,7 @@ Connect::pre_process()
rlock.release();
{
- Glib::RWLock::ReaderLock wlock(_engine.engine_store()->lock());
+ Glib::RWLock::ReaderLock wlock(_engine.store()->lock());
/* Need to be careful about patch port edges here and adding a
node's parent as a dependant/provider, or adding a patch as its own