From 7caf4423145b5b2629502f8d227dc348bd232887 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 22 Dec 2014 17:45:26 +0100 Subject: Fix level indication in mono --- src/dabplus-enc.cpp | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'src/dabplus-enc.cpp') diff --git a/src/dabplus-enc.cpp b/src/dabplus-enc.cpp index b474914..0862690 100644 --- a/src/dabplus-enc.cpp +++ b/src/dabplus-enc.cpp @@ -832,24 +832,35 @@ int main(int argc, char *argv[]) } } - if (out_args.numOutBytes + row*10 == outbuf_size) { - if (show_level) { + if (show_level) { + if (channels == 1) { + fprintf(stderr, "\rIn: [%-6s] %1s %1s %1s", + level(1, MAX(peak_right, peak_left)), + status & STATUS_PAD_INSERTED ? "P" : " ", + status & STATUS_UNDERRUN ? "U" : " ", + status & STATUS_OVERRUN ? "O" : " "); + } + else if (channels == 2) { fprintf(stderr, "\rIn: [%6s|%-6s] %1s %1s %1s", - level(0, &peak_left), - level(1, &peak_right), + level(0, peak_left), + level(1, peak_right), status & STATUS_PAD_INSERTED ? "P" : " ", status & STATUS_UNDERRUN ? "U" : " ", status & STATUS_OVERRUN ? "O" : " "); } - else { - if (status & STATUS_OVERRUN) { - fprintf(stderr, "O"); - } - if (status & STATUS_UNDERRUN) { - fprintf(stderr, "U"); - } + peak_right = 0; + peak_left = 0; + } + else { + if (status & STATUS_OVERRUN) { + fprintf(stderr, "O"); } + + if (status & STATUS_UNDERRUN) { + fprintf(stderr, "U"); + } + } status = 0; -- cgit v1.2.3