summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/events/SetPortValueEvent.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-01-21 15:14:53 +0000
committerDavid Robillard <d@drobilla.net>2008-01-21 15:14:53 +0000
commitd6b87aa26ef482a8952437f7472b81a2240f01fd (patch)
tree620d233b902c78413dc17ee5f921633251239695 /src/libs/engine/events/SetPortValueEvent.cpp
parent2356f96fbd6c9d70dedcd0d64bf0d72786ea36bb (diff)
downloadingen-d6b87aa26ef482a8952437f7472b81a2240f01fd.tar.gz
ingen-d6b87aa26ef482a8952437f7472b81a2240f01fd.tar.bz2
ingen-d6b87aa26ef482a8952437f7472b81a2240f01fd.zip
Work on generic LV2 events.
git-svn-id: http://svn.drobilla.net/lad/ingen@1090 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/events/SetPortValueEvent.cpp')
-rw-r--r--src/libs/engine/events/SetPortValueEvent.cpp21
1 files changed, 7 insertions, 14 deletions
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);
- }
}
}