summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/EventBuffer.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-09-30 16:50:21 +0000
committerDavid Robillard <d@drobilla.net>2008-09-30 16:50:21 +0000
commit93850c202de8b073a1ce1dd8bd246d407bce4e2f (patch)
tree6910b135bf4eff12de1af116cef73f6e9c107cd0 /src/libs/engine/EventBuffer.hpp
parenta8bf5272d096de73507d2eab47f282c345f4ca8a (diff)
downloadingen-93850c202de8b073a1ce1dd8bd246d407bce4e2f.tar.gz
ingen-93850c202de8b073a1ce1dd8bd246d407bce4e2f.tar.bz2
ingen-93850c202de8b073a1ce1dd8bd246d407bce4e2f.zip
Flatten ingen source directory heirarchy a bit.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1551 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/EventBuffer.hpp')
-rw-r--r--src/libs/engine/EventBuffer.hpp104
1 files changed, 0 insertions, 104 deletions
diff --git a/src/libs/engine/EventBuffer.hpp b/src/libs/engine/EventBuffer.hpp
deleted file mode 100644
index 0c80d452..00000000
--- a/src/libs/engine/EventBuffer.hpp
+++ /dev/null
@@ -1,104 +0,0 @@
-/* This file is part of Ingen.
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *
- * Ingen is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option) any later
- * version.
- *
- * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef EVENTBUFFER_H
-#define EVENTBUFFER_H
-
-#include <iostream>
-#include <lv2ext/lv2_event.h>
-#include <lv2ext/lv2_event_helpers.h>
-#include "Buffer.hpp"
-#include "interface/DataType.hpp"
-
-namespace Ingen {
-
-
-class EventBuffer : public Buffer {
-public:
- EventBuffer(size_t capacity);
-
- ~EventBuffer();
-
- void prepare_read(FrameTime start, SampleCount nframes);
- void prepare_write(FrameTime start, SampleCount nframes);
-
- bool join(Buffer* buf);
- void unjoin();
-
- inline uint32_t this_nframes() const { return _this_nframes; }
- inline uint32_t event_count() const { return _buf->event_count; }
-
- inline void* raw_data() { return _buf; }
- inline const void* raw_data() const { return _buf; }
-
- inline LV2_Event_Buffer* local_data() { return _local_buf; }
- inline const LV2_Event_Buffer* local_data() const { return _local_buf; }
-
- inline LV2_Event_Buffer* data() { return _buf; }
- inline const LV2_Event_Buffer* data() const { return _buf; }
-
- void copy(const Buffer* src, size_t start_sample, size_t end_sample);
-
- 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;
- _this_nframes = nframes;
- _latest_frames = 0;
- _latest_subframes = 0;
- _buf->event_count = 0;
- _buf->size = 0;
- rewind();
- }
-
- bool increment() const;
- bool is_valid() const;
-
- uint32_t latest_frames() const { return _latest_frames; }
- uint32_t latest_subframes() const { return _latest_subframes; }
-
- bool get_event(uint32_t* frames,
- uint32_t* subframes,
- uint16_t* type,
- uint16_t* size,
- uint8_t** data) const;
-
- bool append(uint32_t frames,
- uint32_t subframes,
- uint16_t type,
- uint16_t size,
- const uint8_t* data);
-
- bool append(const LV2_Event_Buffer* buf);
-
- bool merge(const EventBuffer& a, const EventBuffer& b);
-
-private:
- 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
-};
-
-
-} // namespace Ingen
-
-#endif // EVENTBUFFER_H