summaryrefslogtreecommitdiffstats
path: root/src/engine/events/ConnectionEvent.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-05-13 16:04:14 +0000
committerDavid Robillard <d@drobilla.net>2009-05-13 16:04:14 +0000
commitaa473d19780f2670bb828835ee7ce970571016cf (patch)
tree0483fcb2cc350b3cc2f660f22449f803ae12f93d /src/engine/events/ConnectionEvent.cpp
parent44ddb73018b96a6979b4339f4ba234e5c97741f8 (diff)
downloadingen-aa473d19780f2670bb828835ee7ce970571016cf.tar.gz
ingen-aa473d19780f2670bb828835ee7ce970571016cf.tar.bz2
ingen-aa473d19780f2670bb828835ee7ce970571016cf.zip
Strip trailing whitespace.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1999 a436a847-0d15-0410-975c-d299462d15a1
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())