summaryrefslogtreecommitdiffstats
path: root/src/server/DuplexPort.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-09-02 02:18:36 +0000
committerDavid Robillard <d@drobilla.net>2014-09-02 02:18:36 +0000
commit84ea08aab648697b766a8b98949f13a0b4d61a95 (patch)
tree1c767fe7104f51835418118b42b9691accdabd87 /src/server/DuplexPort.cpp
parenta2792bd09212eed55bba1aa30dc09043a6955486 (diff)
downloadingen-84ea08aab648697b766a8b98949f13a0b4d61a95.tar.gz
ingen-84ea08aab648697b766a8b98949f13a0b4d61a95.tar.bz2
ingen-84ea08aab648697b766a8b98949f13a0b4d61a95.zip
Fix polyphonic subgraph outputs in a monophonic parent graph.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5464 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/DuplexPort.cpp')
-rw-r--r--src/server/DuplexPort.cpp34
1 files changed, 31 insertions, 3 deletions
diff --git a/src/server/DuplexPort.cpp b/src/server/DuplexPort.cpp
index 0713c35a..1dd1672f 100644
--- a/src/server/DuplexPort.cpp
+++ b/src/server/DuplexPort.cpp
@@ -48,6 +48,11 @@ DuplexPort::DuplexPort(BufferFactory& bufs,
set_property(bufs.uris().ingen_polyphonic, bufs.forge().make(true));
}
+ if (!parent->parent() ||
+ _poly != parent->parent_graph()->internal_poly()) {
+ _poly = 1;
+ }
+
// Set default control range
if (!is_output && value.type() == bufs.uris().atom_Float) {
set_property(bufs.uris().lv2_minimum, bufs.forge().make(0.0f));
@@ -118,7 +123,29 @@ DuplexPort::get_buffers(BufferFactory& bufs,
uint32_t
DuplexPort::max_tail_poly(Context& context) const
{
- return parent_graph()->internal_poly_process();
+ return std::max(_poly, parent_graph()->internal_poly_process());
+}
+
+bool
+DuplexPort::prepare_poly(BufferFactory& bufs, uint32_t poly)
+{
+ if (!parent()->parent() ||
+ poly != parent()->parent_graph()->internal_poly()) {
+ return false;
+ }
+
+ return PortImpl::prepare_poly(bufs, poly);
+}
+
+bool
+DuplexPort::apply_poly(ProcessContext& context, Raul::Maid& maid, uint32_t poly)
+{
+ if (!parent()->parent() ||
+ poly != parent()->parent_graph()->internal_poly()) {
+ return false;
+ }
+
+ return PortImpl::apply_poly(context, maid, poly);
}
void
@@ -136,6 +163,7 @@ DuplexPort::pre_process(Context& context)
perspective. Do whatever a normal block's input port does to
prepare input for reading. */
InputPort::pre_process(context);
+ InputPort::pre_run(context);
}
}
@@ -160,9 +188,9 @@ DuplexPort::next_value_offset(SampleCount offset, SampleCount end) const
}
void
-DuplexPort::update_values(SampleCount offset)
+DuplexPort::update_values(SampleCount offset, uint32_t voice)
{
- return OutputPort::update_values(offset);
+ return OutputPort::update_values(offset, voice);
}
} // namespace Server