summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-12-13 17:51:55 -0500
committerDavid Robillard <d@drobilla.net>2016-12-13 19:15:29 -0500
commitad43d2e08cea225635b56c5473a768bc853ecda3 (patch)
tree472a8c6dc605ba63903206a14549e8340efcf137
parent0752556bde5659a933744658cdf63509000a5080 (diff)
downloadingen-ad43d2e08cea225635b56c5473a768bc853ecda3.tar.gz
ingen-ad43d2e08cea225635b56c5473a768bc853ecda3.tar.bz2
ingen-ad43d2e08cea225635b56c5473a768bc853ecda3.zip
Remove virtual inheritance from Port hierarchy
This was confusing stoat, and is questionable design anyway. The OutputPort functionality has been moved to PortImpl, which is a basic port with buffers suitable for use as an output, and is overridden by InputPort and DuplexPort where necessary.
-rw-r--r--src/server/ArcImpl.cpp4
-rw-r--r--src/server/ArcImpl.hpp5
-rw-r--r--src/server/DuplexPort.cpp24
-rw-r--r--src/server/DuplexPort.hpp12
-rw-r--r--src/server/GraphImpl.hpp2
-rw-r--r--src/server/InputPort.cpp7
-rw-r--r--src/server/InputPort.hpp12
-rw-r--r--src/server/LV2Block.cpp1
-rw-r--r--src/server/OutputPort.cpp99
-rw-r--r--src/server/OutputPort.hpp28
-rw-r--r--src/server/PortImpl.cpp58
-rw-r--r--src/server/PortImpl.hpp41
-rw-r--r--src/server/events/Connect.cpp5
-rw-r--r--src/server/events/Connect.hpp1
-rw-r--r--src/server/events/CreatePort.cpp3
-rw-r--r--src/server/events/Disconnect.cpp5
-rw-r--r--src/server/events/Disconnect.hpp15
-rw-r--r--src/server/events/DisconnectAll.cpp3
-rw-r--r--src/server/wscript1
19 files changed, 130 insertions, 196 deletions
diff --git a/src/server/ArcImpl.cpp b/src/server/ArcImpl.cpp
index 8cdf02b4..1dd92d48 100644
--- a/src/server/ArcImpl.cpp
+++ b/src/server/ArcImpl.cpp
@@ -1,6 +1,6 @@
/*
This file is part of Ingen.
- Copyright 2007-2015 David Robillard <http://drobilla.net/>
+ Copyright 2007-2016 David Robillard <http://drobilla.net/>
Ingen is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free
@@ -82,7 +82,7 @@ ArcImpl::must_mix() const
}
bool
-ArcImpl::can_connect(const OutputPort* src, const InputPort* dst)
+ArcImpl::can_connect(const PortImpl* src, const InputPort* dst)
{
const Ingen::URIs& uris = src->bufs().uris();
return (
diff --git a/src/server/ArcImpl.hpp b/src/server/ArcImpl.hpp
index 01984ba6..c796384a 100644
--- a/src/server/ArcImpl.hpp
+++ b/src/server/ArcImpl.hpp
@@ -1,6 +1,6 @@
/*
This file is part of Ingen.
- Copyright 2007-2015 David Robillard <http://drobilla.net/>
+ Copyright 2007-2016 David Robillard <http://drobilla.net/>
Ingen is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free
@@ -32,7 +32,6 @@ namespace Ingen {
namespace Server {
class PortImpl;
-class OutputPort;
class InputPort;
/** Represents a single inbound connection for an InputPort.
@@ -72,7 +71,7 @@ public:
/** Whether this arc must mix down voices into a local buffer */
bool must_mix() const;
- static bool can_connect(const OutputPort* src, const InputPort* dst);
+ static bool can_connect(const PortImpl* src, const InputPort* dst);
protected:
PortImpl* const _tail;
diff --git a/src/server/DuplexPort.cpp b/src/server/DuplexPort.cpp
index 7e0e3cce..5eff4add 100644
--- a/src/server/DuplexPort.cpp
+++ b/src/server/DuplexPort.cpp
@@ -1,6 +1,6 @@
/*
This file is part of Ingen.
- Copyright 2007-2015 David Robillard <http://drobilla.net/>
+ Copyright 2007-2016 David Robillard <http://drobilla.net/>
Ingen is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free
@@ -21,7 +21,6 @@
#include "DuplexPort.hpp"
#include "Engine.hpp"
#include "GraphImpl.hpp"
-#include "OutputPort.hpp"
using namespace std;
@@ -38,10 +37,7 @@ DuplexPort::DuplexPort(BufferFactory& bufs,
size_t buf_size,
const Atom& value,
bool is_output)
- : PortImpl(bufs, parent, symbol, index, parent->polyphony(), type, buf_type, value, buf_size)
- , InputPort(bufs, parent, symbol, index, parent->polyphony(), type, buf_type, value, buf_size)
- , OutputPort(bufs, parent, symbol, index, parent->polyphony(), type, buf_type, value, buf_size)
- , _is_output(is_output)
+ : InputPort(bufs, parent, symbol, index, parent->polyphony(), type, buf_type, value, buf_size)
{
if (polyphonic) {
set_property(bufs.uris().ingen_polyphonic, bufs.forge().make(true));
@@ -57,6 +53,16 @@ DuplexPort::DuplexPort(BufferFactory& bufs,
set_property(bufs.uris().lv2_minimum, bufs.forge().make(0.0f));
set_property(bufs.uris().lv2_maximum, bufs.forge().make(1.0f));
}
+
+ _is_output = is_output;
+ if (is_output) {
+ if (parent->graph_type() != Node::GraphType::GRAPH) {
+ remove_property(bufs.uris().rdf_type, bufs.uris().lv2_InputPort.urid);
+ add_property(bufs.uris().rdf_type, bufs.uris().lv2_OutputPort.urid);
+ }
+ }
+
+ get_buffers(bufs, _voices, parent->polyphony(), false);
}
DuplexPort::~DuplexPort()
@@ -132,7 +138,7 @@ DuplexPort::get_buffers(BufferFactory& bufs,
if (_is_output) {
return InputPort::get_buffers(bufs, voices, poly, real_time);
} else {
- return OutputPort::get_buffers(bufs, voices, poly, real_time);
+ return PortImpl::get_buffers(bufs, voices, poly, real_time);
}
}
return false;
@@ -215,13 +221,13 @@ DuplexPort::post_process(RunContext& context)
SampleCount
DuplexPort::next_value_offset(SampleCount offset, SampleCount end) const
{
- return OutputPort::next_value_offset(offset, end);
+ return PortImpl::next_value_offset(offset, end);
}
void
DuplexPort::update_values(SampleCount offset, uint32_t voice)
{
- return OutputPort::update_values(offset, voice);
+ return PortImpl::update_values(offset, voice);
}
} // namespace Server
diff --git a/src/server/DuplexPort.hpp b/src/server/DuplexPort.hpp
index 836faa36..adf32a88 100644
--- a/src/server/DuplexPort.hpp
+++ b/src/server/DuplexPort.hpp
@@ -1,6 +1,6 @@
/*
This file is part of Ingen.
- Copyright 2007-2015 David Robillard <http://drobilla.net/>
+ Copyright 2007-2016 David Robillard <http://drobilla.net/>
Ingen is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free
@@ -21,14 +21,13 @@
#include "BufferRef.hpp"
#include "InputPort.hpp"
-#include "OutputPort.hpp"
namespace Ingen {
namespace Server {
class BlockImpl;
-/** A duplex Port (both an InputPort and an OutputPort on a Graph)
+/** A duplex Port (both an input and output port on a Graph)
*
* This is used for Graph ports, since they need to appear as both an input and
* an output port based on context. There are no actual duplex ports in Ingen,
@@ -38,7 +37,6 @@ class BlockImpl;
* \ingroup engine
*/
class DuplexPort : public InputPort
- , public OutputPort
, public boost::intrusive::slist_base_hook<> // In GraphImpl
{
public:
@@ -91,12 +89,6 @@ public:
SampleCount next_value_offset(SampleCount offset, SampleCount end) const;
void update_values(SampleCount offset, uint32_t voice);
-
- bool is_input() const { return !_is_output; }
- bool is_output() const { return _is_output; }
-
-protected:
- bool _is_output;
};
} // namespace Server
diff --git a/src/server/GraphImpl.hpp b/src/server/GraphImpl.hpp
index f7d0be32..57e60792 100644
--- a/src/server/GraphImpl.hpp
+++ b/src/server/GraphImpl.hpp
@@ -123,11 +123,13 @@ public:
void add_input(DuplexPort& port) {
ThreadManager::assert_thread(THREAD_PRE_PROCESS);
+ assert(port.is_input());
_inputs.push_front(port);
}
void add_output(DuplexPort& port) {
ThreadManager::assert_thread(THREAD_PRE_PROCESS);
+ assert(port.is_output());
_outputs.push_front(port);
}
diff --git a/src/server/InputPort.cpp b/src/server/InputPort.cpp
index 4e1ced3e..61ce0c05 100644
--- a/src/server/InputPort.cpp
+++ b/src/server/InputPort.cpp
@@ -1,6 +1,6 @@
/*
This file is part of Ingen.
- Copyright 2007-2015 David Robillard <http://drobilla.net/>
+ Copyright 2007-2016 David Robillard <http://drobilla.net/>
Ingen is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free
@@ -27,7 +27,6 @@
#include "Engine.hpp"
#include "GraphImpl.hpp"
#include "InputPort.hpp"
-#include "OutputPort.hpp"
#include "RunContext.hpp"
#include "mix.hpp"
@@ -45,7 +44,7 @@ InputPort::InputPort(BufferFactory& bufs,
LV2_URID buffer_type,
const Atom& value,
size_t buffer_size)
- : PortImpl(bufs, parent, symbol, index, poly, type, buffer_type, value, buffer_size)
+ : PortImpl(bufs, parent, symbol, index, poly, type, buffer_type, value, buffer_size, false)
, _num_arcs(0)
{
const Ingen::URIs& uris = bufs.uris();
@@ -118,7 +117,7 @@ InputPort::add_arc(RunContext& context, ArcImpl* c)
}
ArcImpl*
-InputPort::remove_arc(RunContext& context, const OutputPort* tail)
+InputPort::remove_arc(RunContext& context, const PortImpl* tail)
{
ArcImpl* arc = NULL;
for (Arcs::iterator i = _arcs.begin(); i != _arcs.end(); ++i) {
diff --git a/src/server/InputPort.hpp b/src/server/InputPort.hpp
index f93aa4df..1a27ac93 100644
--- a/src/server/InputPort.hpp
+++ b/src/server/InputPort.hpp
@@ -1,6 +1,6 @@
/*
This file is part of Ingen.
- Copyright 2007-2015 David Robillard <http://drobilla.net/>
+ Copyright 2007-2016 David Robillard <http://drobilla.net/>
Ingen is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free
@@ -32,7 +32,6 @@ namespace Server {
class ArcImpl;
class BlockImpl;
-class OutputPort;
class RunContext;
/** An input port on a Block or Graph.
@@ -46,7 +45,7 @@ class RunContext;
*
* \ingroup engine
*/
-class InputPort : virtual public PortImpl
+class InputPort : public PortImpl
{
public:
InputPort(BufferFactory& bufs,
@@ -83,8 +82,8 @@ public:
*
* setup_buffers() must be called later for the change to take effect.
*/
- ArcImpl* remove_arc(RunContext& context,
- const OutputPort* tail);
+ ArcImpl* remove_arc(RunContext& context,
+ const PortImpl* tail);
/** Set `voices` as the buffers to be used for this port.
*
@@ -111,9 +110,6 @@ public:
void increment_num_arcs() { ++_num_arcs; }
void decrement_num_arcs() { --_num_arcs; }
- bool is_input() const { return true; }
- bool is_output() const { return false; }
-
bool direct_connect() const;
protected:
diff --git a/src/server/LV2Block.cpp b/src/server/LV2Block.cpp
index c20abfda..be02f3ed 100644
--- a/src/server/LV2Block.cpp
+++ b/src/server/LV2Block.cpp
@@ -43,6 +43,7 @@
#include "LV2Block.hpp"
#include "LV2Plugin.hpp"
#include "OutputPort.hpp"
+#include "PortImpl.hpp"
#include "RunContext.hpp"
#include "Worker.hpp"
diff --git a/src/server/OutputPort.cpp b/src/server/OutputPort.cpp
deleted file mode 100644
index 4121c6a9..00000000
--- a/src/server/OutputPort.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- This file is part of Ingen.
- Copyright 2007-2015 David Robillard <http://drobilla.net/>
-
- Ingen is free software: you can redistribute it and/or modify it under the
- terms of the GNU Affero General Public License as published by the Free
- Software Foundation, either version 3 of the License, or 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 Affero General Public License for details.
-
- You should have received a copy of the GNU Affero General Public License
- along with Ingen. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "ingen/URIs.hpp"
-
-#include "Buffer.hpp"
-#include "BufferFactory.hpp"
-#include "Engine.hpp"
-#include "BlockImpl.hpp"
-#include "OutputPort.hpp"
-
-using namespace std;
-
-namespace Ingen {
-namespace Server {
-
-OutputPort::OutputPort(BufferFactory& bufs,
- BlockImpl* parent,
- const Raul::Symbol& symbol,
- uint32_t index,
- uint32_t poly,
- PortType type,
- LV2_URID buffer_type,
- const Atom& value,
- size_t buffer_size)
- : PortImpl(bufs, parent, symbol, index, poly, type, buffer_type, value, buffer_size)
-{
- if (parent->graph_type() != Node::GraphType::GRAPH) {
- add_property(bufs.uris().rdf_type, bufs.uris().lv2_OutputPort.urid);
- }
-
- setup_buffers(bufs, poly, false);
-}
-
-bool
-OutputPort::get_buffers(BufferFactory& bufs,
- Raul::Array<Voice>* voices,
- uint32_t poly,
- bool real_time) const
-{
- for (uint32_t v = 0; v < poly; ++v)
- voices->at(v).buffer = bufs.get_buffer(
- buffer_type(), _value.type(), _buffer_size, real_time);
-
- return true;
-}
-
-void
-OutputPort::pre_process(RunContext& context)
-{
- for (uint32_t v = 0; v < _poly; ++v)
- _voices->at(v).buffer->prepare_output_write(context);
-}
-
-SampleCount
-OutputPort::next_value_offset(SampleCount offset, SampleCount end) const
-{
- SampleCount earliest = end;
- for (uint32_t v = 0; v < _poly; ++v) {
- const SampleCount o = _voices->at(v).buffer->next_value_offset(offset, end);
- if (o < earliest) {
- earliest = o;
- }
- }
- return earliest;
-}
-
-void
-OutputPort::update_values(SampleCount offset, uint32_t voice)
-{
- _voices->at(voice).buffer->update_value_buffer(offset);
-}
-
-void
-OutputPort::post_process(RunContext& context)
-{
- for (uint32_t v = 0; v < _poly; ++v) {
- update_set_state(context, v);
- update_values(0, v);
- }
-
- monitor(context);
-}
-
-} // namespace Server
-} // namespace Ingen
diff --git a/src/server/OutputPort.hpp b/src/server/OutputPort.hpp
index 68c79768..1058defb 100644
--- a/src/server/OutputPort.hpp
+++ b/src/server/OutputPort.hpp
@@ -1,6 +1,6 @@
/*
This file is part of Ingen.
- Copyright 2007-2015 David Robillard <http://drobilla.net/>
+ Copyright 2007-2016 David Robillard <http://drobilla.net/>
Ingen is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free
@@ -17,8 +17,6 @@
#ifndef INGEN_ENGINE_OUTPUTPORT_HPP
#define INGEN_ENGINE_OUTPUTPORT_HPP
-#include <cstdlib>
-
#include "PortImpl.hpp"
namespace Ingen {
@@ -27,11 +25,11 @@ namespace Server {
/** An output port.
*
* Output ports always have a locally allocated buffer, and buffer() will
- * always return that buffer. (This is very different from InputPort)
+ * always return that buffer.
*
* \ingroup engine
*/
-class OutputPort : virtual public PortImpl
+class OutputPort : public PortImpl
{
public:
OutputPort(BufferFactory& bufs,
@@ -42,23 +40,9 @@ public:
PortType type,
LV2_URID buffer_type,
const Atom& value,
- size_t buffer_size = 0);
-
- virtual ~OutputPort() {}
-
- bool get_buffers(BufferFactory& bufs,
- Raul::Array<Voice>* voices,
- uint32_t poly,
- bool real_time) const;
-
- void pre_process(RunContext& context);
- void post_process(RunContext& context);
-
- SampleCount next_value_offset(SampleCount offset, SampleCount end) const;
- void update_values(SampleCount offset, uint32_t voice);
-
- bool is_input() const { return false; }
- bool is_output() const { return true; }
+ size_t buffer_size = 0)
+ : PortImpl(bufs, parent, symbol, index,poly, type, buffer_type, value, buffer_size, true)
+ {}
};
} // namespace Server
diff --git a/src/server/PortImpl.cpp b/src/server/PortImpl.cpp
index 1f1b3695..669e4b9d 100644
--- a/src/server/PortImpl.cpp
+++ b/src/server/PortImpl.cpp
@@ -51,7 +51,8 @@ PortImpl::PortImpl(BufferFactory& bufs,
PortType type,
LV2_URID buffer_type,
const Atom& value,
- size_t buffer_size)
+ size_t buffer_size,
+ bool is_output)
: NodeImpl(bufs.uris(), block, name)
, _bufs(bufs)
, _index(index)
@@ -75,6 +76,7 @@ PortImpl::PortImpl(BufferFactory& bufs,
, _is_sample_rate(false)
, _is_toggled(false)
, _is_driver_port(false)
+ , _is_output(is_output)
{
assert(block != NULL);
assert(_poly > 0);
@@ -91,6 +93,14 @@ PortImpl::PortImpl(BufferFactory& bufs,
set_property(uris.atom_bufferType,
bufs.forge().make_urid(buffer_type));
}
+
+ if (is_output) {
+ if (_parent->graph_type() != Node::GraphType::GRAPH) {
+ add_property(bufs.uris().rdf_type, bufs.uris().lv2_OutputPort.urid);
+ }
+
+ setup_buffers(bufs, poly, false);
+ }
}
PortImpl::~PortImpl()
@@ -98,6 +108,19 @@ PortImpl::~PortImpl()
delete _voices;
}
+bool
+PortImpl::get_buffers(BufferFactory& bufs,
+ Raul::Array<Voice>* voices,
+ uint32_t poly,
+ bool real_time) const
+{
+ for (uint32_t v = 0; v < poly; ++v)
+ voices->at(v).buffer = bufs.get_buffer(
+ buffer_type(), _value.type(), _buffer_size, real_time);
+
+ return true;
+}
+
void
PortImpl::set_type(PortType port_type, LV2_URID buffer_type)
{
@@ -505,7 +528,38 @@ PortImpl::value_buffer(uint32_t voice)
SampleCount
PortImpl::next_value_offset(SampleCount offset, SampleCount end) const
{
- return end;
+ SampleCount earliest = end;
+ for (uint32_t v = 0; v < _poly; ++v) {
+ const SampleCount o = _voices->at(v).buffer->next_value_offset(offset, end);
+ if (o < earliest) {
+ earliest = o;
+ }
+ }
+ return earliest;
+}
+
+void
+PortImpl::update_values(SampleCount offset, uint32_t voice)
+{
+ _voices->at(voice).buffer->update_value_buffer(offset);
+}
+
+void
+PortImpl::pre_process(RunContext& context)
+{
+ for (uint32_t v = 0; v < _poly; ++v)
+ _voices->at(v).buffer->prepare_output_write(context);
+}
+
+void
+PortImpl::post_process(RunContext& context)
+{
+ for (uint32_t v = 0; v < _poly; ++v) {
+ update_set_state(context, v);
+ update_values(0, v);
+ }
+
+ monitor(context);
}
} // namespace Server
diff --git a/src/server/PortImpl.hpp b/src/server/PortImpl.hpp
index 94fdd50c..05ca3ff4 100644
--- a/src/server/PortImpl.hpp
+++ b/src/server/PortImpl.hpp
@@ -1,6 +1,6 @@
/*
This file is part of Ingen.
- Copyright 2007-2015 David Robillard <http://drobilla.net/>
+ Copyright 2007-2016 David Robillard <http://drobilla.net/>
Ingen is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free
@@ -38,6 +38,10 @@ class BufferFactory;
/** A port (input or output) on a Block.
*
+ * The base implementation here is general and/or for output ports (which are
+ * simplest), InputPort and DuplexPort override functions to provide
+ * specialized behaviour where necessary.
+ *
* \ingroup engine
*/
class PortImpl : public NodeImpl
@@ -80,6 +84,17 @@ public:
BufferRef buffer;
};
+ PortImpl(BufferFactory& bufs,
+ BlockImpl* block,
+ const Raul::Symbol& name,
+ uint32_t index,
+ uint32_t poly,
+ PortType type,
+ LV2_URID buffer_type,
+ const Atom& value,
+ size_t buffer_size = 0,
+ bool is_output = true);
+
~PortImpl();
virtual GraphType graph_type() const { return GraphType::PORT; }
@@ -153,9 +168,9 @@ public:
bool is_driver_port() const { return _is_driver_port; }
/** Called once per process cycle */
- virtual void pre_process(RunContext& context) = 0;
+ virtual void pre_process(RunContext& context);
virtual void pre_run(RunContext& context) {}
- virtual void post_process(RunContext& context) = 0;
+ virtual void post_process(RunContext& context);
/** Empty buffer contents completely (ie silence) */
virtual void clear_buffers();
@@ -164,7 +179,7 @@ public:
virtual bool get_buffers(BufferFactory& bufs,
Raul::Array<Voice>* voices,
uint32_t poly,
- bool real_time) const = 0;
+ bool real_time) const;
void setup_buffers(BufferFactory& bufs, uint32_t poly, bool real_time) {
get_buffers(bufs, _voices, poly, real_time);
@@ -186,9 +201,6 @@ public:
virtual void connect_buffers(SampleCount offset=0);
virtual void recycle_buffers();
- virtual bool is_input() const = 0;
- virtual bool is_output() const = 0;
-
uint32_t index() const { return _index; }
inline bool is_a(PortType type) const { return _type == type; }
@@ -238,7 +250,7 @@ public:
SampleCount end) const;
/** Update value buffer for `voice` to be current as of `offset`. */
- virtual void update_values(SampleCount offset, uint32_t voice) = 0;
+ virtual void update_values(SampleCount offset, uint32_t voice);
void force_monitor_update() { _force_monitor_update = true; }
@@ -251,6 +263,8 @@ public:
void cache_properties();
+ bool is_input() const { return !_is_output; }
+ bool is_output() const { return _is_output; }
bool is_morph() const { return _is_morph; }
bool is_auto_morph() const { return _is_auto_morph; }
bool is_logarithmic() const { return _is_logarithmic; }
@@ -258,16 +272,6 @@ public:
bool is_toggled() const { return _is_toggled; }
protected:
- PortImpl(BufferFactory& bufs,
- BlockImpl* block,
- const Raul::Symbol& name,
- uint32_t index,
- uint32_t poly,
- PortType type,
- LV2_URID buffer_type,
- const Atom& value,
- size_t buffer_size);
-
BufferFactory& _bufs;
uint32_t _index;
uint32_t _poly;
@@ -291,6 +295,7 @@ protected:
bool _is_sample_rate;
bool _is_toggled;
bool _is_driver_port;
+ bool _is_output;
};
} // namespace Server
diff --git a/src/server/events/Connect.cpp b/src/server/events/Connect.cpp
index 34dc569e..c24fc2bb 100644
--- a/src/server/events/Connect.cpp
+++ b/src/server/events/Connect.cpp
@@ -24,7 +24,6 @@
#include "Engine.hpp"
#include "GraphImpl.hpp"
#include "InputPort.hpp"
-#include "OutputPort.hpp"
#include "PortImpl.hpp"
#include "PreProcessContext.hpp"
#include "internals/BlockDelay.hpp"
@@ -64,8 +63,8 @@ Connect::pre_process(PreProcessContext& ctx)
return Event::pre_process_done(Status::NOT_FOUND, _head_path);
}
- OutputPort* tail_output = dynamic_cast<OutputPort*>(tail);
- _head = dynamic_cast<InputPort*>(head);
+ PortImpl* tail_output = dynamic_cast<PortImpl*>(tail);
+ _head = dynamic_cast<InputPort*>(head);
if (!tail_output || !_head) {
return Event::pre_process_done(Status::BAD_REQUEST, _head_path);
}
diff --git a/src/server/events/Connect.hpp b/src/server/events/Connect.hpp
index 9b98b167..359c9f3b 100644
--- a/src/server/events/Connect.hpp
+++ b/src/server/events/Connect.hpp
@@ -34,7 +34,6 @@ class ArcImpl;
class CompiledGraph;
class GraphImpl;
class InputPort;
-class OutputPort;
namespace Events {
diff --git a/src/server/events/CreatePort.cpp b/src/server/events/CreatePort.cpp
index 60e57a71..bb8bb4d4 100644
--- a/src/server/events/CreatePort.cpp
+++ b/src/server/events/CreatePort.cpp
@@ -141,7 +141,8 @@ CreatePort::pre_process(PreProcessContext& ctx)
polyphonic,
_port_type, _buf_type, buf_size,
value, _flow == Flow::OUTPUT);
-
+ assert((_flow == Flow::OUTPUT && _graph_port->is_output()) ||
+ (_flow == Flow::INPUT && _graph_port->is_input()));
_graph_port->properties().insert(_properties.begin(), _properties.end());
_engine.store()->add(_graph_port);
diff --git a/src/server/events/Disconnect.cpp b/src/server/events/Disconnect.cpp
index 40b85c22..8875eb0c 100644
--- a/src/server/events/Disconnect.cpp
+++ b/src/server/events/Disconnect.cpp
@@ -27,7 +27,6 @@
#include "Engine.hpp"
#include "GraphImpl.hpp"
#include "InputPort.hpp"
-#include "OutputPort.hpp"
#include "PortImpl.hpp"
#include "PreProcessContext.hpp"
#include "RunContext.hpp"
@@ -61,7 +60,7 @@ Disconnect::~Disconnect()
Disconnect::Impl::Impl(Engine& e,
GraphImpl* graph,
- OutputPort* t,
+ PortImpl* t,
InputPort* h)
: _engine(e)
, _tail(t)
@@ -165,7 +164,7 @@ Disconnect::pre_process(PreProcessContext& ctx)
_impl = new Impl(_engine,
_graph,
- dynamic_cast<OutputPort*>(tail),
+ dynamic_cast<PortImpl*>(tail),
dynamic_cast<InputPort*>(head));
if (ctx.must_compile(_graph)) {
diff --git a/src/server/events/Disconnect.hpp b/src/server/events/Disconnect.hpp
index 19ffcf3b..fa16f01f 100644
--- a/src/server/events/Disconnect.hpp
+++ b/src/server/events/Disconnect.hpp
@@ -33,7 +33,6 @@ namespace Server {
class CompiledGraph;
class InputPort;
-class OutputPort;
class PortImpl;
namespace Events {
@@ -61,19 +60,19 @@ public:
class Impl {
public:
- Impl(Engine& e,
- GraphImpl* graph,
- OutputPort* t,
- InputPort* h);
+ Impl(Engine& e,
+ GraphImpl* graph,
+ PortImpl* t,
+ InputPort* h);
bool execute(RunContext& context, bool set_head_buffers);
- inline OutputPort* tail() { return _tail; }
- inline InputPort* head() { return _head; }
+ inline PortImpl* tail() { return _tail; }
+ inline InputPort* head() { return _head; }
private:
Engine& _engine;
- OutputPort* _tail;
+ PortImpl* _tail;
InputPort* _head;
SPtr<ArcImpl> _arc;
Raul::Array<PortImpl::Voice>* _voices;
diff --git a/src/server/events/DisconnectAll.cpp b/src/server/events/DisconnectAll.cpp
index 8ce14e74..597f8e9b 100644
--- a/src/server/events/DisconnectAll.cpp
+++ b/src/server/events/DisconnectAll.cpp
@@ -29,7 +29,6 @@
#include "Engine.hpp"
#include "GraphImpl.hpp"
#include "InputPort.hpp"
-#include "OutputPort.hpp"
#include "PortImpl.hpp"
#include "PreProcessContext.hpp"
#include "events/Disconnect.hpp"
@@ -135,7 +134,7 @@ DisconnectAll::pre_process(PreProcessContext& ctx)
for (const auto& a : to_remove) {
_impls.push_back(new Disconnect::Impl(
_engine, _parent,
- dynamic_cast<OutputPort*>(a->tail()),
+ dynamic_cast<PortImpl*>(a->tail()),
dynamic_cast<InputPort*>(a->head())));
}
diff --git a/src/server/wscript b/src/server/wscript
index 68c1c5f1..1d4b8ac2 100644
--- a/src/server/wscript
+++ b/src/server/wscript
@@ -22,7 +22,6 @@ def build(bld):
LV2Block.cpp
LV2Plugin.cpp
NodeImpl.cpp
- OutputPort.cpp
PortImpl.cpp
PostProcessor.cpp
PreProcessor.cpp