summaryrefslogtreecommitdiffstats
path: root/src/server/events
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-05-11 03:56:54 +0000
committerDavid Robillard <d@drobilla.net>2012-05-11 03:56:54 +0000
commit3dd4b42f3054f819c865e9415c4b86ba78d43aec (patch)
tree656d152cdffdd9196013fe9f35d46f4cf73c6927 /src/server/events
parent7be6d5d05756a7dea20c494d56f364b4dc064c88 (diff)
downloadingen-3dd4b42f3054f819c865e9415c4b86ba78d43aec.tar.gz
ingen-3dd4b42f3054f819c865e9415c4b86ba78d43aec.tar.bz2
ingen-3dd4b42f3054f819c865e9415c4b86ba78d43aec.zip
"Connection" => "Edge"
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4345 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/events')
-rw-r--r--src/server/events/Connect.cpp24
-rw-r--r--src/server/events/Connect.hpp6
-rw-r--r--src/server/events/Disconnect.cpp34
-rw-r--r--src/server/events/Disconnect.hpp14
-rw-r--r--src/server/events/DisconnectAll.cpp16
5 files changed, 46 insertions, 48 deletions
diff --git a/src/server/events/Connect.cpp b/src/server/events/Connect.cpp
index 1fe88c22..7f28c3e6 100644
--- a/src/server/events/Connect.cpp
+++ b/src/server/events/Connect.cpp
@@ -24,7 +24,7 @@
#include "ClientBroadcaster.hpp"
#include "Connect.hpp"
-#include "ConnectionImpl.hpp"
+#include "EdgeImpl.hpp"
#include "DuplexPort.hpp"
#include "Engine.hpp"
#include "EngineStore.hpp"
@@ -92,13 +92,13 @@ Connect::pre_process()
return;
}
- if (!ConnectionImpl::can_connect(_src_output_port, _dst_input_port)) {
+ if (!EdgeImpl::can_connect(_src_output_port, _dst_input_port)) {
_status = TYPE_MISMATCH;
Event::pre_process();
return;
}
- // Connection to a patch port from inside the patch
+ // Edge to a patch port from inside the patch
if (src_node->parent_patch() != dst_node->parent_patch()) {
assert(src_node->parent() == dst_node || dst_node->parent() == src_node);
if (src_node->parent() == dst_node)
@@ -106,30 +106,30 @@ Connect::pre_process()
else
_patch = dynamic_cast<PatchImpl*>(src_node);
- // Connection from a patch input to a patch output (pass through)
+ // Edge 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
+ // Normal edge between nodes with the same parent
} else {
_patch = src_node->parent_patch();
}
- if (_patch->has_connection(_src_output_port, _dst_input_port)) {
+ if (_patch->has_edge(_src_output_port, _dst_input_port)) {
_status = EXISTS;
Event::pre_process();
return;
}
- _connection = SharedPtr<ConnectionImpl>(
- new ConnectionImpl(_src_output_port, _dst_input_port));
+ _edge = SharedPtr<EdgeImpl>(
+ new EdgeImpl(_src_output_port, _dst_input_port));
rlock.release();
{
Glib::RWLock::ReaderLock wlock(_engine.engine_store()->lock());
- /* Need to be careful about patch port connections here and adding a
+ /* 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
provider...
*/
@@ -138,8 +138,8 @@ Connect::pre_process()
src_node->dependants().push_back(dst_node);
}
- _patch->add_connection(_connection);
- _dst_input_port->increment_num_connections();
+ _patch->add_edge(_edge);
+ _dst_input_port->increment_num_edges();
}
_buffers = new Raul::Array<BufferRef>(_dst_input_port->poly());
@@ -159,7 +159,7 @@ Connect::execute(ProcessContext& context)
if (_status == SUCCESS) {
// This must be inserted here, since they're actually used by the audio thread
- _dst_input_port->add_connection(_connection.get());
+ _dst_input_port->add_edge(_edge.get());
assert(_buffers);
_engine.maid()->push(_dst_input_port->set_buffers(_buffers));
_dst_input_port->connect_buffers();
diff --git a/src/server/events/Connect.hpp b/src/server/events/Connect.hpp
index d3c2bea6..9d807503 100644
--- a/src/server/events/Connect.hpp
+++ b/src/server/events/Connect.hpp
@@ -33,7 +33,7 @@ namespace Server {
class PatchImpl;
class NodeImpl;
-class ConnectionImpl;
+class EdgeImpl;
class PortImpl;
class InputPort;
class OutputPort;
@@ -41,7 +41,7 @@ class CompiledPatch;
namespace Events {
-/** Make a Connection between two Ports.
+/** Make an Edge between two Ports.
*
* \ingroup engine
*/
@@ -69,7 +69,7 @@ private:
CompiledPatch* _compiled_patch; ///< New process order for Patch
- SharedPtr<ConnectionImpl> _connection;
+ SharedPtr<EdgeImpl> _edge;
Raul::Array<BufferRef>* _buffers;
};
diff --git a/src/server/events/Disconnect.cpp b/src/server/events/Disconnect.cpp
index e7ed572f..6d3ae31f 100644
--- a/src/server/events/Disconnect.cpp
+++ b/src/server/events/Disconnect.cpp
@@ -22,7 +22,7 @@
#include "AudioBuffer.hpp"
#include "ClientBroadcaster.hpp"
-#include "ConnectionImpl.hpp"
+#include "EdgeImpl.hpp"
#include "DuplexPort.hpp"
#include "Engine.hpp"
#include "EngineStore.hpp"
@@ -63,7 +63,7 @@ Disconnect::Impl::Impl(Engine& e,
, _src_output_port(s)
, _dst_input_port(d)
, _patch(patch)
- , _connection(patch->remove_connection(_src_output_port, _dst_input_port))
+ , _edge(patch->remove_edge(_src_output_port, _dst_input_port))
, _buffers(NULL)
{
ThreadManager::assert_thread(THREAD_PRE_PROCESS);
@@ -87,9 +87,9 @@ Disconnect::Impl::Impl(Engine& e,
}
}
- _dst_input_port->decrement_num_connections();
+ _dst_input_port->decrement_num_edges();
- if (_dst_input_port->num_connections() == 0) {
+ if (_dst_input_port->num_edges() == 0) {
_buffers = new Raul::Array<BufferRef>(_dst_input_port->poly());
_dst_input_port->get_buffers(*_engine.buffer_factory(),
_buffers, _dst_input_port->poly());
@@ -132,27 +132,25 @@ Disconnect::pre_process()
NodeImpl* const src_node = _tail->parent_node();
NodeImpl* const dst_node = _head->parent_node();
- // Connection to a patch port from inside the patch
if (src_node->parent_patch() != dst_node->parent_patch()) {
-
+ // Edge to a patch port from inside the patch
assert(src_node->parent() == dst_node || dst_node->parent() == src_node);
- if (src_node->parent() == dst_node)
+ if (src_node->parent() == dst_node) {
_patch = dynamic_cast<PatchImpl*>(dst_node);
- else
+ } 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)) {
+ // Edge from a patch input to a patch output (pass through)
_patch = dynamic_cast<PatchImpl*>(src_node);
-
- // Normal connection between nodes with the same parent
} else {
+ // Normal edge between nodes with the same parent
_patch = src_node->parent_patch();
}
assert(_patch);
- if (!_patch->has_connection(_tail, _head)) {
+ if (!_patch->has_edge(_tail, _head)) {
_status = NOT_FOUND;
Event::pre_process();
return;
@@ -180,9 +178,9 @@ Disconnect::Impl::execute(ProcessContext& context, bool set_dst_buffers)
{
ThreadManager::assert_thread(THREAD_PROCESS);
- ConnectionImpl* const port_connection
- = _dst_input_port->remove_connection(context, _src_output_port);
- if (!port_connection) {
+ EdgeImpl* const port_edge =
+ _dst_input_port->remove_edge(context, _src_output_port);
+ if (!port_edge) {
return false;
}
@@ -198,8 +196,8 @@ Disconnect::Impl::execute(ProcessContext& context, bool set_dst_buffers)
_dst_input_port->recycle_buffers();
}
- assert(_connection);
- assert(port_connection == _connection.get());
+ assert(_edge);
+ assert(port_edge == _edge.get());
return true;
}
diff --git a/src/server/events/Disconnect.hpp b/src/server/events/Disconnect.hpp
index cf4e6f18..8f955311 100644
--- a/src/server/events/Disconnect.hpp
+++ b/src/server/events/Disconnect.hpp
@@ -38,7 +38,7 @@ class PortImpl;
namespace Events {
-/** Make a Connection between two Ports.
+/** Remove an Edge between two Ports.
*
* \ingroup engine
*/
@@ -68,12 +68,12 @@ public:
InputPort* head() { return _dst_input_port; }
private:
- Engine& _engine;
- OutputPort* _src_output_port;
- InputPort* _dst_input_port;
- PatchImpl* _patch;
- SharedPtr<ConnectionImpl> _connection;
- Raul::Array<BufferRef>* _buffers;
+ Engine& _engine;
+ OutputPort* _src_output_port;
+ InputPort* _dst_input_port;
+ PatchImpl* _patch;
+ SharedPtr<EdgeImpl> _edge;
+ Raul::Array<BufferRef>* _buffers;
};
private:
diff --git a/src/server/events/DisconnectAll.cpp b/src/server/events/DisconnectAll.cpp
index f869c5d3..04527212 100644
--- a/src/server/events/DisconnectAll.cpp
+++ b/src/server/events/DisconnectAll.cpp
@@ -24,7 +24,7 @@
#include "raul/Path.hpp"
#include "ClientBroadcaster.hpp"
-#include "ConnectionImpl.hpp"
+#include "EdgeImpl.hpp"
#include "Engine.hpp"
#include "EngineStore.hpp"
#include "InputPort.hpp"
@@ -116,11 +116,11 @@ DisconnectAll::pre_process()
assert((_node || _port) && !(_node && _port));
}
- // Find set of connections to remove
- std::set<ConnectionImpl*> to_remove;
- for (Patch::Connections::const_iterator i = _parent->connections().begin();
- i != _parent->connections().end(); ++i) {
- ConnectionImpl* const c = (ConnectionImpl*)i->second.get();
+ // Find set of edges to remove
+ std::set<EdgeImpl*> to_remove;
+ for (Patch::Edges::const_iterator i = _parent->edges().begin();
+ i != _parent->edges().end(); ++i) {
+ EdgeImpl* const c = (EdgeImpl*)i->second.get();
if (_node) {
if (c->tail()->parent_node() == _node
|| c->head()->parent_node() == _node) {
@@ -134,8 +134,8 @@ DisconnectAll::pre_process()
}
}
- // Create disconnect events (which erases from _parent->connections())
- for (std::set<ConnectionImpl*>::const_iterator i = to_remove.begin();
+ // Create disconnect events (which erases from _parent->edges())
+ for (std::set<EdgeImpl*>::const_iterator i = to_remove.begin();
i != to_remove.end(); ++i) {
_impls.push_back(new Disconnect::Impl(
_engine, _parent,