summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/EventBuffer.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-02-10 00:04:37 +0000
committerDavid Robillard <d@drobilla.net>2008-02-10 00:04:37 +0000
commitb31244ce2606961195b53a8ede61238abcefa69b (patch)
tree48e82e30e1da7406c0e809c89a250656ee6e39c6 /src/libs/engine/EventBuffer.hpp
parent53afba6dd84aa0ecbcc5b0b6faccb4726c1edb57 (diff)
downloadingen-b31244ce2606961195b53a8ede61238abcefa69b.tar.gz
ingen-b31244ce2606961195b53a8ede61238abcefa69b.tar.bz2
ingen-b31244ce2606961195b53a8ede61238abcefa69b.zip
Update LV2 event stuff.
Update LV2 UI stuff. git-svn-id: http://svn.drobilla.net/lad/ingen@1141 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/EventBuffer.hpp')
-rw-r--r--src/libs/engine/EventBuffer.hpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/libs/engine/EventBuffer.hpp b/src/libs/engine/EventBuffer.hpp
index 0f8ce485..97ec484c 100644
--- a/src/libs/engine/EventBuffer.hpp
+++ b/src/libs/engine/EventBuffer.hpp
@@ -20,6 +20,7 @@
#include <iostream>
#include <lv2ext/lv2_event.h>
+#include <lv2ext/lv2_event_helpers.h>
#include "Buffer.hpp"
#include "interface/DataType.hpp"
@@ -52,15 +53,15 @@ public:
void copy(const Buffer* src, size_t start_sample, size_t end_sample);
- inline void rewind() const { _position = 0; }
+ inline void rewind() const { lv2_event_begin(&_iter, _buf); }
inline void clear() { reset(_this_nframes); }
inline void reset(SampleCount nframes) {
//std::cerr << this << " reset" << std::endl;
_latest_frames = 0;
_latest_subframes = 0;
- _position = sizeof(LV2_Event_Buffer);
_buf->event_count = 0;
_buf->size = 0;
+ rewind();
}
bool increment() const;
@@ -83,12 +84,16 @@ public:
bool merge(const EventBuffer& a, const EventBuffer& b);
private:
- uint32_t _latest_frames; ///< Latest time of all events (frames)
- uint32_t _latest_subframes; ///< Latest time of all events (subframes)
- uint32_t _this_nframes; ///< Current cycle nframes
- mutable uint32_t _position; ///< Offset into _buf
- LV2_Event_Buffer* _buf; ///< Contents (maybe belong to _joined_buf)
- LV2_Event_Buffer* _local_buf; ///< Local contents
+ LV2_Event_Buffer* _buf; ///< Contents (maybe belong to _joined_buf)
+ LV2_Event_Buffer* _local_buf; ///< Local contents
+
+ mutable LV2_Event_Iterator _iter; ///< Iterator into _buf
+
+ uint32_t _latest_frames; ///< Latest time of all events (frames)
+ uint32_t _latest_subframes; ///< Latest time of all events (subframes)
+ uint32_t _this_nframes; ///< Current cycle nframes
+
+
};