diff options
author | FreeArtMan <=> | 2015-09-22 21:37:16 +0100 |
---|---|---|
committer | FreeArtMan <=> | 2015-09-22 21:37:16 +0100 |
commit | 6b85a7d453414d31432e63045581b2602d4abf45 (patch) | |
tree | b99a04923dda28ff9d4607df09179f1f8bd26529 /draw | |
parent | fa74c1448e236995a34d767a6e76c3055698fb60 (diff) | |
download | radiola-6b85a7d453414d31432e63045581b2602d4abf45.tar.gz radiola-6b85a7d453414d31432e63045581b2602d4abf45.zip |
Added tui interface, updated gitignores, updated makefiles
Diffstat (limited to 'draw')
-rw-r--r-- | draw/make.mk | 10 | ||||
-rw-r--r-- | draw/tui.c | 65 | ||||
-rw-r--r-- | draw/tui.h | 40 |
3 files changed, 115 insertions, 0 deletions
diff --git a/draw/make.mk b/draw/make.mk index e69de29..1ce35d1 100644 --- a/draw/make.mk +++ b/draw/make.mk @@ -0,0 +1,10 @@ +DIR_DRAW = draw/ +SOURCES_DRAW += draw/glui.c draw/tui.c draw/ui.c +OBJECTS_DRAW += $(SOURCES_DRAW:.c=.o) +LDFLAGS += + + +OBJECTS_DIR_DRAW += $(subst $(DIR_DRAW),$(BUILD_DIR)$(DIR_DRAW),$(OBJECTS_DRAW)) + +OBJECTS += $(OBJECTS_DRAW) +OBJECTS_FINAL += $(OBJECTS_DIR_DRAW)
\ No newline at end of file @@ -0,0 +1,65 @@ +#include "tui.h" + +//prepare terminal ui +int tui_init( tui_t *t ) +{ + int ret = -1; + //should be empty pointer + if (t != NULL) + return -1; + return ret; +} + + +//init waterfall +int tui_waterfall( tui_t *t, tui_waterfall_t *w ) +{ + int ret=-1; + //waterfall should be NULL + if ( w != NULL ) + return -1; + return ret; +} + + +//first draw, draw all buffer +int tui_waterfall_draw( tui_waterfall_t *w ) +{ + int ret = -1; + return ret; +} + + +//redraw only changed lines +int tui_waterfall_redraw( tui_waterfall_t *w ) +{ + int ret = -1; + return ret; +} + + +//update params of waterfall and then need to draw not redraw +int tui_waterfall_update( tui_waterfall_t *w ) +{ + int ret = -1; + return ret; +} + + +//push one line of data to buffer +int tui_waterfall_data( tui_waterfall_t *w, size_t *len, size_t *buf ) +{ + int ret = -1; + return ret; +} + + +//close terminal ui +int tui_close( tui_t *t ) +{ + int ret = -1; + //shouldnt be empty pointer + if ( t == NULL ) + return -1; + return ret; +} @@ -0,0 +1,40 @@ +#ifndef __RADIOLA_TUI_H +#define __RADIOLA_TUI_H + +#include <stdio.h> +#include <stdlib.h> +#include <termios.h> +#include <unistd.h> + +//to draw waterfall +typedef struct tui_waterfall_t +{ + int type; + int h,w; + +} tui_waterfall_t; + +typedef struct tui_t +{ + int ifd, ofd; + struct termios orig_i, orig_o; + struct termios raw_i, raw_o; + tui_waterfall_t *wf; +} tui_t; + +//prepare terminal ui +int tui_init( tui_t *t ); +//init waterfall +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 ); +//push one line of data to buffer +int tui_waterfall_data( tui_waterfall_t *w, size_t *len, size_t *buf ); +//close terminal ui +int tui_close( tui_t *t ); + +#endif
\ No newline at end of file |