aboutsummaryrefslogtreecommitdiff
path: root/libopna/opnadrum.c
diff options
context:
space:
mode:
authorTakamichi Horikawa <takamichiho@gmail.com>2017-11-23 13:51:14 +0900
committerTakamichi Horikawa <takamichiho@gmail.com>2017-11-23 13:51:14 +0900
commitf774afc5387887f4ce8067502412f5f64899632f (patch)
tree71d588865295f3da64d0ba31ae044d7fc48f64f2 /libopna/opnadrum.c
parentdfe585145747ee3d41297367f97d320230df26b3 (diff)
libopna: make levelmeter and oscillo conditional
Diffstat (limited to 'libopna/opnadrum.c')
-rw-r--r--libopna/opnadrum.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libopna/opnadrum.c b/libopna/opnadrum.c
index 5bb3f56..2f5761c 100644
--- a/libopna/opnadrum.c
+++ b/libopna/opnadrum.c
@@ -23,7 +23,9 @@ void opna_drum_reset(struct opna_drum *drum) {
drum->drums[d].level = 0;
drum->drums[d].left = false;
drum->drums[d].right = false;
+#ifdef LIBOPNA_ENABLE_LEVELDATA
leveldata_init(&drum->drums[d].leveldata);
+#endif
}
drum->total_level = 0;
drum->mask = 0;
@@ -114,9 +116,11 @@ void opna_drum_mix(struct opna_drum *drum, int16_t *buf, int samples) {
buf[i*2+0] = lo;
buf[i*2+1] = ro;
}
+#ifdef LIBOPNA_ENABLE_LEVELDATA
for (int d = 0; d < 6; d++) {
leveldata_update(&drum->drums[d].leveldata, levels[d]);
}
+#endif
}
void opna_drum_writereg(struct opna_drum *drum, unsigned reg, unsigned val) {