X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fpbd%2Fpbd%2Fringbuffer.h;h=bb2b8244f9889f4f9200eaf320ccfd16028bd1a3;hb=c5115c9a3c8ce6639f37e0b429e0498bb522d913;hp=d98601461e684eea5e5bf2d478877e8cd33ee3c1;hpb=45d3ec1437cf661533bc7750c623865def4424df;p=ardour.git diff --git a/libs/pbd/pbd/ringbuffer.h b/libs/pbd/pbd/ringbuffer.h index d98601461e..bb2b8244f9 100644 --- a/libs/pbd/pbd/ringbuffer.h +++ b/libs/pbd/pbd/ringbuffer.h @@ -20,23 +20,25 @@ #ifndef ringbuffer_h #define ringbuffer_h +#include #include +#include "pbd/libpbd_visibility.h" + template -class RingBuffer +class LIBPBD_API RingBuffer { public: RingBuffer (guint sz) { // size = ffs(sz); /* find first [bit] set is a single inlined assembly instruction. But it looks like the API rounds up so... */ guint power_of_two; - for (power_of_two = 1; 1U< guint +template LIBPBD_API guint RingBuffer::read (T *dest, guint cnt) { guint free_cnt; @@ -157,8 +159,8 @@ RingBuffer::read (T *dest, guint cnt) return to_read; } -template guint -RingBuffer::write (T *src, guint cnt) +template LIBPBD_API guint +RingBuffer::write (T const *src, guint cnt) { guint free_cnt; @@ -197,7 +199,7 @@ RingBuffer::write (T *src, guint cnt) return to_write; } -template void +template LIBPBD_API void RingBuffer::get_read_vector (RingBuffer::rw_vector *vec) { @@ -233,11 +235,12 @@ RingBuffer::get_read_vector (RingBuffer::rw_vector *vec) vec->buf[0] = &buf[r]; vec->len[0] = free_cnt; + vec->buf[1] = 0; vec->len[1] = 0; } } -template void +template LIBPBD_API void RingBuffer::get_write_vector (RingBuffer::rw_vector *vec) {