summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--ingen/Edge.hpp (renamed from ingen/Connection.hpp)10
-rw-r--r--ingen/Patch.hpp10
-rw-r--r--ingen/client/EdgeModel.hpp4
-rw-r--r--ingen/client/PatchModel.hpp18
-rw-r--r--ingen/serialisation/Serialiser.hpp6
-rw-r--r--src/client/ClientStore.cpp12
-rw-r--r--src/client/PatchModel.cpp37
-rw-r--r--src/gui/Edge.cpp (renamed from src/gui/Connection.cpp)17
-rw-r--r--src/gui/Edge.hpp (renamed from src/gui/Connection.hpp)21
-rw-r--r--src/gui/PatchCanvas.cpp20
-rw-r--r--src/gui/wscript2
-rw-r--r--src/serialisation/Serialiser.cpp36
-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
-rw-r--r--src/shared/Builder.cpp14
-rw-r--r--src/shared/World.cpp6
32 files changed, 272 insertions, 285 deletions
diff --git a/ingen/Connection.hpp b/ingen/Edge.hpp
index 7ff34847..66e9c21b 100644
--- a/ingen/Connection.hpp
+++ b/ingen/Edge.hpp
@@ -14,8 +14,8 @@
along with Ingen. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef INGEN_INTERFACE_CONNECTION_HPP
-#define INGEN_INTERFACE_CONNECTION_HPP
+#ifndef INGEN_INTERFACE_EDGE_HPP
+#define INGEN_INTERFACE_EDGE_HPP
namespace Raul { class Path; }
@@ -25,10 +25,10 @@ namespace Ingen {
*
* \ingroup interface
*/
-class Connection
+class Edge
{
public:
- virtual ~Connection() {}
+ virtual ~Edge() {}
virtual const Raul::Path& tail_path() const = 0;
virtual const Raul::Path& head_path() const = 0;
@@ -36,4 +36,4 @@ public:
} // namespace Ingen
-#endif // INGEN_INTERFACE_CONNECTION_HPP
+#endif // INGEN_INTERFACE_EDGE_HPP
diff --git a/ingen/Patch.hpp b/ingen/Patch.hpp
index 807b843a..c0056f44 100644
--- a/ingen/Patch.hpp
+++ b/ingen/Patch.hpp
@@ -26,19 +26,19 @@
namespace Ingen {
-class Connection;
+class Edge;
-/** A Path (graph of Nodes/Connections)
+/** A Path (graph of Nodes/Edges)
*
* \ingroup interface
*/
class Patch : virtual public Node
{
public:
- typedef std::pair<const Port*, const Port*> ConnectionsKey;
- typedef std::map< ConnectionsKey, SharedPtr<Connection> > Connections;
+ typedef std::pair<const Port*, const Port*> EdgesKey;
+ typedef std::map< EdgesKey, SharedPtr<Edge> > Edges;
- virtual const Connections& connections() const = 0;
+ virtual const Edges& edges() const = 0;
virtual bool enabled() const = 0;
virtual uint32_t internal_poly() const = 0;
diff --git a/ingen/client/EdgeModel.hpp b/ingen/client/EdgeModel.hpp
index 9b409e92..83faa25f 100644
--- a/ingen/client/EdgeModel.hpp
+++ b/ingen/client/EdgeModel.hpp
@@ -22,7 +22,7 @@
#include "raul/Path.hpp"
#include "raul/SharedPtr.hpp"
-#include "ingen/Connection.hpp"
+#include "ingen/Edge.hpp"
#include "ingen/client/PortModel.hpp"
namespace Ingen {
@@ -34,7 +34,7 @@ class ClientStore;
*
* \ingroup IngenClient
*/
-class EdgeModel : public Connection
+class EdgeModel : public Edge
{
public:
SharedPtr<PortModel> tail() const { return _tail; }
diff --git a/ingen/client/PatchModel.hpp b/ingen/client/PatchModel.hpp
index 1ea822bb..af5ecb2f 100644
--- a/ingen/client/PatchModel.hpp
+++ b/ingen/client/PatchModel.hpp
@@ -40,10 +40,10 @@ class PatchModel : public NodeModel, public Ingen::Patch
public:
/* WARNING: Copy constructor creates a shallow copy WRT connections */
- const Connections& connections() const { return *_connections.get(); }
+ const Edges& edges() const { return *_edges.get(); }
- SharedPtr<EdgeModel> get_connection(const Ingen::Port* tail,
- const Ingen::Port* head);
+ SharedPtr<EdgeModel> get_edge(const Ingen::Port* tail,
+ const Ingen::Port* head);
bool enabled() const;
bool polyphonic() const;
@@ -52,15 +52,15 @@ public:
// Signals
INGEN_SIGNAL(new_node, void, SharedPtr<NodeModel>);
INGEN_SIGNAL(removed_node, void, SharedPtr<NodeModel>);
- INGEN_SIGNAL(new_connection, void, SharedPtr<EdgeModel>);
- INGEN_SIGNAL(removed_connection, void, SharedPtr<EdgeModel>);
+ INGEN_SIGNAL(new_edge, void, SharedPtr<EdgeModel>);
+ INGEN_SIGNAL(removed_edge, void, SharedPtr<EdgeModel>);
private:
friend class ClientStore;
PatchModel(Shared::URIs& uris, const Raul::Path& patch_path)
: NodeModel(uris, "http://drobilla.net/ns/ingen#Patch", patch_path)
- , _connections(new Connections())
+ , _edges(new Edges())
{
}
@@ -68,11 +68,11 @@ private:
void add_child(SharedPtr<ObjectModel> c);
bool remove_child(SharedPtr<ObjectModel> c);
- void add_connection(SharedPtr<EdgeModel> cm);
- void remove_connection(const Ingen::Port* tail,
+ void add_edge(SharedPtr<EdgeModel> cm);
+ void remove_edge(const Ingen::Port* tail,
const Ingen::Port* head);
- SharedPtr<Connections> _connections;
+ SharedPtr<Edges> _edges;
};
} // namespace Client
diff --git a/ingen/serialisation/Serialiser.hpp b/ingen/serialisation/Serialiser.hpp
index cfc11c02..b09c194a 100644
--- a/ingen/serialisation/Serialiser.hpp
+++ b/ingen/serialisation/Serialiser.hpp
@@ -34,7 +34,7 @@ class GraphObject;
class Patch;
class Node;
class Port;
-class Connection;
+class Edge;
namespace Shared {
class World;
@@ -69,8 +69,8 @@ public:
virtual void serialise(SharedPtr<const GraphObject> object) throw (std::logic_error);
- virtual void serialise_connection(const Sord::Node& parent,
- SharedPtr<const Connection> c) throw (std::logic_error);
+ virtual void serialise_edge(const Sord::Node& parent,
+ SharedPtr<const Edge> c) throw (std::logic_error);
virtual std::string finish();
diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp
index 042cba57..a78653e5 100644
--- a/src/client/ClientStore.cpp
+++ b/src/client/ClientStore.cpp
@@ -457,7 +457,7 @@ ClientStore::attempt_connection(const Raul::Path& tail_path,
tail->connected_to(head);
head->connected_to(tail);
- patch->add_connection(cm);
+ patch->add_edge(cm);
return true;
}
@@ -495,7 +495,7 @@ ClientStore::disconnect(const Raul::Path& src,
SharedPtr<PatchModel> patch = connection_patch(src_path, dst_path);
if (patch)
- patch->remove_connection(tail.get(), head.get());
+ patch->remove_edge(tail.get(), head.get());
}
void
@@ -511,9 +511,9 @@ ClientStore::disconnect_all(const Raul::Path& parent_patch,
return;
}
- const PatchModel::Connections connections = patch->connections();
- for (PatchModel::Connections::const_iterator i = connections.begin();
- i != connections.end(); ++i) {
+ const PatchModel::Edges edges = patch->edges();
+ for (PatchModel::Edges::const_iterator i = edges.begin();
+ i != edges.end(); ++i) {
SharedPtr<EdgeModel> c = PtrCast<EdgeModel>(i->second);
if (c->tail()->parent() == object
|| c->head()->parent() == object
@@ -521,7 +521,7 @@ ClientStore::disconnect_all(const Raul::Path& parent_patch,
|| c->head()->path() == path) {
c->tail()->disconnected_from(c->head());
c->head()->disconnected_from(c->tail());
- patch->remove_connection(c->tail().get(), c->head().get());
+ patch->remove_edge(c->tail().get(), c->head().get());
}
}
}
diff --git a/src/client/PatchModel.cpp b/src/client/PatchModel.cpp
index e52e4eea..df6f63c0 100644
--- a/src/client/PatchModel.cpp
+++ b/src/client/PatchModel.cpp
@@ -53,9 +53,8 @@ PatchModel::remove_child(SharedPtr<ObjectModel> o)
// Remove any connections which referred to this object,
// since they can't possibly exist anymore
- for (Connections::iterator j = _connections->begin();
- j != _connections->end();) {
- Connections::iterator next = j;
+ for (Edges::iterator j = _edges->begin(); j != _edges->end();) {
+ Edges::iterator next = j;
++next;
SharedPtr<EdgeModel> cm = PtrCast<EdgeModel>(j->second);
@@ -65,8 +64,8 @@ PatchModel::remove_child(SharedPtr<ObjectModel> o)
|| cm->tail_path() == o->path()
|| cm->head_path().parent() == o->path()
|| cm->head_path() == o->path()) {
- _signal_removed_connection.emit(cm);
- _connections->erase(j); // cuts our reference
+ _signal_removed_edge.emit(cm);
+ _edges->erase(j); // cuts our reference
}
j = next;
}
@@ -85,19 +84,19 @@ PatchModel::remove_child(SharedPtr<ObjectModel> o)
void
PatchModel::clear()
{
- _connections->clear();
+ _edges->clear();
NodeModel::clear();
- assert(_connections->empty());
+ assert(_edges->empty());
assert(_ports.empty());
}
SharedPtr<EdgeModel>
-PatchModel::get_connection(const Port* tail, const Ingen::Port* head)
+PatchModel::get_edge(const Port* tail, const Ingen::Port* head)
{
- Connections::iterator i = _connections->find(make_pair(tail, head));
- if (i != _connections->end())
+ Edges::iterator i = _edges->find(make_pair(tail, head));
+ if (i != _edges->end())
return PtrCast<EdgeModel>(i->second);
else
return SharedPtr<EdgeModel>();
@@ -111,7 +110,7 @@ PatchModel::get_connection(const Port* tail, const Ingen::Port* head)
* this patch is a fatal error.
*/
void
-PatchModel::add_connection(SharedPtr<EdgeModel> cm)
+PatchModel::add_edge(SharedPtr<EdgeModel> cm)
{
// Store should have 'resolved' the connection already
assert(cm);
@@ -125,27 +124,27 @@ PatchModel::add_connection(SharedPtr<EdgeModel> cm)
assert(cm->head()->parent().get() == this
|| cm->head()->parent()->parent().get() == this);
- SharedPtr<EdgeModel> existing = get_connection(
+ SharedPtr<EdgeModel> existing = get_edge(
cm->tail().get(), cm->head().get());
if (existing) {
assert(cm->tail() == existing->tail());
assert(cm->head() == existing->head());
} else {
- _connections->insert(make_pair(make_pair(cm->tail().get(),
+ _edges->insert(make_pair(make_pair(cm->tail().get(),
cm->head().get()), cm));
- _signal_new_connection.emit(cm);
+ _signal_new_edge.emit(cm);
}
}
void
-PatchModel::remove_connection(const Port* tail, const Ingen::Port* head)
+PatchModel::remove_edge(const Port* tail, const Ingen::Port* head)
{
- Connections::iterator i = _connections->find(make_pair(tail, head));
- if (i != _connections->end()) {
+ Edges::iterator i = _edges->find(make_pair(tail, head));
+ if (i != _edges->end()) {
SharedPtr<EdgeModel> c = PtrCast<EdgeModel>(i->second);
- _signal_removed_connection.emit(c);
- _connections->erase(i);
+ _signal_removed_edge.emit(c);
+ _edges->erase(i);
} else {
Raul::warn(Raul::fmt("Failed to remove patch connection %1% => %2%\n")
% tail->path() % head->path());
diff --git a/src/gui/Connection.cpp b/src/gui/Edge.cpp
index 0e0093de..9916959e 100644
--- a/src/gui/Connection.cpp
+++ b/src/gui/Edge.cpp
@@ -14,21 +14,16 @@
along with Ingen. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "Connection.hpp"
-#include "Port.hpp"
-
-#include "ingen/client/EdgeModel.hpp"
-
-using namespace std;
+#include "Edge.hpp"
namespace Ingen {
namespace GUI {
-Connection::Connection(Ganv::Canvas& canvas,
- boost::shared_ptr<const Client::EdgeModel> model,
- Ganv::Node* src,
- Ganv::Node* dst,
- uint32_t color)
+Edge::Edge(Ganv::Canvas& canvas,
+ boost::shared_ptr<const Client::EdgeModel> model,
+ Ganv::Node* src,
+ Ganv::Node* dst,
+ uint32_t color)
: Ganv::Edge(canvas, src, dst, color)
, _edge_model(model)
{
diff --git a/src/gui/Connection.hpp b/src/gui/Edge.hpp
index 17d80bc0..99b83cbb 100644
--- a/src/gui/Connection.hpp
+++ b/src/gui/Edge.hpp
@@ -14,11 +14,12 @@
along with Ingen. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef INGEN_GUI_CONNECTION_HPP
-#define INGEN_GUI_CONNECTION_HPP
+#ifndef INGEN_GUI_EDGE_HPP
+#define INGEN_GUI_EDGE_HPP
#include <cassert>
#include <string>
+
#include "ganv/Edge.hpp"
#include "raul/SharedPtr.hpp"
@@ -28,18 +29,18 @@ namespace Client { class EdgeModel; }
namespace GUI {
-/** A Connection in a Patch.
+/** An Edge in a Patch.
*
* \ingroup GUI
*/
-class Connection : public Ganv::Edge
+class Edge : public Ganv::Edge
{
public:
- Connection(Ganv::Canvas& canvas,
- boost::shared_ptr<const Client::EdgeModel> model,
- Ganv::Node* src,
- Ganv::Node* dst,
- uint32_t color);
+ Edge(Ganv::Canvas& canvas,
+ boost::shared_ptr<const Client::EdgeModel> model,
+ Ganv::Node* src,
+ Ganv::Node* dst,
+ uint32_t color);
SharedPtr<const Client::EdgeModel> model() const { return _edge_model; }
@@ -50,4 +51,4 @@ private:
} // namespace GUI
} // namespace Ingen
-#endif // INGEN_GUI_CONNECTION_HPP
+#endif // INGEN_GUI_EDGE_HPP
diff --git a/src/gui/PatchCanvas.cpp b/src/gui/PatchCanvas.cpp
index c8347bcb..20e3e82a 100644
--- a/src/gui/PatchCanvas.cpp
+++ b/src/gui/PatchCanvas.cpp
@@ -35,7 +35,7 @@
#include "raul/log.hpp"
#include "App.hpp"
-#include "Connection.hpp"
+#include "Edge.hpp"
#include "LoadPluginWindow.hpp"
#include "NewSubpatchWindow.hpp"
#include "NodeModule.hpp"
@@ -131,9 +131,9 @@ PatchCanvas::PatchCanvas(App& app,
sigc::mem_fun(this, &PatchCanvas::add_port));
_patch->signal_removed_port().connect(
sigc::mem_fun(this, &PatchCanvas::remove_port));
- _patch->signal_new_connection().connect(
+ _patch->signal_new_edge().connect(
sigc::mem_fun(this, &PatchCanvas::connection));
- _patch->signal_removed_connection().connect(
+ _patch->signal_removed_edge().connect(
sigc::mem_fun(this, &PatchCanvas::disconnection));
_app.store()->signal_new_plugin().connect(
@@ -301,9 +301,9 @@ PatchCanvas::build()
add_port(*i);
}
- // Create connections
- for (PatchModel::Connections::const_iterator i = _patch->connections().begin();
- i != _patch->connections().end(); ++i) {
+ // Create edges
+ for (PatchModel::Edges::const_iterator i = _patch->edges().begin();
+ i != _patch->edges().end(); ++i) {
connection(PtrCast<EdgeModel>(i->second));
}
}
@@ -478,7 +478,7 @@ PatchCanvas::connection(SharedPtr<const EdgeModel> cm)
Ganv::Port* const head = get_port_view(cm->head());
if (tail && head) {
- new GUI::Connection(*this, cm, tail, head, tail->get_fill_color());
+ new GUI::Edge(*this, cm, tail, head, tail->get_fill_color());
} else {
LOG(error) << "Unable to find ports to connect "
<< cm->tail_path() << " -> " << cm->head_path() << endl;
@@ -657,11 +657,11 @@ PatchCanvas::copy_selection()
for (SelectedEdges::const_iterator c = selected_edges().begin();
c != selected_edges().end(); ++c) {
- Connection* const connection = dynamic_cast<Connection*>(*c);
- if (connection) {
+ Edge* const edge = dynamic_cast<Edge*>(*c);
+ if (edge) {
const Sord::URI subject(*_app.world()->rdf_world(),
base_uri);
- serialiser.serialise_connection(subject, connection->model());
+ serialiser.serialise_edge(subject, edge->model());
}
}
diff --git a/src/gui/wscript b/src/gui/wscript
index f0893cbf..6aa80389 100644
--- a/src/gui/wscript
+++ b/src/gui/wscript
@@ -31,7 +31,7 @@ def build(bld):
BreadCrumbs.cpp
Configuration.cpp
ConnectWindow.cpp
- Connection.cpp
+ Edge.cpp
LoadPatchWindow.cpp
LoadPluginWindow.cpp
MessagesWindow.cpp
diff --git a/src/serialisation/Serialiser.cpp b/src/serialisation/Serialiser.cpp
index 2d8f9d70..6e126c42 100644
--- a/src/serialisation/Serialiser.cpp
+++ b/src/serialisation/Serialiser.cpp
@@ -28,7 +28,7 @@
#include <glibmm/miscutils.h>
#include <glibmm/module.h>
-#include "ingen/Connection.hpp"
+#include "ingen/Edge.hpp"
#include "ingen/Interface.hpp"
#include "ingen/Node.hpp"
#include "ingen/Patch.hpp"
@@ -93,8 +93,8 @@ struct Serialiser::Impl {
SharedPtr<const Patch> patch,
const std::string& patch_symbol);
- void serialise_connection(const Sord::Node& parent,
- SharedPtr<const Connection> c)
+ void serialise_edge(const Sord::Node& parent,
+ SharedPtr<const Edge> c)
throw (std::logic_error);
std::string finish();
@@ -440,9 +440,9 @@ Serialiser::Impl::serialise_patch(SharedPtr<const Patch> patch,
serialise_port(p, Resource::INTERNAL, port_id);
}
- for (Patch::Connections::const_iterator c = patch->connections().begin();
- c != patch->connections().end(); ++c) {
- serialise_connection(patch_id, c->second);
+ for (Patch::Edges::const_iterator c = patch->edges().begin();
+ c != patch->edges().end(); ++c) {
+ serialise_edge(patch_id, c->second);
}
}
@@ -498,37 +498,37 @@ Serialiser::Impl::serialise_port(const Port* port,
}
void
-Serialiser::serialise_connection(const Sord::Node& parent,
- SharedPtr<const Connection> connection)
+Serialiser::serialise_edge(const Sord::Node& parent,
+ SharedPtr<const Edge> edge)
throw (std::logic_error)
{
- return me->serialise_connection(parent, connection);
+ return me->serialise_edge(parent, edge);
}
void
-Serialiser::Impl::serialise_connection(const Sord::Node& parent,
- SharedPtr<const Connection> connection)
+Serialiser::Impl::serialise_edge(const Sord::Node& parent,
+ SharedPtr<const Edge> edge)
throw (std::logic_error)
{
if (!_model)
throw std::logic_error(
- "serialise_connection called without serialisation in progress");
+ "serialise_edge called without serialisation in progress");
Sord::World& world = _model->world();
- const Sord::Node src = path_rdf_node(connection->tail_path());
- const Sord::Node dst = path_rdf_node(connection->head_path());
- const Sord::Node connection_id = Sord::Node::blank_id(*_world.rdf_world());
- _model->add_statement(connection_id,
+ const Sord::Node src = path_rdf_node(edge->tail_path());
+ const Sord::Node dst = path_rdf_node(edge->head_path());
+ const Sord::Node edge_id = Sord::Node::blank_id(*_world.rdf_world());
+ _model->add_statement(edge_id,
Sord::Curie(world, "ingen:tail"),
src);
- _model->add_statement(connection_id,
+ _model->add_statement(edge_id,
Sord::Curie(world, "ingen:head"),
dst);
_model->add_statement(parent,
Sord::Curie(world, "ingen:edge"),
- connection_id);
+ edge_id);
}
static bool
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
diff --git a/src/shared/Builder.cpp b/src/shared/Builder.cpp
index c79181ff..b3f005f1 100644
--- a/src/shared/Builder.cpp
+++ b/src/shared/Builder.cpp
@@ -14,7 +14,7 @@
along with Ingen. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ingen/Connection.hpp"
+#include "ingen/Edge.hpp"
#include "ingen/Interface.hpp"
#include "ingen/Node.hpp"
#include "ingen/Patch.hpp"
@@ -51,10 +51,10 @@ Builder::build(SharedPtr<const GraphObject> object)
}
build_object(object);
- /*for (Patch::Connections::const_iterator i = patch->connections().begin();
- i != patch->connections().end(); ++i) {
- _interface.connect((*i)->src_port_path(), (*i)->dst_port_path());
- }*/
+ /*for (Patch::Edges::const_iterator i = patch->edges().begin();
+ i != patch->edges().end(); ++i) {
+ _interface.connect((*i)->src_port_path(), (*i)->dst_port_path());
+ }*/
return;
}
@@ -82,8 +82,8 @@ Builder::connect(SharedPtr<const GraphObject> object)
{
SharedPtr<const Patch> patch = PtrCast<const Patch>(object);
if (patch) {
- for (Patch::Connections::const_iterator i = patch->connections().begin();
- i != patch->connections().end(); ++i) {
+ for (Patch::Edges::const_iterator i = patch->edges().begin();
+ i != patch->edges().end(); ++i) {
_interface.connect(i->second->tail_path(), i->second->head_path());
}
return;
diff --git a/src/shared/World.cpp b/src/shared/World.cpp
index 9873246f..d5c29e9c 100644
--- a/src/shared/World.cpp
+++ b/src/shared/World.cpp
@@ -104,8 +104,8 @@ public:
, argv(a_argv)
, lv2_features(NULL)
, rdf_world(new Sord::World())
- , forge(new Ingen::Forge(*uri_map))
, uri_map(new Ingen::Shared::URIMap(map, unmap))
+ , forge(new Ingen::Forge(*uri_map))
, uris(new Shared::URIs(*forge, uri_map))
, lilv_world(lilv_world_new())
{
@@ -144,9 +144,9 @@ public:
delete rdf_world;
delete lv2_features;
+ delete uris;
delete forge;
delete uri_map;
- delete uris;
}
typedef std::map< const std::string, SharedPtr<Module> > Modules;
@@ -164,8 +164,8 @@ public:
Shared::Configuration conf;
LV2Features* lv2_features;
Sord::World* rdf_world;
- Ingen::Forge* forge;
URIMap* uri_map;
+ Ingen::Forge* forge;
URIs* uris;
SharedPtr<Interface> interface;
SharedPtr<EngineBase> engine;