summaryrefslogtreecommitdiff
path: root/draw
diff options
context:
space:
mode:
authorFreeArtMan <=>2015-09-22 21:37:16 +0100
committerFreeArtMan <=>2015-09-22 21:37:16 +0100
commit6b85a7d453414d31432e63045581b2602d4abf45 (patch)
treeb99a04923dda28ff9d4607df09179f1f8bd26529 /draw
parentfa74c1448e236995a34d767a6e76c3055698fb60 (diff)
downloadradiola-6b85a7d453414d31432e63045581b2602d4abf45.tar.gz
radiola-6b85a7d453414d31432e63045581b2602d4abf45.zip
Added tui interface, updated gitignores, updated makefiles
Diffstat (limited to 'draw')
-rw-r--r--draw/make.mk10
-rw-r--r--draw/tui.c65
-rw-r--r--draw/tui.h40
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
diff --git a/draw/tui.c b/draw/tui.c
index e69de29..5f9b9c7 100644
--- a/draw/tui.c
+++ b/draw/tui.c
@@ -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;
+}
diff --git a/draw/tui.h b/draw/tui.h
index e69de29..6357a59 100644
--- a/draw/tui.h
+++ b/draw/tui.h
@@ -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