From b31244ce2606961195b53a8ede61238abcefa69b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 10 Feb 2008 00:04:37 +0000 Subject: Update LV2 event stuff. Update LV2 UI stuff. git-svn-id: http://svn.drobilla.net/lad/ingen@1141 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/EventBuffer.hpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/libs/engine/EventBuffer.hpp') 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 #include +#include #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 + + }; -- cgit v1.2.1