summaryrefslogtreecommitdiff
path: root/ringbuf.h
diff options
context:
space:
mode:
Diffstat (limited to 'ringbuf.h')
-rw-r--r--ringbuf.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/ringbuf.h b/ringbuf.h
index 5756153..1f97a12 100644
--- a/ringbuf.h
+++ b/ringbuf.h
@@ -123,4 +123,12 @@ class ModuloRingbuffer
{
rb->set(_fixup_range(val));
}
+
+ void add(double val)
+ {
+ rb->add(val);
+
+ while (get() < low) rb->add(span);
+ while (get()>= upp) rb->add(-span);
+ }
};