From ca10e74a4b3ecb3c55c84f169ef558da5e9c0f09 Mon Sep 17 00:00:00 2001 From: "alexander.pickering" Date: Tue, 16 Sep 2014 18:41:35 -0400 Subject: A small fix for the first meter --- vaud.c | 64 +++++++++++++++++++++++++++------------------------------------- 1 file changed, 27 insertions(+), 37 deletions(-) (limited to 'vaud.c') diff --git a/vaud.c b/vaud.c index ee1f178..61a8552 100644 --- a/vaud.c +++ b/vaud.c @@ -281,52 +281,42 @@ void display_rmeter() */ void display_meter() { - /*Some variables to keep track of stuff*/ - int i; - int width,height; - int startx,starty = 0; - int space = 1; + int width,height,startx,starty,i=0; WINDOW *my_win; /*Get width and height of console, make border*/ getmaxyx(stdscr,height,width); my_win = create_newwin(height,width,startx,starty); - - /*Figure out how far inbetween the samples that are "safe" to get are*/ - int samples = ((unsigned int) dframes) / width; - - /*For every sample we can safely get*/ - for(i=0;i 0) { - /*Get the value*/ - float samp = fabs(data[i]); - float dec; //The percentage up the graph - if(COLORFUL) - attron(COLOR_PAIR(2)); - /*Draw whitespace from the ground up*/ - for(dec = height+2;dec > samp;dec-=(1.0/height)) - { - if(dec*height=1) - mvprintw(dec*height,space,BLANK); - } - if(COLORFUL) - attroff(COLOR_PAIR(2)); - attron(COLOR_PAIR(3)); - /*And draw bars the rest of the way*/ - for(;dec>0;dec-=(1.0/height)) - { - if(dec*height >= 1) - mvprintw(dec*height,space,BAR); - } - if(COLORFUL) - attroff(COLOR_PAIR(3)); - /*Makes sure we don't draw over the frame*/ - if(space < width-2) + for(i=1;i