summaryrefslogtreecommitdiffstats
path: root/src/libs/engine
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/engine')
-rw-r--r--src/libs/engine/InputPort.cpp17
-rw-r--r--src/libs/engine/OSCEngineReceiver.cpp2
-rw-r--r--src/libs/engine/OutputPort.cpp13
-rw-r--r--src/libs/engine/OutputPort.hpp4
-rw-r--r--src/libs/engine/PortImpl.cpp8
5 files changed, 33 insertions, 11 deletions
diff --git a/src/libs/engine/InputPort.cpp b/src/libs/engine/InputPort.cpp
index f64cf97b..7e5f6623 100644
--- a/src/libs/engine/InputPort.cpp
+++ b/src/libs/engine/InputPort.cpp
@@ -31,7 +31,12 @@ using namespace std;
namespace Ingen {
-InputPort::InputPort(NodeImpl* parent, const string& name, uint32_t index, uint32_t poly, DataType type, size_t buffer_size)
+InputPort::InputPort(NodeImpl* parent,
+ const string& name,
+ uint32_t index,
+ uint32_t poly,
+ DataType type,
+ size_t buffer_size)
: PortImpl(parent, name, index, poly, type, buffer_size)
{
}
@@ -177,7 +182,8 @@ InputPort::pre_process(ProcessContext& context)
buffer(i)->prepare_read(context.nframes());
/*cerr << path() << " poly = " << _poly << ", mixdown: " << do_mixdown
- << ", fixed buffers: " << _fixed_buffers << endl;
+ << ", fixed buffers: " << _fixed_buffers << ", joined: " << _buffers->at(0)->is_joined()
+ << " to " << _buffers->at(0)->joined_buffer() << endl;
if (type() == DataType::MIDI)
for (uint32_t i=0; i < _poly; ++i)
@@ -230,7 +236,12 @@ InputPort::post_process(ProcessContext& context)
for (uint32_t i=0; i < _poly; ++i)
buffer(i)->prepare_write(context.nframes());
- //cerr << path() << " input post: buffer: " << buffer(0) << endl;
+ /*if (_broadcast && (_type == DataType::CONTROL)) {
+ const Sample value = ((AudioBuffer*)(*_buffers)[0])->value_at(0);
+
+ cerr << path() << " input post: buffer: " << buffer(0) << " value = "
+ << value << " (last " << _last_broadcasted_value << ")" <<endl;
+ }*/
}
diff --git a/src/libs/engine/OSCEngineReceiver.cpp b/src/libs/engine/OSCEngineReceiver.cpp
index 66e74e70..4a713dff 100644
--- a/src/libs/engine/OSCEngineReceiver.cpp
+++ b/src/libs/engine/OSCEngineReceiver.cpp
@@ -65,7 +65,7 @@ OSCEngineReceiver::OSCEngineReceiver(Engine& engine, size_t queue_size, uint16_t
}
// For debugging, print all incoming OSC messages
- //lo_server_add_method(_server, NULL, NULL, generic_cb, NULL);
+ lo_server_add_method(_server, NULL, NULL, generic_cb, NULL);
// Set response address for this message.
// It's important this is first and returns nonzero.
diff --git a/src/libs/engine/OutputPort.cpp b/src/libs/engine/OutputPort.cpp
index 82e23889..a80d1ddf 100644
--- a/src/libs/engine/OutputPort.cpp
+++ b/src/libs/engine/OutputPort.cpp
@@ -24,6 +24,19 @@ using namespace std;
namespace Ingen {
+
+OutputPort::OutputPort(NodeImpl* parent,
+ const string& name,
+ uint32_t index,
+ uint32_t poly,
+ DataType type,
+ size_t buffer_size)
+ : PortImpl(parent, name, index, poly, type, buffer_size)
+{
+ if (type == DataType::CONTROL)
+ _broadcast = true;
+}
+
void
OutputPort::pre_process(ProcessContext& context)
diff --git a/src/libs/engine/OutputPort.hpp b/src/libs/engine/OutputPort.hpp
index 1db9e4d9..e744b9e6 100644
--- a/src/libs/engine/OutputPort.hpp
+++ b/src/libs/engine/OutputPort.hpp
@@ -45,9 +45,7 @@ public:
uint32_t index,
uint32_t poly,
DataType type,
- size_t buffer_size)
- : PortImpl(parent, name, index, poly, type, buffer_size)
- {}
+ size_t buffer_size);
void pre_process(ProcessContext& context);
void post_process(ProcessContext& context);
diff --git a/src/libs/engine/PortImpl.cpp b/src/libs/engine/PortImpl.cpp
index 4a17a218..ec27092a 100644
--- a/src/libs/engine/PortImpl.cpp
+++ b/src/libs/engine/PortImpl.cpp
@@ -173,20 +173,20 @@ void
PortImpl::broadcast(ProcessContext& context)
{
if (_broadcast) {
- if (_type == DataType::CONTROL) {
- const Sample value = ((AudioBuffer*)(*_buffers)[0])->value_at(0);
+ if (_type == DataType::CONTROL || _type == DataType::AUDIO) {
+ const Sample value = ((AudioBuffer*)buffer(0))->value_at(0);
if (value != _last_broadcasted_value) {
const SendPortValueEvent ev(context.engine(), context.start(), this, false, 0, value);
context.event_sink().write(sizeof(ev), &ev);
_last_broadcasted_value = value;
}
} else if (_type == DataType::MIDI) {
- if (((MidiBuffer*)(*_buffers)[0])->event_count() > 0) {
+ if (((MidiBuffer*)buffer(0))->event_count() > 0) {
const SendPortActivityEvent ev(context.engine(), context.start(), this);
context.event_sink().write(sizeof(ev), &ev);
}
} else if (_type == DataType::OSC) {
- if (((OSCBuffer*)(*_buffers)[0])->event_count() > 0) {
+ if (((OSCBuffer*)buffer(0))->event_count() > 0) {
const SendPortActivityEvent ev(context.engine(), context.start(), this);
context.event_sink().write(sizeof(ev), &ev);
}