diff options
| author | alexander.pickering <alexander.pickering@anondomain.site90.net> | 2014-09-16 16:33:54 -0400 |
|---|---|---|
| committer | alexander.pickering <alexander.pickering@anondomain.site90.net> | 2014-09-16 16:33:54 -0400 |
| commit | b3cb76cf21dd7739fc4d0d64ce09a70bc1a2c94e (patch) | |
| tree | 15096b9392f4ab37051ad7c8dcd3340fd37d354e /vaud.c | |
| parent | 5615d00be87bc2263ffa759a877a942c013a31ef (diff) | |
| download | vaud-b3cb76cf21dd7739fc4d0d64ce09a70bc1a2c94e.tar.gz vaud-b3cb76cf21dd7739fc4d0d64ce09a70bc1a2c94e.tar.bz2 vaud-b3cb76cf21dd7739fc4d0d64ce09a70bc1a2c94e.zip | |
Added a second meter
Diffstat (limited to 'vaud.c')
| -rw-r--r-- | vaud.c | 82 |
1 files changed, 74 insertions, 8 deletions
@@ -202,19 +202,84 @@ void display_centerBars() /*Figure out how which nodes we can safely get*/ int space = ((unsigned int) dframes) / width; + //mvprintw(10,10,"Space is %i",space); + //refresh(); + if(space > 0) + { + for(i=1;i<width-1;i+=1) + { + float samp = fabs(data[space * i]); //get the waveform data + float dec; + //mvprintw(height/2,i,BAR); + int j; + for(j=0;j<samp*(height/2);j++) + { + if(COLORFUL) + attron(COLOR_PAIR(2)); + mvprintw((height/2)+j,i,BAR); + mvprintw((height/2)-j,i,BAR); + if(COLORFUL) + attroff(COLOR_PAIR(2)); + + } + for(j=samp*(height/2)+1;j<(height/2);j++) + { + if(COLORFUL) + attron(COLOR_PAIR(3)); + mvprintw((height/2)+j,i,BLANK); + mvprintw((height/2)-j,i,BLANK); + if(COLORFUL) + attroff(COLOR_PAIR(3)); + } + } + } + refresh(); +} + + +void display_rmeter() +{ + int width,height,startx,starty,i=0; + WINDOW *my_win; - for(i=0;i<space;i+=1) + /*Get width and height of console, make border*/ + getmaxyx(stdscr,height,width); + my_win = create_newwin(height,width,startx,starty); + + /*Figure out how which nodes we can safely get*/ + int space = ((unsigned int) dframes) / width; + //mvprintw(10,10,"Space is %i",space); + //refresh(); + if(space > 0) { - float samp = fabs(data[space * i]); //get the waveform data - float dec; - mvprintw(height/2,i,BAR); - int j; - for(j=0;j<samp*height;j++) + for(i=1;i<width-1;i+=1) { - mvprintw((height/2)+j,i,BAR); - mvprintw((height/2)-j,i,BAR); + float samp = fabs(data[space * i]); //get the waveform data + float dec; + //mvprintw(height/2,i,BAR); + int j; + for(j=0;j<samp*(height/2);j++) + { + if(COLORFUL) + attron(COLOR_PAIR(2)); + mvprintw((height/2)+j,i,BAR); + mvprintw((height/2)-j,i,BAR); + if(COLORFUL) + attroff(COLOR_PAIR(2)); + + } + for(j=samp*(height/2)+1;j<(height/2);j++) + { + if(COLORFUL) + attron(COLOR_PAIR(3)); + mvprintw((height/2)+j,i,BLANK); + mvprintw((height/2)-j,i,BLANK); + if(COLORFUL) + attroff(COLOR_PAIR(3)); + } } } + refresh(); } /* Displays the graph @@ -357,6 +422,7 @@ int main(int argc, char *argv[]) } else { switch(graph) { + case 0 : display_rmeter();break; case 1 : display_meter();break; case 2 : display_centerBars();break; } |
