diff options
Diffstat (limited to 'src/libs/engine/events')
-rw-r--r-- | src/libs/engine/events/DestroyEvent.cpp | 2 | ||||
-rw-r--r-- | src/libs/engine/events/RenameEvent.cpp | 2 | ||||
-rw-r--r-- | src/libs/engine/events/SetPortValueEvent.cpp | 21 | ||||
-rw-r--r-- | src/libs/engine/events/SetPortValueQueuedEvent.cpp | 11 |
4 files changed, 15 insertions, 21 deletions
diff --git a/src/libs/engine/events/DestroyEvent.cpp b/src/libs/engine/events/DestroyEvent.cpp index 59e6af5b..d2b2d42b 100644 --- a/src/libs/engine/events/DestroyEvent.cpp +++ b/src/libs/engine/events/DestroyEvent.cpp @@ -154,7 +154,7 @@ DestroyEvent::execute(ProcessContext& context) if ( ! _port->parent_patch()->parent()) { if (_port->type() == DataType::AUDIO) _driver_port = _engine.audio_driver()->remove_port(_port->path()); - else if (_port->type() == DataType::MIDI) + else if (_port->type() == DataType::EVENT) _driver_port = _engine.midi_driver()->remove_port(_port->path()); } } diff --git a/src/libs/engine/events/RenameEvent.cpp b/src/libs/engine/events/RenameEvent.cpp index 1b563d11..7d487cc1 100644 --- a/src/libs/engine/events/RenameEvent.cpp +++ b/src/libs/engine/events/RenameEvent.cpp @@ -113,7 +113,7 @@ RenameEvent::execute(ProcessContext& context) if (port->type() == DataType::AUDIO) driver_port = _engine.audio_driver()->driver_port(_new_path); - else if (port->type() == DataType::MIDI) + else if (port->type() == DataType::EVENT) driver_port = _engine.midi_driver()->driver_port(_new_path); if (driver_port) { diff --git a/src/libs/engine/events/SetPortValueEvent.cpp b/src/libs/engine/events/SetPortValueEvent.cpp index b4d2571c..1abec64b 100644 --- a/src/libs/engine/events/SetPortValueEvent.cpp +++ b/src/libs/engine/events/SetPortValueEvent.cpp @@ -16,7 +16,7 @@ */ #include <sstream> -#include <lv2ext/lv2-midiport.h> +#include <lv2ext/lv2_event.h> #include "Responder.hpp" #include "SetPortValueEvent.hpp" #include "Engine.hpp" @@ -25,8 +25,7 @@ #include "NodeImpl.hpp" #include "ObjectStore.hpp" #include "AudioBuffer.hpp" -#include "MidiBuffer.hpp" -#include "OSCBuffer.hpp" +#include "EventBuffer.hpp" #include "ProcessContext.hpp" using namespace std; @@ -109,19 +108,13 @@ SetPortValueEvent::execute(ProcessContext& context) return; } - MidiBuffer* const mbuf = dynamic_cast<MidiBuffer*>(buf); - if (mbuf) { - const double stamp = std::max((double)(_time - context.start()), mbuf->latest_stamp()); - mbuf->append(stamp, _data_size, (const unsigned char*)_data); + EventBuffer* const ebuf = dynamic_cast<EventBuffer*>(buf); + if (ebuf) { + const uint32_t frames = std::max((uint32_t)(_time - context.start()), ebuf->latest_frames()); + // FIXME: type + ebuf->append(frames, 0, 0, _data_size, (const unsigned char*)_data); return; } - - OSCBuffer* const obuf = dynamic_cast<OSCBuffer*>(buf); - if (obuf) { - //cerr << "Appending OSC message:" << endl; - //lv2_osc_message_print((LV2Message*)_data); - lv2_osc_buffer_append_message(obuf->data(), (LV2Message*)_data); - } } } diff --git a/src/libs/engine/events/SetPortValueQueuedEvent.cpp b/src/libs/engine/events/SetPortValueQueuedEvent.cpp index 7d11b1ae..28bb6df1 100644 --- a/src/libs/engine/events/SetPortValueQueuedEvent.cpp +++ b/src/libs/engine/events/SetPortValueQueuedEvent.cpp @@ -25,7 +25,7 @@ #include "NodeImpl.hpp" #include "ObjectStore.hpp" #include "AudioBuffer.hpp" -#include "MidiBuffer.hpp" +#include "EventBuffer.hpp" #include "ProcessContext.hpp" namespace Ingen { @@ -111,10 +111,11 @@ SetPortValueQueuedEvent::execute(ProcessContext& context) return; } - MidiBuffer* const mbuf = dynamic_cast<MidiBuffer*>(buf); - if (mbuf) { - const double stamp = std::max((double)(_time - context.start()), mbuf->latest_stamp()); - mbuf->append(stamp, _data_size, (const unsigned char*)_data); + EventBuffer* const ebuf = dynamic_cast<EventBuffer*>(buf); + if (ebuf) { + const uint32_t frames = std::max((uint32_t)(_time - context.start()), ebuf->latest_frames()); + // FIXME: type + ebuf->append(frames, 0, 0, _data_size, (const unsigned char*)_data); } } } |