From 69d18d7f335c5f19c13ff09d6fd04557de048ea1 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 24 Jul 2007 01:15:24 +0000 Subject: Working OSC patching. git-svn-id: http://svn.drobilla.net/lad/ingen@606 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/Connection.cpp | 2 ++ src/libs/engine/LV2Node.cpp | 6 ++++-- src/libs/engine/Makefile.am | 1 + src/libs/engine/OSCBuffer.cpp | 14 ++++++++------ 4 files changed, 15 insertions(+), 8 deletions(-) (limited to 'src/libs') diff --git a/src/libs/engine/Connection.cpp b/src/libs/engine/Connection.cpp index 6ae293c4..a4795ceb 100644 --- a/src/libs/engine/Connection.cpp +++ b/src/libs/engine/Connection.cpp @@ -49,6 +49,8 @@ Connection::Connection(Port* src_port, Port* dst_port) if (_must_mix) _local_buffer = BufferFactory::create(dst_port->type(), dst_port->buffer(0)->size()); + + cerr << src_port->path() << " -> " << dst_port->path() << " must mix: " << _must_mix << endl; } diff --git a/src/libs/engine/LV2Node.cpp b/src/libs/engine/LV2Node.cpp index 7310e86b..888366136 100644 --- a/src/libs/engine/LV2Node.cpp +++ b/src/libs/engine/LV2Node.cpp @@ -25,6 +25,8 @@ #include "OutputPort.h" #include "Plugin.h" #include "AudioBuffer.h" +#include "MidiBuffer.h" +#include "OSCBuffer.h" namespace Ingen { @@ -199,9 +201,9 @@ LV2Node::set_port_buffer(size_t voice, size_t port_num, Buffer* buf) if (buf->type() == DataType::FLOAT) { slv2_instance_connect_port(_instances[voice], port_num, ((AudioBuffer*)buf)->data()); } else if (buf->type() == DataType::MIDI) { - cerr << "Connecting " << path() << ":" << port_num << " -> " << - ((MidiBuffer*)buf)->data() << endl; slv2_instance_connect_port(_instances[voice], port_num, ((MidiBuffer*)buf)->data()); + } else if (buf->type() == DataType::OSC) { + slv2_instance_connect_port(_instances[voice], port_num, ((OSCBuffer*)buf)->data()); } } diff --git a/src/libs/engine/Makefile.am b/src/libs/engine/Makefile.am index da7a9b14..7b873c93 100644 --- a/src/libs/engine/Makefile.am +++ b/src/libs/engine/Makefile.am @@ -50,6 +50,7 @@ libingen_engine_la_SOURCES = \ OSCBuffer.h \ OSCBuffer.cpp \ ../../../../lv2/extensions/osc/lv2_osc.c \ + ../../../../lv2/extensions/osc/lv2_osc_print.c \ BufferFactory.h \ BufferFactory.cpp \ Port.h \ diff --git a/src/libs/engine/OSCBuffer.cpp b/src/libs/engine/OSCBuffer.cpp index 75201a30..ff23a281 100644 --- a/src/libs/engine/OSCBuffer.cpp +++ b/src/libs/engine/OSCBuffer.cpp @@ -46,14 +46,16 @@ OSCBuffer::OSCBuffer(size_t capacity) bool OSCBuffer::join(Buffer* buf) { - OSCBuffer* mbuf = dynamic_cast(buf); - if (!mbuf) + OSCBuffer* obuf = dynamic_cast(buf); + if (!obuf) return false; //assert(mbuf->size() == _size); - _joined_buf = mbuf; + _joined_buf = obuf; + cerr << "OSC buffer joined" << endl; + //_state = mbuf->_state; return true; @@ -75,9 +77,9 @@ OSCBuffer::unjoin() bool OSCBuffer::is_joined_to(Buffer* buf) const { - OSCBuffer* mbuf = dynamic_cast(buf); - if (mbuf) - return (data() == mbuf->data()); + OSCBuffer* obuf = dynamic_cast(buf); + if (obuf) + return (data() == obuf->data()); return false; } -- cgit v1.2.1