summaryrefslogtreecommitdiffstats
path: root/src/server
diff options
context:
space:
mode:
Diffstat (limited to 'src/server')
-rw-r--r--src/server/Buffer.cpp16
-rw-r--r--src/server/Buffer.hpp4
2 files changed, 20 insertions, 0 deletions
diff --git a/src/server/Buffer.cpp b/src/server/Buffer.cpp
index cf313b67..8ed1d60a 100644
--- a/src/server/Buffer.cpp
+++ b/src/server/Buffer.cpp
@@ -431,6 +431,22 @@ Buffer::update_value_buffer(SampleCount offset)
}
}
+#ifndef NDEBUG
+void
+Buffer::dump_cv(const RunContext& context) const
+{
+ float value = samples()[0];
+ fprintf(stderr, "{ 0000: %.02f\n", value);
+ for (uint32_t i = 0; i < context.nframes(); ++i) {
+ if (samples()[i] != value) {
+ value = samples()[i];
+ fprintf(stderr, " %4d: %.02f\n", i, value);
+ }
+ }
+ fprintf(stderr, "}\n");
+}
+#endif
+
void
intrusive_ptr_add_ref(Buffer* b)
{
diff --git a/src/server/Buffer.hpp b/src/server/Buffer.hpp
index 13e0a7eb..8742445f 100644
--- a/src/server/Buffer.hpp
+++ b/src/server/Buffer.hpp
@@ -195,6 +195,10 @@ public:
/// Set/add to audio buffer from the Sequence of Float in `src`
void render_sequence(const RunContext& context, const Buffer* src, bool add);
+#ifndef NDEBUG
+ void dump_cv(const RunContext& context) const;
+#endif
+
void set_capacity(uint32_t capacity) { _capacity = capacity; }
void set_buffer(void* buf) { assert(_external); _buf = buf; }