summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-05-03 17:39:16 +0000
committerDavid Robillard <d@drobilla.net>2009-05-03 17:39:16 +0000
commit6012222c80c37be78db3f38a37f7d9a609a213a8 (patch)
treee67148bd53071ffe7172923430b60486bce28760 /src
parentdb6c699017528e6f7c3958b67422e6a936a92e73 (diff)
downloadingen-6012222c80c37be78db3f38a37f7d9a609a213a8.tar.gz
ingen-6012222c80c37be78db3f38a37f7d9a609a213a8.tar.bz2
ingen-6012222c80c37be78db3f38a37f7d9a609a213a8.zip
Update waf configuration header for new waf scheme (in 1.5.6).
Split low-level LV2 event buffer into separate class from EventBuffer (for reuse). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1958 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/client/NodeModel.cpp2
-rw-r--r--src/client/PluginModel.cpp2
-rw-r--r--src/client/PluginModel.hpp2
-rw-r--r--src/client/client.cpp2
-rw-r--r--src/client/wscript2
-rw-r--r--src/engine/AudioBuffer.cpp2
-rw-r--r--src/engine/EventBuffer.cpp178
-rw-r--r--src/engine/EventBuffer.hpp86
-rw-r--r--src/engine/InternalPlugin.hpp2
-rw-r--r--src/engine/JackAudioDriver.cpp2
-rw-r--r--src/engine/LV2EventBuffer.cpp194
-rw-r--r--src/engine/LV2EventBuffer.hpp79
-rw-r--r--src/engine/LV2Info.hpp2
-rw-r--r--src/engine/LV2Plugin.hpp2
-rw-r--r--src/engine/NodeFactory.cpp2
-rw-r--r--src/engine/NodeFactory.hpp2
-rw-r--r--src/engine/OSCEngineReceiver.cpp2
-rw-r--r--src/engine/PatchPlugin.hpp2
-rw-r--r--src/engine/events.hpp2
-rw-r--r--src/engine/util.hpp2
-rw-r--r--src/engine/wscript11
-rw-r--r--src/gui/App.cpp2
-rw-r--r--src/gui/ConnectWindow.cpp2
-rw-r--r--src/gui/ConnectWindow.hpp2
-rw-r--r--src/gui/GladeFactory.cpp2
-rw-r--r--src/gui/NodeModule.cpp2
-rw-r--r--src/gui/PatchCanvas.cpp2
-rw-r--r--src/gui/PatchCanvas.hpp2
-rw-r--r--src/gui/WindowFactory.cpp2
-rw-r--r--src/gui/wscript2
-rw-r--r--src/ingen/main.cpp2
-rw-r--r--src/ingen/wscript2
-rw-r--r--src/module/Module.cpp2
-rw-r--r--src/module/World.hpp2
-rw-r--r--src/module/global.cpp2
-rw-r--r--src/module/wscript2
-rw-r--r--src/serialisation/wscript2
-rw-r--r--src/shared/LV2Features.hpp2
-rw-r--r--src/shared/LV2URIMap.hpp2
-rw-r--r--src/shared/runtime_paths.cpp8
-rw-r--r--src/shared/runtime_paths.hpp4
-rw-r--r--src/shared/wscript2
42 files changed, 369 insertions, 261 deletions
diff --git a/src/client/NodeModel.cpp b/src/client/NodeModel.cpp
index c23bac29..5c8f0d28 100644
--- a/src/client/NodeModel.cpp
+++ b/src/client/NodeModel.cpp
@@ -17,7 +17,7 @@
#include <cassert>
#include <cmath>
-#include "wafconfig.h"
+#include "ingen-config.h"
#include "interface/Port.hpp"
#include "NodeModel.hpp"
diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp
index 3d6aaae9..f733087e 100644
--- a/src/client/PluginModel.cpp
+++ b/src/client/PluginModel.cpp
@@ -16,7 +16,7 @@
*/
#include <sstream>
-#include "wafconfig.h"
+#include "ingen-config.h"
#include "raul/Path.hpp"
#include "raul/Atom.hpp"
#include "PluginModel.hpp"
diff --git a/src/client/PluginModel.hpp b/src/client/PluginModel.hpp
index cd9598b3..c50aef6f 100644
--- a/src/client/PluginModel.hpp
+++ b/src/client/PluginModel.hpp
@@ -18,7 +18,7 @@
#ifndef PLUGINMODEL_H
#define PLUGINMODEL_H
-#include "wafconfig.h"
+#include "ingen-config.h"
#include <string>
#include <iostream>
#include "raul/SharedPtr.hpp"
diff --git a/src/client/client.cpp b/src/client/client.cpp
index 60e4f819..72d329ef 100644
--- a/src/client/client.cpp
+++ b/src/client/client.cpp
@@ -15,7 +15,7 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "wafconfig.h"
+#include "ingen-config.h"
#include <iostream>
#include "client.hpp"
diff --git a/src/client/wscript b/src/client/wscript
index 9bb1f4e3..b7905c5b 100644
--- a/src/client/wscript
+++ b/src/client/wscript
@@ -27,7 +27,7 @@ def build(bld):
if bld.env['HAVE_LIBLO'] == 1:
obj.source += ' OSCClientReceiver.cpp OSCEngineSender.cpp '
- obj.includes = ['.', '..', '../common']
+ obj.includes = ['.', '..', '../..', '../common']
obj.export_incdirs = ['.']
obj.name = 'libingen_client'
obj.target = 'ingen_client'
diff --git a/src/engine/AudioBuffer.cpp b/src/engine/AudioBuffer.cpp
index 4ee42274..5e649f3b 100644
--- a/src/engine/AudioBuffer.cpp
+++ b/src/engine/AudioBuffer.cpp
@@ -18,7 +18,7 @@
#include <iostream>
#include <cassert>
#include <stdlib.h>
-#include "wafconfig.h"
+#include "ingen-config.h"
#include "AudioBuffer.hpp"
using namespace std;
diff --git a/src/engine/EventBuffer.cpp b/src/engine/EventBuffer.cpp
index 4c850c05..222aaf31 100644
--- a/src/engine/EventBuffer.cpp
+++ b/src/engine/EventBuffer.cpp
@@ -18,7 +18,7 @@
#define __STDC_LIMIT_MACROS 1
#include <stdint.h>
#include <iostream>
-#include "wafconfig.h"
+#include "ingen-config.h"
#include "EventBuffer.hpp"
#include "lv2ext/lv2_event.h"
#include "lv2ext/lv2_event_helpers.h"
@@ -33,44 +33,15 @@ namespace Ingen {
*/
EventBuffer::EventBuffer(size_t capacity)
: Buffer(DataType(DataType::EVENT), capacity)
- , _latest_frames(0)
- , _latest_subframes(0)
+ , _local_buf(new LV2EventBuffer(capacity))
{
- if (capacity > UINT32_MAX) {
- cerr << "Event buffer size " << capacity << " too large, aborting." << endl;
- throw std::bad_alloc();
- }
-
-#ifdef HAVE_POSIX_MEMALIGN
- int ret = posix_memalign((void**)&_local_buf, 16, sizeof(LV2_Event_Buffer) + capacity);
-#else
- _local_buf = (LV2_Event_Buffer*)malloc(sizeof(LV2_Event_Buffer) + capacity);
- int ret = (_local_buf != NULL) ? 0 : -1;
-#endif
-
- if (ret != 0) {
- cerr << "Failed to allocate event buffer. Aborting." << endl;
- exit(EXIT_FAILURE);
- }
-
- _local_buf->event_count = 0;
- _local_buf->capacity = (uint32_t)capacity;
- _local_buf->size = 0;
- _local_buf->data = reinterpret_cast<uint8_t*>(_local_buf + 1);
_buf = _local_buf;
-
reset(0);
//cerr << "Creating MIDI Buffer " << _buf << ", capacity = " << _buf->capacity << endl;
}
-EventBuffer::~EventBuffer()
-{
- free(_local_buf);
-}
-
-
/** Use another buffer's data instead of the local one.
*
* This buffer will essentially be identical to @a buf after this call.
@@ -78,20 +49,18 @@ EventBuffer::~EventBuffer()
bool
EventBuffer::join(Buffer* buf)
{
- EventBuffer* mbuf = dynamic_cast<EventBuffer*>(buf);
- if (mbuf) {
- _buf = mbuf->local_data();
- _joined_buf = mbuf;
- _iter = mbuf->_iter;
- _iter.buf = _buf;
+ EventBuffer* ebuf = dynamic_cast<EventBuffer*>(buf);
+ if (ebuf) {
+ _buf = ebuf->_local_buf;
+ _joined_buf = ebuf;
+ _iter = ebuf->_iter;
+ _iter.buf = _buf->data();
return false;
} else {
return false;
}
- //assert(mbuf->size() == _size);
-
- _joined_buf = mbuf;
+ _joined_buf = ebuf;
return true;
}
@@ -100,7 +69,6 @@ EventBuffer::join(Buffer* buf)
void
EventBuffer::unjoin()
{
- //cout << this << " unjoin" << endl;
_joined_buf = NULL;
_buf = _local_buf;
reset(_this_nframes);
@@ -118,7 +86,6 @@ EventBuffer::prepare_read(FrameTime start, SampleCount nframes)
void
EventBuffer::prepare_write(FrameTime start, SampleCount nframes)
{
- //cerr << "\t" << this << " prepare_write: " << event_count() << endl;
reset(nframes);
}
@@ -128,139 +95,16 @@ EventBuffer::copy(const Buffer* src_buf, size_t start_sample, size_t end_sample)
{
const EventBuffer* src = dynamic_cast<const EventBuffer*>(src_buf);
assert(src);
- assert(_buf->capacity >= src->_buf->capacity);
+ assert(_buf->capacity() >= src->_buf->capacity());
clear();
src->rewind();
- memcpy(_buf, src->_buf, src->_buf->size);
+ memcpy(_buf, src->_buf, src->_buf->size());
_this_nframes = end_sample - start_sample;
}
-/** Increment the read position by one event.
- *
- * \return true if increment was successful, or false if end of buffer reached.
- */
-bool
-EventBuffer::increment() const
-{
- if (lv2_event_is_valid(&_iter)) {
- lv2_event_increment(&_iter);
- return true;
- } else {
- return false;
- }
-}
-
-
-/**
- * \return true iff the cursor is valid (ie get_event is safe)
- */
-bool
-EventBuffer::is_valid() const
-{
- return lv2_event_is_valid(&_iter);
-}
-
-
-/** Append an event to the buffer.
- *
- * \a timestamp must be >= the latest event in the buffer,
- * and < this_nframes()
- *
- * \return true on success
- */
-bool
-EventBuffer::append(uint32_t frames,
- uint32_t subframes,
- uint16_t type,
- uint16_t size,
- const uint8_t* data)
-{
-#ifndef NDEBUG
- if (lv2_event_is_valid(&_iter)) {
- LV2_Event* last_event = lv2_event_get(&_iter, NULL);
- assert(last_event->frames < frames
- || (last_event->frames == frames && last_event->subframes <= subframes));
- }
-#endif
-
- /*cout << "Appending event type " << type << ", size " << size
- << " @ " << frames << "." << subframes << endl;*/
-
- const bool ret = lv2_event_write(&_iter, frames, subframes, type, size, data);
-
- if (!ret)
- cerr << "ERROR: Failed to write event." << endl;
-
- _latest_frames = frames;
- _latest_subframes = subframes;
-
- return ret;
-}
-
-
-/** Append a buffer of events to the buffer.
- *
- * \a timestamp must be >= the latest event in the buffer,
- * and < this_nframes()
- *
- * \return true on success
- */
-bool
-EventBuffer::append(const LV2_Event_Buffer* buf)
-{
- uint8_t** data = NULL;
- bool ret = true;
-
- LV2_Event_Iterator iter;
- for (lv2_event_begin(&iter, _buf); lv2_event_is_valid(&iter); lv2_event_increment(&iter)) {
- LV2_Event* ev = lv2_event_get(&iter, data);
-
-#ifndef NDEBUG
- assert((ev->frames > _latest_frames)
- || (ev->frames == _latest_frames
- && ev->subframes >= _latest_subframes));
-#endif
-
- if (!(ret = append(ev->frames, ev->subframes, ev->type, ev->size, *data))) {
- cerr << "ERROR: Failed to write event." << endl;
- break;
- }
-
- _latest_frames = ev->frames;
- _latest_subframes = ev->subframes;
- }
-
- return ret;
-}
-
-
-/** Read an event from the current position in the buffer
- *
- * \return true if read was successful, or false if end of buffer reached
- */
-bool
-EventBuffer::get_event(uint32_t* frames,
- uint32_t* subframes,
- uint16_t* type,
- uint16_t* size,
- uint8_t** data) const
-{
- if (lv2_event_is_valid(&_iter)) {
- LV2_Event* ev = lv2_event_get(&_iter, data);
- *frames = ev->frames;
- *subframes = ev->subframes;
- *type = ev->type;
- *size = ev->size;
- return true;
- } else {
- return false;
- }
-}
-
-
/** Clear, and merge \a a and \a b into this buffer.
*
* FIXME: This is slow.
diff --git a/src/engine/EventBuffer.hpp b/src/engine/EventBuffer.hpp
index 5da1f131..7c2d9d20 100644
--- a/src/engine/EventBuffer.hpp
+++ b/src/engine/EventBuffer.hpp
@@ -20,8 +20,9 @@
#include "lv2ext/lv2_event.h"
#include "lv2ext/lv2_event_helpers.h"
-#include "Buffer.hpp"
#include "interface/DataType.hpp"
+#include "Buffer.hpp"
+#include "LV2EventBuffer.hpp"
namespace Ingen {
@@ -30,70 +31,61 @@ 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();
+
+ void* raw_data() { return _buf; }
+ const void* raw_data() const { return _buf; }
- inline uint32_t this_nframes() const { return _this_nframes; }
- inline uint32_t event_count() const { return _buf->event_count; }
+ void copy(const Buffer* src, size_t start_sample, size_t end_sample);
+
+ bool merge(const EventBuffer& a, const EventBuffer& b);
- inline void* raw_data() { return _buf; }
- inline const void* raw_data() const { return _buf; }
+ bool increment() const;
+ bool is_valid() const;
- inline LV2_Event_Buffer* local_data() { return _local_buf; }
- inline const LV2_Event_Buffer* local_data() const { return _local_buf; }
+ inline uint32_t latest_frames() const { return _buf->latest_frames(); }
+ inline uint32_t latest_subframes() const { return _buf->latest_subframes(); }
+ inline uint32_t this_nframes() const { return _this_nframes; }
+ inline uint32_t event_count() const { return _buf->event_count(); }
- inline LV2_Event_Buffer* data() { return _buf; }
- inline const LV2_Event_Buffer* data() const { return _buf; }
+ inline void rewind() const { _buf->rewind(); }
- 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) {
_this_nframes = nframes;
- _latest_frames = 0;
- _latest_subframes = 0;
- _buf->event_count = 0;
- _buf->size = 0;
- rewind();
+ _buf->reset();
+ }
+
+ inline bool get_event(uint32_t* frames,
+ uint32_t* subframes,
+ uint16_t* type,
+ uint16_t* size,
+ uint8_t** data) const {
+ return _buf->get_event(frames, subframes, type, size, data);
}
- 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);
+ inline bool append(uint32_t frames,
+ uint32_t subframes,
+ uint16_t type,
+ uint16_t size,
+ const uint8_t* data) {
+ return _buf->append(frames, subframes, type, size, data);
+ }
- bool merge(const EventBuffer& a, const EventBuffer& b);
+ inline bool append(const LV2_Event_Buffer* buf) {
+ return _buf->append(buf);
+ }
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
+ LV2EventBuffer* _buf; ///< Contents (maybe belong to _joined_buf)
+ LV2EventBuffer* _local_buf; ///< Local contents
+ mutable LV2_Event_Iterator _iter; ///< Iterator into _buf
+ uint32_t _this_nframes; ///< Current cycle nframes
};
diff --git a/src/engine/InternalPlugin.hpp b/src/engine/InternalPlugin.hpp
index 9948a55e..1ada28a1 100644
--- a/src/engine/InternalPlugin.hpp
+++ b/src/engine/InternalPlugin.hpp
@@ -18,7 +18,7 @@
#ifndef INTERNALPLUGIN_H
#define INTERNALPLUGIN_H
-#include "wafconfig.h"
+#include "ingen-config.h"
#ifndef HAVE_SLV2
#error "This file requires SLV2, but HAVE_SLV2 is not defined. Please report."
diff --git a/src/engine/JackAudioDriver.cpp b/src/engine/JackAudioDriver.cpp
index eb459179..d7cfece2 100644
--- a/src/engine/JackAudioDriver.cpp
+++ b/src/engine/JackAudioDriver.cpp
@@ -16,7 +16,7 @@
*/
#include "JackAudioDriver.hpp"
-#include "wafconfig.h"
+#include "ingen-config.h"
#include "tuning.hpp"
#include <iostream>
#include <cstdlib>
diff --git a/src/engine/LV2EventBuffer.cpp b/src/engine/LV2EventBuffer.cpp
new file mode 100644
index 00000000..3de70216
--- /dev/null
+++ b/src/engine/LV2EventBuffer.cpp
@@ -0,0 +1,194 @@
+/* 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
+ */
+
+#define __STDC_LIMIT_MACROS 1
+#include <stdint.h>
+#include <iostream>
+#include "ingen-config.h"
+#include "LV2EventBuffer.hpp"
+#include "lv2ext/lv2_event.h"
+#include "lv2ext/lv2_event_helpers.h"
+
+using namespace std;
+
+namespace Ingen {
+
+
+/** Allocate a new event buffer.
+ * \a capacity is in bytes (not number of events).
+ */
+LV2EventBuffer::LV2EventBuffer(size_t capacity)
+ : _latest_frames(0)
+ , _latest_subframes(0)
+{
+ if (capacity > UINT32_MAX) {
+ cerr << "Event buffer size " << capacity << " too large, aborting." << endl;
+ throw std::bad_alloc();
+ }
+
+#ifdef HAVE_POSIX_MEMALIGN
+ int ret = posix_memalign((void**)&_data, 16, sizeof(LV2_Event_Buffer) + capacity);
+#else
+ _data = (LV2_Event_Buffer*)malloc(sizeof(LV2_Event_Buffer) + capacity);
+ int ret = (_data != NULL) ? 0 : -1;
+#endif
+
+ if (ret != 0) {
+ cerr << "Failed to allocate event buffer. Aborting." << endl;
+ exit(EXIT_FAILURE);
+ }
+
+ _data->event_count = 0;
+ _data->capacity = (uint32_t)capacity;
+ _data->size = 0;
+ _data->data = reinterpret_cast<uint8_t*>(_data + 1);
+
+ reset();
+
+ //cerr << "Creating MIDI Buffer " << _data << ", capacity = " << _data->capacity << endl;
+}
+
+
+LV2EventBuffer::~LV2EventBuffer()
+{
+ free(_data);
+}
+
+
+/** Increment the read position by one event.
+ *
+ * \return true if increment was successful, or false if end of buffer reached.
+ */
+bool
+LV2EventBuffer::increment() const
+{
+ if (lv2_event_is_valid(&_iter)) {
+ lv2_event_increment(&_iter);
+ return true;
+ } else {
+ return false;
+ }
+}
+
+
+/**
+ * \return true iff the cursor is valid (ie get_event is safe)
+ */
+bool
+LV2EventBuffer::is_valid() const
+{
+ return lv2_event_is_valid(&_iter);
+}
+
+
+/** Read an event from the current position in the buffer
+ *
+ * \return true if read was successful, or false if end of buffer reached
+ */
+bool
+LV2EventBuffer::get_event(uint32_t* frames,
+ uint32_t* subframes,
+ uint16_t* type,
+ uint16_t* size,
+ uint8_t** data) const
+{
+ if (lv2_event_is_valid(&_iter)) {
+ LV2_Event* ev = lv2_event_get(&_iter, data);
+ *frames = ev->frames;
+ *subframes = ev->subframes;
+ *type = ev->type;
+ *size = ev->size;
+ return true;
+ } else {
+ return false;
+ }
+}
+
+
+/** Append an event to the buffer.
+ *
+ * \a timestamp must be >= the latest event in the buffer.
+ *
+ * \return true on success
+ */
+bool
+LV2EventBuffer::append(uint32_t frames,
+ uint32_t subframes,
+ uint16_t type,
+ uint16_t size,
+ const uint8_t* data)
+{
+#ifndef NDEBUG
+ if (lv2_event_is_valid(&_iter)) {
+ LV2_Event* last_event = lv2_event_get(&_iter, NULL);
+ assert(last_event->frames < frames
+ || (last_event->frames == frames && last_event->subframes <= subframes));
+ }
+#endif
+
+ /*cout << "Appending event type " << type << ", size " << size
+ << " @ " << frames << "." << subframes << endl;*/
+
+ const bool ret = lv2_event_write(&_iter, frames, subframes, type, size, data);
+
+ if (!ret)
+ cerr << "ERROR: Failed to write event." << endl;
+
+ _latest_frames = frames;
+ _latest_subframes = subframes;
+
+ return ret;
+}
+
+
+/** Append a buffer of events to the buffer.
+ *
+ * \a timestamp must be >= the latest event in the buffer.
+ *
+ * \return true on success
+ */
+bool
+LV2EventBuffer::append(const LV2_Event_Buffer* buf)
+{
+ uint8_t** data = NULL;
+ bool ret = true;
+
+ LV2_Event_Iterator iter;
+ for (lv2_event_begin(&iter, _data); lv2_event_is_valid(&iter); lv2_event_increment(&iter)) {
+ LV2_Event* ev = lv2_event_get(&iter, data);
+
+#ifndef NDEBUG
+ assert((ev->frames > _latest_frames)
+ || (ev->frames == _latest_frames
+ && ev->subframes >= _latest_subframes));
+#endif
+
+ if (!(ret = append(ev->frames, ev->subframes, ev->type, ev->size, *data))) {
+ cerr << "ERROR: Failed to write event." << endl;
+ break;
+ }
+
+ _latest_frames = ev->frames;
+ _latest_subframes = ev->subframes;
+ }
+
+ return ret;
+}
+
+
+} // namespace Ingen
+
diff --git a/src/engine/LV2EventBuffer.hpp b/src/engine/LV2EventBuffer.hpp
new file mode 100644
index 00000000..7e60dff0
--- /dev/null
+++ b/src/engine/LV2EventBuffer.hpp
@@ -0,0 +1,79 @@
+/* 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 LV2EVENTBUFFER_H
+#define LV2EVENTBUFFER_H
+
+#include "lv2ext/lv2_event.h"
+#include "lv2ext/lv2_event_helpers.h"
+
+namespace Ingen {
+
+
+class LV2EventBuffer {
+public:
+ LV2EventBuffer(size_t capacity);
+ ~LV2EventBuffer();
+
+ inline LV2_Event_Buffer* data() { return _data; }
+ inline const LV2_Event_Buffer* data() const { return _data; }
+
+ inline void rewind() const { lv2_event_begin(&_iter, _data); }
+
+ inline void reset() {
+ _latest_frames = 0;
+ _latest_subframes = 0;
+ _data->event_count = 0;
+ _data->size = 0;
+ rewind();
+ }
+
+ inline size_t event_count() const { return _data->event_count; }
+ inline uint32_t capacity() const { return _data->capacity; }
+ inline uint32_t size() const { return _data->size; }
+ inline uint32_t latest_frames() const { return _latest_frames; }
+ inline uint32_t latest_subframes() const { return _latest_subframes; }
+
+ bool increment() const;
+
+ bool is_valid() const;
+
+ 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);
+
+private:
+ LV2_Event_Buffer* _data; ///< Contents
+ mutable LV2_Event_Iterator _iter; ///< Iterator into _data
+ uint32_t _latest_frames; ///< Latest time of all events (frames)
+ uint32_t _latest_subframes; ///< Latest time of all events (subframes)
+};
+
+
+} // namespace Ingen
+
+#endif // LV2EVENTBUFFER_H
diff --git a/src/engine/LV2Info.hpp b/src/engine/LV2Info.hpp
index 186fa006..96620ffd 100644
--- a/src/engine/LV2Info.hpp
+++ b/src/engine/LV2Info.hpp
@@ -18,7 +18,7 @@
#ifndef LV2INFO_H
#define LV2INFO_H
-#include "wafconfig.h"
+#include "ingen-config.h"
#ifndef HAVE_SLV2
#error "This file requires SLV2, but HAVE_SLV2 is not defined. Please report."
#endif
diff --git a/src/engine/LV2Plugin.hpp b/src/engine/LV2Plugin.hpp
index af1072fd..ca8daeea 100644
--- a/src/engine/LV2Plugin.hpp
+++ b/src/engine/LV2Plugin.hpp
@@ -18,7 +18,7 @@
#ifndef LV2PLUGIN_H
#define LV2PLUGIN_H
-#include "wafconfig.h"
+#include "ingen-config.h"
#ifndef HAVE_SLV2
#error "This file requires SLV2, but HAVE_SLV2 is not defined. Please report."
diff --git a/src/engine/NodeFactory.cpp b/src/engine/NodeFactory.cpp
index a73811ec..dd59f41a 100644
--- a/src/engine/NodeFactory.cpp
+++ b/src/engine/NodeFactory.cpp
@@ -15,7 +15,7 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "wafconfig.h"
+#include "ingen-config.h"
#include <cstdlib>
#include <pthread.h>
#include <dirent.h>
diff --git a/src/engine/NodeFactory.hpp b/src/engine/NodeFactory.hpp
index a5b7702a..d94fc84d 100644
--- a/src/engine/NodeFactory.hpp
+++ b/src/engine/NodeFactory.hpp
@@ -18,7 +18,7 @@
#ifndef NODEFACTORY_H
#define NODEFACTORY_H
-#include "wafconfig.h"
+#include "ingen-config.h"
#include "module/global.hpp"
#include <list>
diff --git a/src/engine/OSCEngineReceiver.cpp b/src/engine/OSCEngineReceiver.cpp
index 405e3abe..7950cdf7 100644
--- a/src/engine/OSCEngineReceiver.cpp
+++ b/src/engine/OSCEngineReceiver.cpp
@@ -21,7 +21,7 @@
#include <cstdlib>
#include <string>
#include <lo/lo.h>
-#include "wafconfig.h"
+#include "ingen-config.h"
#include "raul/SharedPtr.hpp"
#include "raul/AtomLiblo.hpp"
#include "interface/ClientInterface.hpp"
diff --git a/src/engine/PatchPlugin.hpp b/src/engine/PatchPlugin.hpp
index 33ac924c..a406deca 100644
--- a/src/engine/PatchPlugin.hpp
+++ b/src/engine/PatchPlugin.hpp
@@ -18,7 +18,7 @@
#ifndef PATCHPLUGIN_H
#define PATCHPLUGIN_H
-#include "wafconfig.h"
+#include "ingen-config.h"
#include <string>
#include "PluginImpl.hpp"
diff --git a/src/engine/events.hpp b/src/engine/events.hpp
index b050a2ad..355c6a3c 100644
--- a/src/engine/events.hpp
+++ b/src/engine/events.hpp
@@ -18,7 +18,7 @@
#ifndef EVENTS_H
#define EVENTS_H
-#include "wafconfig.h"
+#include "ingen-config.h"
#include "events/AllNotesOffEvent.hpp"
#include "events/ClearPatchEvent.hpp"
diff --git a/src/engine/util.hpp b/src/engine/util.hpp
index e48a6a1a..7cca59d6 100644
--- a/src/engine/util.hpp
+++ b/src/engine/util.hpp
@@ -18,7 +18,7 @@
#ifndef UTIL_HPP
#define UTIL_HPP
-#include "wafconfig.h"
+#include "ingen-config.h"
#include <iostream>
#include <cstdlib>
diff --git a/src/engine/wscript b/src/engine/wscript
index 15328d2b..47b23d57 100644
--- a/src/engine/wscript
+++ b/src/engine/wscript
@@ -20,6 +20,7 @@ def build(bld):
InternalPlugin.cpp
InternalTransport.cpp
InternalTrigger.cpp
+ LV2EventBuffer.cpp
MessageContext.cpp
NodeBase.cpp
NodeFactory.cpp
@@ -43,7 +44,7 @@ def build(bld):
if bld.env['HAVE_SLV2'] == 1:
obj.source += ' LV2Info.cpp LV2Plugin.cpp LV2Node.cpp '
obj.export_incdirs = ['.']
- obj.includes = ['.', '..', '../common', './events']
+ obj.includes = ['.', '..', '../..', '../common', './events']
obj.name = 'libingen_engine'
obj.target = 'ingen_engine'
obj.install_path = '${LIBDIR}/ingen'
@@ -84,7 +85,7 @@ def build(bld):
events/UnregisterClientEvent.cpp
'''
obj.export_incdirs = ['.']
- obj.includes = ['.', '..', '../common', './events', '../engine']
+ obj.includes = ['.', '..', '../..', '../common', './events', '../engine']
obj.name = 'libingen_engine_queued'
obj.target = 'ingen_engine_queued'
obj.install_path = '${LIBDIR}/ingen'
@@ -98,7 +99,7 @@ def build(bld):
HTTPClientSender.cpp
HTTPEngineReceiver.cpp
'''
- obj.includes = ['.', '..', '../common', './events', '../engine']
+ obj.includes = ['.', '..', '../..', '../common', './events', '../engine']
obj.name = 'libingen_engine_http'
obj.target = 'ingen_engine_http'
obj.install_path = '${LIBDIR}/ingen'
@@ -113,7 +114,7 @@ def build(bld):
OSCEngineReceiver.cpp
'''
obj.export_incdirs = ['.']
- obj.includes = ['.', '..', '../common', './events', '../engine']
+ obj.includes = ['.', '..', '../..', '../common', './events', '../engine']
obj.name = 'libingen_engine_osc'
obj.target = 'ingen_engine_osc'
obj.install_path = '${LIBDIR}/ingen'
@@ -123,7 +124,7 @@ def build(bld):
obj = bld.new_task_gen('cxx', 'shlib')
obj.source = 'JackAudioDriver.cpp JackMidiDriver.cpp'
obj.export_incdirs = ['.']
- obj.includes = ['.', '..', '../common', './events', '../engine']
+ obj.includes = ['.', '..', '../..', '../common', './events', '../engine']
obj.name = 'libingen_engine_jack'
obj.target = 'ingen_engine_jack'
obj.install_path = '${LIBDIR}/ingen'
diff --git a/src/gui/App.cpp b/src/gui/App.cpp
index acccc9be..c7056a64 100644
--- a/src/gui/App.cpp
+++ b/src/gui/App.cpp
@@ -15,7 +15,7 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "wafconfig.h"
+#include "ingen-config.h"
#include "App.hpp"
#include <cassert>
#include <string>
diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp
index a7a5186a..da801075 100644
--- a/src/gui/ConnectWindow.cpp
+++ b/src/gui/ConnectWindow.cpp
@@ -22,7 +22,7 @@
#include <sys/time.h>
#include <sys/resource.h>
#include "raul/Process.hpp"
-#include "wafconfig.h"
+#include "ingen-config.h"
#include "interface/EngineInterface.hpp"
#include "module/World.hpp"
#include "engine/tuning.hpp"
diff --git a/src/gui/ConnectWindow.hpp b/src/gui/ConnectWindow.hpp
index 4b9de5f6..0a34d8df 100644
--- a/src/gui/ConnectWindow.hpp
+++ b/src/gui/ConnectWindow.hpp
@@ -18,7 +18,7 @@
#ifndef CONNECT_WINDOW_H
#define CONNECT_WINDOW_H
-#include "wafconfig.h"
+#include "ingen-config.h"
#ifdef HAVE_SLV2
#include "slv2/slv2.h"
diff --git a/src/gui/GladeFactory.cpp b/src/gui/GladeFactory.cpp
index 92cb1714..0cbb0470 100644
--- a/src/gui/GladeFactory.cpp
+++ b/src/gui/GladeFactory.cpp
@@ -18,7 +18,7 @@
#include "GladeFactory.hpp"
#include <iostream>
#include <fstream>
-#include "wafconfig.h"
+#include "ingen-config.h"
#include "shared/runtime_paths.hpp"
using namespace std;
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp
index d253f3a0..d2d2fe24 100644
--- a/src/gui/NodeModule.cpp
+++ b/src/gui/NodeModule.cpp
@@ -16,7 +16,7 @@
*/
#include <cassert>
-#include "wafconfig.h"
+#include "ingen-config.h"
#include "raul/Atom.hpp"
#include "interface/EngineInterface.hpp"
#include "client/PatchModel.hpp"
diff --git a/src/gui/PatchCanvas.cpp b/src/gui/PatchCanvas.cpp
index b8dd22fc..e5a92206 100644
--- a/src/gui/PatchCanvas.cpp
+++ b/src/gui/PatchCanvas.cpp
@@ -15,7 +15,7 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "wafconfig.h"
+#include "ingen-config.h"
#include "module/global.hpp"
#include "module/World.hpp"
diff --git a/src/gui/PatchCanvas.hpp b/src/gui/PatchCanvas.hpp
index b3019854..d215817e 100644
--- a/src/gui/PatchCanvas.hpp
+++ b/src/gui/PatchCanvas.hpp
@@ -21,7 +21,7 @@
#include <string>
#include <map>
#include <boost/shared_ptr.hpp>
-#include "wafconfig.h"
+#include "ingen-config.h"
#include "flowcanvas/Canvas.hpp"
#include "flowcanvas/Module.hpp"
#include "raul/SharedPtr.hpp"
diff --git a/src/gui/WindowFactory.cpp b/src/gui/WindowFactory.cpp
index b7c69810..1e7bf14c 100644
--- a/src/gui/WindowFactory.cpp
+++ b/src/gui/WindowFactory.cpp
@@ -15,7 +15,7 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "wafconfig.h"
+#include "ingen-config.h"
#include "client/PatchModel.hpp"
#include "App.hpp"
#include "GladeFactory.hpp"
diff --git a/src/gui/wscript b/src/gui/wscript
index cc2fe7f0..55e82e10 100644
--- a/src/gui/wscript
+++ b/src/gui/wscript
@@ -42,7 +42,7 @@ def build(bld):
obj.source += 'UploadPatchWindow.cpp'
obj.export_incdirs = ['.']
- obj.includes = ['.', '..', '../common', '../client', '../module']
+ obj.includes = ['.', '..', '../..', '../common', '../client', '../module']
obj.name = 'libingen_gui'
obj.target = 'ingen_gui'
obj.install_path = '${LIBDIR}/ingen'
diff --git a/src/ingen/main.cpp b/src/ingen/main.cpp
index 7bce7408..31f4a4ad 100644
--- a/src/ingen/main.cpp
+++ b/src/ingen/main.cpp
@@ -15,7 +15,7 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "wafconfig.h"
+#include "ingen-config.h"
#include <iostream>
#include <string>
#include <signal.h>
diff --git a/src/ingen/wscript b/src/ingen/wscript
index 6cfcf47d..469fa752 100644
--- a/src/ingen/wscript
+++ b/src/ingen/wscript
@@ -5,7 +5,7 @@ def build(bld):
obj = bld.new_task_gen('cxx', 'program')
obj.target = 'ingen'
obj.source = 'main.cpp cmdline.c'
- obj.includes = ['../common', '../']
+ obj.includes = ['..', '../..', '../common']
obj.defines = 'VERSION="' + bld.env['INGEN_VERSION'] + '"'
obj.uselib_local = 'libingen_module libingen_shared'
obj.install_path = '${BINDIR}'
diff --git a/src/module/Module.cpp b/src/module/Module.cpp
index ef81996f..9a9b2976 100644
--- a/src/module/Module.cpp
+++ b/src/module/Module.cpp
@@ -21,7 +21,7 @@
#include <glibmm/module.h>
#include <glibmm/miscutils.h>
#include <glibmm/fileutils.h>
-#include "wafconfig.h"
+#include "ingen-config.h"
#include "raul/SharedPtr.hpp"
#include "shared/runtime_paths.hpp"
diff --git a/src/module/World.hpp b/src/module/World.hpp
index 1d073cd2..af128106 100644
--- a/src/module/World.hpp
+++ b/src/module/World.hpp
@@ -18,7 +18,7 @@
#ifndef INGEN_WORLD_HPP
#define INGEN_WORLD_HPP
-#include "wafconfig.h"
+#include "ingen-config.h"
#include <string>
#include <glibmm/module.h>
diff --git a/src/module/global.cpp b/src/module/global.cpp
index 9eff703a..994d7d04 100644
--- a/src/module/global.cpp
+++ b/src/module/global.cpp
@@ -20,7 +20,7 @@
#include "global.hpp"
#include "World.hpp"
-#include "wafconfig.h"
+#include "ingen-config.h"
#ifdef HAVE_SLV2
#include "slv2/slv2.h"
#endif
diff --git a/src/module/wscript b/src/module/wscript
index ee25130d..50103f7e 100644
--- a/src/module/wscript
+++ b/src/module/wscript
@@ -8,7 +8,7 @@ def build(bld):
global.cpp
'''
obj.export_incdirs = ['.']
- obj.includes = ['.', '..', '../common']
+ obj.includes = ['.', '..', '../..', '../common']
obj.name = 'libingen_module'
obj.target = 'ingen_module'
obj.vnum = '0.0.0'
diff --git a/src/serialisation/wscript b/src/serialisation/wscript
index 04923074..3aebc016 100644
--- a/src/serialisation/wscript
+++ b/src/serialisation/wscript
@@ -9,7 +9,7 @@ def build(bld):
serialisation.cpp
'''
obj.export_incdirs = ['.']
- obj.includes = ['.', '..', '../common']
+ obj.includes = ['.', '..', '../..', '../common']
obj.name = 'libingen_serialisation'
obj.target = 'ingen_serialisation'
obj.install_path = '${LIBDIR}/ingen'
diff --git a/src/shared/LV2Features.hpp b/src/shared/LV2Features.hpp
index d4933d09..3ffbe520 100644
--- a/src/shared/LV2Features.hpp
+++ b/src/shared/LV2Features.hpp
@@ -18,7 +18,7 @@
#ifndef LV2FEATURES_HPP
#define LV2FEATURES_HPP
-#include "wafconfig.h"
+#include "ingen-config.h"
#ifndef HAVE_SLV2
#error "This file requires SLV2, but HAVE_SLV2 is not defined. Please report."
#endif
diff --git a/src/shared/LV2URIMap.hpp b/src/shared/LV2URIMap.hpp
index 333d22e9..7da53a09 100644
--- a/src/shared/LV2URIMap.hpp
+++ b/src/shared/LV2URIMap.hpp
@@ -18,7 +18,7 @@
#ifndef LV2URIMAP_HPP
#define LV2URIMAP_HPP
-#include "wafconfig.h"
+#include "ingen-config.h"
#ifndef HAVE_SLV2
#error "This file requires SLV2, but HAVE_SLV2 is not defined. Please report."
#endif
diff --git a/src/shared/runtime_paths.cpp b/src/shared/runtime_paths.cpp
index e2641b9c..15bafa50 100644
--- a/src/shared/runtime_paths.cpp
+++ b/src/shared/runtime_paths.cpp
@@ -15,10 +15,12 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include "wafconfig.h"
-#include "runtime_paths.hpp"
+#include <dlfcn.h>
+#include <limits.h>
+#include <stdlib.h>
#include <glibmm/module.h>
+#include "ingen-config.h"
+#include "runtime_paths.hpp"
using namespace std;
diff --git a/src/shared/runtime_paths.hpp b/src/shared/runtime_paths.hpp
index 8081a249..5ee1aebc 100644
--- a/src/shared/runtime_paths.hpp
+++ b/src/shared/runtime_paths.hpp
@@ -22,10 +22,6 @@
#define _GNU_SOURCE
#endif
-#include <dlfcn.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <limits.h>
#include <string>
namespace Ingen {
diff --git a/src/shared/wscript b/src/shared/wscript
index 83b3e7c1..50fb7320 100644
--- a/src/shared/wscript
+++ b/src/shared/wscript
@@ -18,7 +18,7 @@ def build(bld):
autowaf.use_lib(bld, obj, 'SOUP')
obj.source += ' HTTPSender.cpp '
obj.export_incdirs = ['.']
- obj.includes = ['.', '../', '../common']
+ obj.includes = ['.', '..', '../..', '../common']
obj.name = 'libingen_shared'
obj.target = 'ingen_shared'
obj.vnum = '0.0.0'