summaryrefslogtreecommitdiffstats
path: root/src/server
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
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')
-rw-r--r--src/server/ClientBroadcaster.cpp2
-rw-r--r--src/server/ClientBroadcaster.hpp5
-rw-r--r--src/server/CompiledPatch.hpp8
-rw-r--r--src/server/DuplexPort.cpp1
-rw-r--r--src/server/EdgeImpl.cpp (renamed from src/server/ConnectionImpl.cpp)32
-rw-r--r--src/server/EdgeImpl.hpp (renamed from src/server/ConnectionImpl.hpp)22
-rw-r--r--src/server/InputPort.cpp70
-rw-r--r--src/server/InputPort.hpp30
-rw-r--r--src/server/MessageContext.cpp2
-rw-r--r--src/server/ObjectSender.cpp8
-rw-r--r--src/server/PatchImpl.cpp46
-rw-r--r--src/server/PatchImpl.hpp22
-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
-rw-r--r--src/server/wscript2
18 files changed, 168 insertions, 176 deletions
diff --git a/src/server/ClientBroadcaster.cpp b/src/server/ClientBroadcaster.cpp
index 1194cd82..6c81e5de 100644
--- a/src/server/ClientBroadcaster.cpp
+++ b/src/server/ClientBroadcaster.cpp
@@ -21,7 +21,7 @@
#include "raul/log.hpp"
#include "ClientBroadcaster.hpp"
-#include "ConnectionImpl.hpp"
+#include "EdgeImpl.hpp"
#include "EngineStore.hpp"
#include "ObjectSender.hpp"
#include "PluginImpl.hpp"
diff --git a/src/server/ClientBroadcaster.hpp b/src/server/ClientBroadcaster.hpp
index 5eea1093..88c471c6 100644
--- a/src/server/ClientBroadcaster.hpp
+++ b/src/server/ClientBroadcaster.hpp
@@ -33,11 +33,6 @@ namespace Ingen {
namespace Server {
class GraphObjectImpl;
-class NodeImpl;
-class PortImpl;
-class PluginImpl;
-class PatchImpl;
-class ConnectionImpl;
/** Broadcaster for all clients.
*
diff --git a/src/server/CompiledPatch.hpp b/src/server/CompiledPatch.hpp
index 5f699d2d..0a5752a5 100644
--- a/src/server/CompiledPatch.hpp
+++ b/src/server/CompiledPatch.hpp
@@ -28,7 +28,7 @@
namespace Ingen {
namespace Server {
-class ConnectionImpl;
+class EdgeImpl;
class NodeImpl;
/** All information required about a node to execute it in an audio thread.
@@ -69,10 +69,10 @@ class CompiledPatch : public std::vector<CompiledNode>
, public boost::noncopyable
{
public:
- typedef std::vector<ConnectionImpl*> QueuedConnections;
+ typedef std::vector<EdgeImpl*> QueuedEdges;
- /** All (audio context => other context) connections */
- std::vector<ConnectionImpl*> queued_connections;
+ /** All (audio context => other context) edges */
+ std::vector<EdgeImpl*> queued_edges;
};
} // namespace Server
diff --git a/src/server/DuplexPort.cpp b/src/server/DuplexPort.cpp
index e63de6e2..1a62d562 100644
--- a/src/server/DuplexPort.cpp
+++ b/src/server/DuplexPort.cpp
@@ -21,7 +21,6 @@
#include "ingen/shared/URIs.hpp"
#include "Buffer.hpp"
-#include "ConnectionImpl.hpp"
#include "DuplexPort.hpp"
#include "NodeImpl.hpp"
#include "OutputPort.hpp"
diff --git a/src/server/ConnectionImpl.cpp b/src/server/EdgeImpl.cpp
index c91b7403..a5c63d4a 100644
--- a/src/server/ConnectionImpl.cpp
+++ b/src/server/EdgeImpl.cpp
@@ -24,7 +24,7 @@
#include "AudioBuffer.hpp"
#include "BufferFactory.hpp"
-#include "ConnectionImpl.hpp"
+#include "EdgeImpl.hpp"
#include "Engine.hpp"
#include "InputPort.hpp"
#include "MessageContext.hpp"
@@ -38,12 +38,12 @@
namespace Ingen {
namespace Server {
-/** Constructor for a connection from a node's output port.
+/** Constructor for a edge from a node's output port.
*
* This handles both polyphonic and monophonic nodes, transparently to the
* user (InputPort).
*/
-ConnectionImpl::ConnectionImpl(PortImpl* tail, PortImpl* head)
+EdgeImpl::EdgeImpl(PortImpl* tail, PortImpl* head)
: _tail(tail)
, _head(head)
, _queue(NULL)
@@ -58,7 +58,7 @@ ConnectionImpl::ConnectionImpl(PortImpl* tail, PortImpl* head)
}
void
-ConnectionImpl::dump() const
+EdgeImpl::dump() const
{
Raul::debug << _tail->path() << " -> " << _head->path()
<< (must_mix() ? " (MIX) " : " (DIRECT) ")
@@ -68,23 +68,23 @@ ConnectionImpl::dump() const
}
const Raul::Path&
-ConnectionImpl::tail_path() const
+EdgeImpl::tail_path() const
{
return _tail->path();
}
const Raul::Path&
-ConnectionImpl::head_path() const
+EdgeImpl::head_path() const
{
return _head->path();
}
void
-ConnectionImpl::get_sources(Context& context,
- uint32_t voice,
- boost::intrusive_ptr<Buffer>* srcs,
- uint32_t max_num_srcs,
- uint32_t& num_srcs)
+EdgeImpl::get_sources(Context& context,
+ uint32_t voice,
+ boost::intrusive_ptr<Buffer>* srcs,
+ uint32_t max_num_srcs,
+ uint32_t& num_srcs)
{
if (must_queue() && _queue->read_space() > 0) {
LV2_Atom obj;
@@ -109,7 +109,7 @@ ConnectionImpl::get_sources(Context& context,
}
void
-ConnectionImpl::queue(Context& context)
+EdgeImpl::queue(Context& context)
{
if (!must_queue())
return;
@@ -132,7 +132,7 @@ ConnectionImpl::queue(Context& context)
}
BufferRef
-ConnectionImpl::buffer(uint32_t voice) const
+EdgeImpl::buffer(uint32_t voice) const
{
assert(!must_mix());
assert(!must_queue());
@@ -145,20 +145,20 @@ ConnectionImpl::buffer(uint32_t voice) const
}
bool
-ConnectionImpl::must_mix() const
+EdgeImpl::must_mix() const
{
return _tail->poly() > _head->poly();
}
bool
-ConnectionImpl::must_queue() const
+EdgeImpl::must_queue() const
{
return _tail->parent_node()->context()
!= _head->parent_node()->context();
}
bool
-ConnectionImpl::can_connect(const OutputPort* src, const InputPort* dst)
+EdgeImpl::can_connect(const OutputPort* src, const InputPort* dst)
{
const Ingen::Shared::URIs& uris = src->bufs().uris();
return (
diff --git a/src/server/ConnectionImpl.hpp b/src/server/EdgeImpl.hpp
index 395e749d..3d39e492 100644
--- a/src/server/ConnectionImpl.hpp
+++ b/src/server/EdgeImpl.hpp
@@ -14,8 +14,8 @@
along with Ingen. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef INGEN_ENGINE_CONNECTIONIMPL_HPP
-#define INGEN_ENGINE_CONNECTIONIMPL_HPP
+#ifndef INGEN_ENGINE_EDGE_IMPL_HPP
+#define INGEN_ENGINE_EDGE_IMPL_HPP
#include <cstdlib>
@@ -23,7 +23,7 @@
#include <boost/intrusive_ptr.hpp>
#include <boost/utility.hpp>
-#include "ingen/Connection.hpp"
+#include "ingen/Edge.hpp"
#include "lv2/lv2plug.in/ns/ext/atom/atom.h"
#include "raul/Deletable.hpp"
#include "raul/log.hpp"
@@ -52,15 +52,15 @@ class BufferFactory;
*
* \ingroup engine
*/
-class ConnectionImpl
+class EdgeImpl
: public Raul::Deletable
, private Raul::Noncopyable
- , public Connection
+ , public Edge
, public boost::intrusive::slist_base_hook<
boost::intrusive::link_mode<boost::intrusive::auto_unlink> >
{
public:
- ConnectionImpl(PortImpl* tail, PortImpl* head);
+ EdgeImpl(PortImpl* tail, PortImpl* head);
PortImpl* tail() const { return _tail; }
PortImpl* head() const { return _head; }
@@ -77,16 +77,16 @@ public:
uint32_t& num_srcs);
/** Get the buffer for a particular voice.
- * A Connection is smart - it knows the destination port requesting the
+ * An Edge is smart - it knows the destination port requesting the
* buffer, and will return accordingly (e.g. the same buffer for every
- * voice in a mono->poly connection).
+ * voice in a mono->poly edge).
*/
BufferRef buffer(uint32_t voice) const;
- /** Whether this connection must mix down voices into a local buffer */
+ /** Whether this edge must mix down voices into a local buffer */
bool must_mix() const;
- /** Whether this connection crosses contexts and must buffer */
+ /** Whether this edge crosses contexts and must buffer */
bool must_queue() const;
static bool can_connect(const OutputPort* src, const InputPort* dst);
@@ -102,4 +102,4 @@ protected:
} // namespace Server
} // namespace Ingen
-#endif // INGEN_ENGINE_CONNECTIONIMPL_HPP
+#endif // INGEN_ENGINE_EDGEIMPL_HPP
diff --git a/src/server/InputPort.cpp b/src/server/InputPort.cpp
index 3f3dcdd0..33e8e913 100644
--- a/src/server/InputPort.cpp
+++ b/src/server/InputPort.cpp
@@ -21,7 +21,7 @@
#include "AudioBuffer.hpp"
#include "BufferFactory.hpp"
-#include "ConnectionImpl.hpp"
+#include "EdgeImpl.hpp"
#include "Engine.hpp"
#include "InputPort.hpp"
#include "NodeImpl.hpp"
@@ -48,7 +48,7 @@ InputPort::InputPort(BufferFactory& bufs,
const Raul::Atom& value,
size_t buffer_size)
: PortImpl(bufs, parent, symbol, index, poly, type, buffer_type, value, buffer_size)
- , _num_connections(0)
+ , _num_edges(0)
{
const Ingen::Shared::URIs& uris = bufs.uris();
@@ -82,22 +82,22 @@ InputPort::get_buffers(BufferFactory& bufs,
Raul::Array<BufferRef>* buffers,
uint32_t poly) const
{
- size_t num_connections = (ThreadManager::thread_is(THREAD_PROCESS))
- ? _connections.size() : _num_connections;
+ size_t num_edges = (ThreadManager::thread_is(THREAD_PROCESS))
+ ? _edges.size() : _num_edges;
- if (is_a(PortType::AUDIO) && num_connections == 0) {
- // Audio input with no connections, use shared zero buffer
+ if (is_a(PortType::AUDIO) && num_edges == 0) {
+ // Audio input with no edges, use shared zero buffer
for (uint32_t v = 0; v < poly; ++v)
buffers->at(v) = bufs.silent_buffer();
return false;
- } else if (num_connections == 1) {
+ } else if (num_edges == 1) {
if (ThreadManager::thread_is(THREAD_PROCESS)) {
- if (!_connections.front().must_mix() &&
- !_connections.front().must_queue()) {
+ if (!_edges.front().must_mix() &&
+ !_edges.front().must_queue()) {
// Single non-mixing conneciton, use buffers directly
for (uint32_t v = 0; v < poly; ++v)
- buffers->at(v) = _connections.front().buffer(v);
+ buffers->at(v) = _edges.front().buffer(v);
return false;
}
}
@@ -111,52 +111,52 @@ InputPort::get_buffers(BufferFactory& bufs,
return true;
}
-/** Add a connection. Realtime safe.
+/** Add a edge. Realtime safe.
*
- * The buffer of this port will be set directly to the connection's buffer
- * if there is only one connection, since no copying/mixing needs to take place.
+ * The buffer of this port will be set directly to the edge's buffer
+ * if there is only one edge, since no copying/mixing needs to take place.
*
* Note that setup_buffers must be called after this before the change
* will audibly take effect.
*/
void
-InputPort::add_connection(ConnectionImpl* c)
+InputPort::add_edge(EdgeImpl* c)
{
ThreadManager::assert_thread(THREAD_PROCESS);
- _connections.push_front(*c);
+ _edges.push_front(*c);
// Broadcast value/activity of connected input
_broadcast = true;
}
-/** Remove a connection. Realtime safe.
+/** Remove a edge. Realtime safe.
*
* Note that setup_buffers must be called after this before the change
* will audibly take effect.
*/
-ConnectionImpl*
-InputPort::remove_connection(ProcessContext& context, const OutputPort* tail)
+EdgeImpl*
+InputPort::remove_edge(ProcessContext& context, const OutputPort* tail)
{
ThreadManager::assert_thread(THREAD_PROCESS);
- ConnectionImpl* connection = NULL;
- for (Connections::iterator i = _connections.begin(); i != _connections.end(); ++i) {
+ EdgeImpl* edge = NULL;
+ for (Edges::iterator i = _edges.begin(); i != _edges.end(); ++i) {
if (i->tail() == tail) {
- connection = &*i;
- _connections.erase(i);
+ edge = &*i;
+ _edges.erase(i);
break;
}
}
- if (!connection) {
- Raul::error << "[InputPort::remove_connection] Connection not found!"
+ if (!edge) {
+ Raul::error << "[InputPort::remove_edge] Edge not found!"
<< std::endl;
return NULL;
}
// Turn off broadcasting if we're no longer connected
- if (_connections.empty()) {
+ if (_edges.empty()) {
if (is_a(PortType::AUDIO)) {
// Send an update peak of 0.0 to reset to silence
const Notification note = Notification::make(
@@ -167,7 +167,7 @@ InputPort::remove_connection(ProcessContext& context, const OutputPort* tail)
_broadcast = false;
}
- return connection;
+ return edge;
}
/** Prepare buffer for access, mixing if necessary. Realtime safe.
@@ -179,19 +179,19 @@ InputPort::pre_process(Context& context)
if (_set_by_user)
return;
- if (_connections.empty()) {
+ if (_edges.empty()) {
for (uint32_t v = 0; v < _poly; ++v) {
buffer(v)->prepare_read(context);
}
} else if (direct_connect()) {
for (uint32_t v = 0; v < _poly; ++v) {
- _buffers->at(v) = _connections.front().buffer(v);
+ _buffers->at(v) = _edges.front().buffer(v);
_buffers->at(v)->prepare_read(context);
}
} else {
uint32_t max_num_srcs = 0;
- for (Connections::const_iterator c = _connections.begin();
- c != _connections.end(); ++c) {
+ for (Edges::const_iterator c = _edges.begin();
+ c != _edges.end(); ++c) {
max_num_srcs += c->tail()->poly();
}
@@ -199,8 +199,8 @@ InputPort::pre_process(Context& context)
for (uint32_t v = 0; v < _poly; ++v) {
uint32_t num_srcs = 0;
- for (Connections::iterator c = _connections.begin();
- c != _connections.end(); ++c) {
+ for (Edges::iterator c = _edges.begin();
+ c != _edges.end(); ++c) {
c->get_sources(context, v, srcs, max_num_srcs, num_srcs);
}
@@ -230,9 +230,9 @@ InputPort::post_process(Context& context)
bool
InputPort::direct_connect() const
{
- return _connections.size() == 1
- && !_connections.front().must_mix()
- && !_connections.front().must_queue();
+ return _edges.size() == 1
+ && !_edges.front().must_mix()
+ && !_edges.front().must_queue();
}
} // namespace Server
diff --git a/src/server/InputPort.hpp b/src/server/InputPort.hpp
index 5d7269da..ea52b15e 100644
--- a/src/server/InputPort.hpp
+++ b/src/server/InputPort.hpp
@@ -26,12 +26,12 @@
#include "raul/SharedPtr.hpp"
#include "PortImpl.hpp"
-#include "ConnectionImpl.hpp"
+#include "EdgeImpl.hpp"
namespace Ingen {
namespace Server {
-class ConnectionImpl;
+class EdgeImpl;
class Context;
class NodeImpl;
class OutputPort;
@@ -40,10 +40,10 @@ class ProcessContext;
/** An input port on a Node or Patch.
*
* All ports have a Buffer, but the actual contents (data) of that buffer may be
- * set directly to the incoming connection's buffer if there's only one inbound
- * connection, to eliminate the need to copy/mix.
+ * set directly to the incoming edge's buffer if there's only one inbound
+ * edge, to eliminate the need to copy/mix.
*
- * If a port has multiple connections, they will be mixed down into the local
+ * If a port has multiple edges, they will be mixed down into the local
* buffer and it will be used.
*
* \ingroup engine
@@ -63,13 +63,13 @@ public:
virtual ~InputPort() {}
- typedef boost::intrusive::slist<ConnectionImpl,
+ typedef boost::intrusive::slist<EdgeImpl,
boost::intrusive::constant_time_size<false>
- > Connections;
+ > Edges;
- void add_connection(ConnectionImpl* c);
- ConnectionImpl* remove_connection(ProcessContext& context,
- const OutputPort* tail);
+ void add_edge(EdgeImpl* c);
+ EdgeImpl* remove_edge(ProcessContext& context,
+ const OutputPort* tail);
bool apply_poly(Raul::Maid& maid, uint32_t poly);
@@ -80,9 +80,9 @@ public:
void pre_process(Context& context);
void post_process(Context& context);
- size_t num_connections() const { return _num_connections; } ///< Pre-process thread
- void increment_num_connections() { ++_num_connections; }
- void decrement_num_connections() { --_num_connections; }
+ size_t num_edges() const { return _num_edges; } ///< Pre-process thread
+ void increment_num_edges() { ++_num_edges; }
+ void decrement_num_edges() { --_num_edges; }
bool is_input() const { return true; }
bool is_output() const { return false; }
@@ -90,8 +90,8 @@ public:
bool direct_connect() const;
protected:
- size_t _num_connections; ///< Pre-process thread
- Connections _connections;
+ size_t _num_edges; ///< Pre-process thread
+ Edges _edges;
};
} // namespace Server
diff --git a/src/server/MessageContext.cpp b/src/server/MessageContext.cpp
index d59452d7..4a476bd6 100644
--- a/src/server/MessageContext.cpp
+++ b/src/server/MessageContext.cpp
@@ -17,7 +17,7 @@
#include <algorithm>
#include "lv2/lv2plug.in/ns/ext/worker/worker.h"
#include "raul/log.hpp"
-#include "ConnectionImpl.hpp"
+#include "EdgeImpl.hpp"
#include "Engine.hpp"
#include "MessageContext.hpp"
#include "NodeImpl.hpp"
diff --git a/src/server/ObjectSender.cpp b/src/server/ObjectSender.cpp
index 167ffb1f..7dc8ca39 100644
--- a/src/server/ObjectSender.cpp
+++ b/src/server/ObjectSender.cpp
@@ -21,7 +21,7 @@
#include "PatchImpl.hpp"
#include "NodeImpl.hpp"
#include "PortImpl.hpp"
-#include "ConnectionImpl.hpp"
+#include "EdgeImpl.hpp"
#include "NodeFactory.hpp"
#include "PortType.hpp"
#include "AudioBuffer.hpp"
@@ -86,9 +86,9 @@ ObjectSender::send_patch(Interface* client,
send_port(client, port, false);
}
- // Send connections
- for (PatchImpl::Connections::const_iterator j = patch->connections().begin();
- j != patch->connections().end(); ++j)
+ // Send edges
+ for (PatchImpl::Edges::const_iterator j = patch->edges().begin();
+ j != patch->edges().end(); ++j)
client->connect(j->second->tail_path(), j->second->head_path());
}
diff --git a/src/server/PatchImpl.cpp b/src/server/PatchImpl.cpp
index f24ab574..112e2a49 100644
--- a/src/server/PatchImpl.cpp
+++ b/src/server/PatchImpl.cpp
@@ -22,7 +22,7 @@
#include "ingen/shared/World.hpp"
#include "raul/log.hpp"
-#include "ConnectionImpl.hpp"
+#include "EdgeImpl.hpp"
#include "Driver.hpp"
#include "DuplexPort.hpp"
#include "Engine.hpp"
@@ -170,9 +170,9 @@ PatchImpl::process(ProcessContext& context)
}
}
- // Queue any cross-context connections
- for (CompiledPatch::QueuedConnections::iterator i = _compiled_patch->queued_connections.begin();
- i != _compiled_patch->queued_connections.end(); ++i) {
+ // Queue any cross-context edges
+ for (CompiledPatch::QueuedEdges::iterator i = _compiled_patch->queued_edges.begin();
+ i != _compiled_patch->queued_edges.end(); ++i) {
(*i)->queue(context);
}
@@ -295,36 +295,36 @@ PatchImpl::remove_node(const Raul::Symbol& symbol)
}
void
-PatchImpl::add_connection(SharedPtr<ConnectionImpl> c)
+PatchImpl::add_edge(SharedPtr<EdgeImpl> c)
{
ThreadManager::assert_thread(THREAD_PRE_PROCESS);
- _connections.insert(make_pair(make_pair(c->tail(), c->head()), c));
+ _edges.insert(make_pair(make_pair(c->tail(), c->head()), c));
}
-/** Remove a connection.
+/** Remove a edge.
* Preprocessing thread only.
*/
-SharedPtr<ConnectionImpl>
-PatchImpl::remove_connection(const PortImpl* tail, const PortImpl* dst_port)
+SharedPtr<EdgeImpl>
+PatchImpl::remove_edge(const PortImpl* tail, const PortImpl* dst_port)
{
ThreadManager::assert_thread(THREAD_PRE_PROCESS);
- Connections::iterator i = _connections.find(make_pair(tail, dst_port));
- if (i != _connections.end()) {
- SharedPtr<ConnectionImpl> c = PtrCast<ConnectionImpl>(i->second);
- _connections.erase(i);
+ Edges::iterator i = _edges.find(make_pair(tail, dst_port));
+ if (i != _edges.end()) {
+ SharedPtr<EdgeImpl> c = PtrCast<EdgeImpl>(i->second);
+ _edges.erase(i);
return c;
} else {
- Raul::error << "[PatchImpl::remove_connection] Connection not found" << endl;
- return SharedPtr<ConnectionImpl>();
+ Raul::error << "[PatchImpl::remove_edge] Edge not found" << endl;
+ return SharedPtr<EdgeImpl>();
}
}
bool
-PatchImpl::has_connection(const PortImpl* tail, const PortImpl* dst_port) const
+PatchImpl::has_edge(const PortImpl* tail, const PortImpl* dst_port) const
{
ThreadManager::assert_thread(THREAD_PRE_PROCESS);
- Connections::const_iterator i = _connections.find(make_pair(tail, dst_port));
- return (i != _connections.end());
+ Edges::const_iterator i = _edges.find(make_pair(tail, dst_port));
+ return (i != _edges.end());
}
uint32_t
@@ -468,13 +468,13 @@ PatchImpl::compile() const
compile_recursive(node, compiled_patch);
}
- // Add any queued connections that must be run after a cycle
- for (Connections::const_iterator i = _connections.begin();
- i != _connections.end(); ++i) {
- SharedPtr<ConnectionImpl> c = PtrCast<ConnectionImpl>(i->second);
+ // Add any queued edges that must be run after a cycle
+ for (Edges::const_iterator i = _edges.begin();
+ i != _edges.end(); ++i) {
+ SharedPtr<EdgeImpl> c = PtrCast<EdgeImpl>(i->second);
if (c->tail()->parent_node()->context() == Context::AUDIO &&
c->head()->parent_node()->context() == Context::MESSAGE) {
- compiled_patch->queued_connections.push_back(c.get());
+ compiled_patch->queued_edges.push_back(c.get());
}
}
diff --git a/src/server/PatchImpl.hpp b/src/server/PatchImpl.hpp
index 85b53351..872993ce 100644
--- a/src/server/PatchImpl.hpp
+++ b/src/server/PatchImpl.hpp
@@ -31,12 +31,12 @@
namespace Ingen {
-class Connection;
+class Edge;
namespace Server {
class CompiledPatch;
-class ConnectionImpl;
+class EdgeImpl;
class Context;
class Engine;
class ProcessContext;
@@ -99,11 +99,11 @@ public:
void add_node(Nodes::Node* tn);
Nodes::Node* remove_node(const Raul::Symbol& symbol);
- Nodes& nodes() { return _nodes; }
- Connections& connections() { return _connections; }
+ Nodes& nodes() { return _nodes; }
+ Edges& edges() { return _edges; }
- const Nodes& nodes() const { return _nodes; }
- const Connections& connections() const { return _connections; }
+ const Nodes& nodes() const { return _nodes; }
+ const Edges& edges() const { return _edges; }
uint32_t num_ports() const;
@@ -130,12 +130,12 @@ public:
Ports::Node* remove_port(const std::string& name);
void clear_ports();
- void add_connection(SharedPtr<ConnectionImpl> c);
+ void add_edge(SharedPtr<EdgeImpl> c);
- SharedPtr<ConnectionImpl> remove_connection(const PortImpl* tail,
- const PortImpl* head);
+ SharedPtr<EdgeImpl> remove_edge(const PortImpl* tail,
+ const PortImpl* head);
- bool has_connection(const PortImpl* tail, const PortImpl* head) const;
+ bool has_edge(const PortImpl* tail, const PortImpl* head) const;
CompiledPatch* compiled_patch() { return _compiled_patch; }
void compiled_patch(CompiledPatch* cp) { _compiled_patch = cp; }
@@ -161,7 +161,7 @@ private:
Engine& _engine;
uint32_t _internal_poly;
CompiledPatch* _compiled_patch; ///< Process thread only
- Connections _connections; ///< Pre-process thread only
+ Edges _edges; ///< Pre-process thread only
Ports _inputs; ///< Pre-process thread only
Ports _outputs; ///< Pre-process thread only
Nodes _nodes; ///< Pre-process thread only
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,
diff --git a/src/server/wscript b/src/server/wscript
index a043c0fa..1d3d8b56 100644
--- a/src/server/wscript
+++ b/src/server/wscript
@@ -7,9 +7,9 @@ def build(bld):
Buffer.cpp
BufferFactory.cpp
ClientBroadcaster.cpp
- ConnectionImpl.cpp
ControlBindings.cpp
DuplexPort.cpp
+ EdgeImpl.cpp
Engine.cpp
EngineStore.cpp
Event.cpp