nausea

curses audio visualizer
git clone git://git.2f30.org/nausea
Log | Files | Refs | README | LICENSE

commit a05e0aeeb6fedda57e74080100b7dea2a1645f65
parent ab89793de3a11578c34be357ca8755932be4b24d
Author: lostd <lostd@2f30.org>
Date:   Sun, 10 May 2015 01:33:24 +0300

Draw nothing on zero input

Diffstat:
Mnausea.c | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/nausea.c b/nausea.c @@ -449,6 +449,12 @@ draw_boom(struct frame *fr) unsigned dim, cx, cy, cur, r; double avg = 0; + erase(); + + /* no samples at all */ + if (fr->gotsamples == 0) + return; + /* read dimensions to catch window resize */ fr->width = COLS; fr->height = LINES; @@ -481,7 +487,6 @@ draw_boom(struct frame *fr) cx = fr->width / 2; cy = fr->height / 2; - erase(); attron(A_BOLD); setcolor(1, fr->height - 3 * r); /* put the center point */