summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2017-03-20 02:35:26 +0100
committerDavid Robillard <d@drobilla.net>2017-03-20 03:19:33 +0100
commita312f5b5343112bb5b1a2ee10027ffc7a2dc6e2b (patch)
tree2b01aa73cdb18c52ff55c6833b1e1503c3860c79
parent4d4721f984e0a22a9874b5d4c4c9ee6674fca856 (diff)
downloadingen-a312f5b5343112bb5b1a2ee10027ffc7a2dc6e2b.tar.gz
ingen-a312f5b5343112bb5b1a2ee10027ffc7a2dc6e2b.tar.bz2
ingen-a312f5b5343112bb5b1a2ee10027ffc7a2dc6e2b.zip
Add CV dumping debug utility
-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; }