summaryrefslogtreecommitdiffstats
path: root/src/engine/events/ConnectionEvent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/events/ConnectionEvent.cpp')
-rw-r--r--src/engine/events/ConnectionEvent.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/engine/events/ConnectionEvent.cpp b/src/engine/events/ConnectionEvent.cpp
index 6a55f35b..ef5d5d00 100644
--- a/src/engine/events/ConnectionEvent.cpp
+++ b/src/engine/events/ConnectionEvent.cpp
@@ -1,15 +1,15 @@
/* This file is part of Ingen.
* Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *
+ *
* Ingen is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later
* version.
- *
+ *
* Ingen is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
- *
+ *
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
@@ -64,10 +64,10 @@ ConnectionEvent::pre_process()
QueuedEvent::pre_process();
return;
}
-
+
_src_port = _engine.engine_store()->find_port(_src_port_path);
_dst_port = _engine.engine_store()->find_port(_dst_port_path);
-
+
if (_src_port == NULL || _dst_port == NULL) {
_error = PORT_NOT_FOUND;
QueuedEvent::pre_process();
@@ -81,10 +81,10 @@ ConnectionEvent::pre_process()
QueuedEvent::pre_process();
return;
}
-
+
_dst_input_port = dynamic_cast<InputPort*>(_dst_port);
_src_output_port = dynamic_cast<OutputPort*>(_src_port);
-
+
if (!_dst_input_port || !_src_output_port) {
_error = DIRECTION_MISMATCH;
QueuedEvent::pre_process();
@@ -102,18 +102,18 @@ ConnectionEvent::pre_process()
_patch = dynamic_cast<PatchImpl*>(dst_node);
else
_patch = dynamic_cast<PatchImpl*>(src_node);
-
+
// Connection from a patch input to a patch output (pass through)
} else if (src_node == dst_node && dynamic_cast<PatchImpl*>(src_node)) {
_patch = dynamic_cast<PatchImpl*>(src_node);
-
+
// Normal connection between nodes with the same parent
} else {
_patch = src_node->parent_patch();
}
assert(_patch);
-
+
if (_patch->has_connection(_src_output_port, _dst_input_port)) {
_error = ALREADY_CONNECTED;
QueuedEvent::pre_process();
@@ -125,7 +125,7 @@ ConnectionEvent::pre_process()
QueuedEvent::pre_process();
return;
}
-
+
if (_patch != src_node && src_node->parent() != _patch && dst_node->parent() != _patch) {
_error = PARENTS_NOT_FOUND;
QueuedEvent::pre_process();
@@ -135,14 +135,14 @@ ConnectionEvent::pre_process()
_connection = SharedPtr<ConnectionImpl>(new ConnectionImpl(_src_port, _dst_port));
_patch_listnode = new PatchImpl::Connections::Node(_connection);
_port_listnode = new InputPort::Connections::Node(_connection);
-
+
// Need to be careful about patch port connections here and adding a node's
// parent as a dependant/provider, or adding a patch as it's own provider...
if (src_node != dst_node && src_node->parent() == dst_node->parent()) {
dst_node->providers()->push_back(new Raul::List<NodeImpl*>::Node(src_node));
src_node->dependants()->push_back(new Raul::List<NodeImpl*>::Node(dst_node));
}
-
+
_patch->add_connection(_patch_listnode);
if (_patch->enabled())