diff options
author | FreeArtMan <=> | 2015-09-26 14:32:36 +0100 |
---|---|---|
committer | FreeArtMan <=> | 2015-09-26 14:32:36 +0100 |
commit | b32da0908a2768d03fe57c8b43435971d9685fec (patch) | |
tree | f8b314e3ad98b89be2f1e4cd40496fb26a56efb8 /draw/tui.h | |
parent | 6b85a7d453414d31432e63045581b2602d4abf45 (diff) | |
download | radiola-b32da0908a2768d03fe57c8b43435971d9685fec.tar.gz radiola-b32da0908a2768d03fe57c8b43435971d9685fec.zip |
Added test terminal waterafall
Diffstat (limited to 'draw/tui.h')
-rw-r--r-- | draw/tui.h | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -2,7 +2,9 @@ #define __RADIOLA_TUI_H #include <stdio.h> +#include <stdint.h> #include <stdlib.h> +#include <string.h> #include <termios.h> #include <unistd.h> @@ -11,7 +13,8 @@ typedef struct tui_waterfall_t { int type; int h,w; - + uint8_t *buf; + size_t buf_len; } tui_waterfall_t; typedef struct tui_t @@ -23,17 +26,19 @@ typedef struct tui_t } tui_t; //prepare terminal ui -int tui_init( tui_t *t ); +int tui_init( tui_t **t ); //init waterfall -int tui_waterfall( tui_t *t, tui_waterfall_t *w ); +int tui_waterfall( tui_t **t, tui_waterfall_t **w ); //first draw, draw all buffer int tui_waterfall_draw( tui_waterfall_t *w ); //redraw only changed lines int tui_waterfall_redraw( tui_waterfall_t *w ); //update params of waterfall and then need to draw not redraw -int tui_waterfall_update( tui_waterfall_t *w ); +int tui_waterfall_update( tui_t *w ); //push one line of data to buffer -int tui_waterfall_data( tui_waterfall_t *w, size_t *len, size_t *buf ); +int tui_waterfall_data( tui_t *w, int len, uint8_t *buf ); +//return color +uint8_t tui_waterfall_color( uint8_t d ); //close terminal ui int tui_close( tui_t *t ); |