summaryrefslogtreecommitdiffstats
path: root/tools/gui/ring-buffer.h
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2012-10-12 14:47:07 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2012-10-12 14:47:07 +0200
commitef7ff789e9c15f4f4b8c65585de7e7fa4f9c9438 (patch)
tree2f6a105b6a4c1325b2aba7c1fa3d9a2b26856a7c /tools/gui/ring-buffer.h
parent6b82a9a175c92c39f25e9b5965b2e9f5c35f65c2 (diff)
downloadlibuca-ef7ff789e9c15f4f4b8c65585de7e7fa4f9c9438.tar.gz
libuca-ef7ff789e9c15f4f4b8c65585de7e7fa4f9c9438.tar.bz2
libuca-ef7ff789e9c15f4f4b8c65585de7e7fa4f9c9438.tar.xz
libuca-ef7ff789e9c15f4f4b8c65585de7e7fa4f9c9438.zip
Add ring buffer recording for assessment
Diffstat (limited to 'tools/gui/ring-buffer.h')
-rw-r--r--tools/gui/ring-buffer.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/tools/gui/ring-buffer.h b/tools/gui/ring-buffer.h
new file mode 100644
index 0000000..22cbde7
--- /dev/null
+++ b/tools/gui/ring-buffer.h
@@ -0,0 +1,28 @@
+#ifndef RING_BUFFER_H
+#define RING_BUFFER_H
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+typedef struct {
+ guchar *data;
+ gsize block_size;
+ guint n_blocks_total;
+ guint n_blocks_used;
+ guint start_index;
+} RingBuffer;
+
+RingBuffer * ring_buffer_new (gsize block_size,
+ gsize n_blocks);
+void ring_buffer_free (RingBuffer *buffer);
+void ring_buffer_reset (RingBuffer *buffer);
+gpointer ring_buffer_get_current_pointer (RingBuffer *buffer);
+gpointer ring_buffer_get_pointer (RingBuffer *buffer,
+ guint index);
+guint ring_buffer_get_num_blocks (RingBuffer *buffer);
+void ring_buffer_proceed (RingBuffer *buffer);
+
+G_END_DECLS
+
+#endif