aboutsummaryrefslogtreecommitdiff
path: root/lib/ui.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ui.hpp')
-rw-r--r--lib/ui.hpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/lib/ui.hpp b/lib/ui.hpp
new file mode 100644
index 0000000..c656058
--- /dev/null
+++ b/lib/ui.hpp
@@ -0,0 +1,36 @@
+#ifndef UI_HPP
+#define UI_HPP
+
+#include <gtk/gtk.h>
+#include <cairo/cairo.h>
+#include "audio.hpp"
+#include <bits/stdc++.h>
+
+using namespace std;
+
+class GTKUI {
+ public:
+ GTKUI(int argc, char* argv[]);
+ static void draw(cairo_t* cr, GtkWidget* drawing_area, gpointer user_data);
+ static void draw_cb(GtkDrawingArea* drawing_area, cairo_t* cr, int width, int height, gpointer user_data);
+ static void select_device(GtkWidget* widget, gpointer user_data);
+ static void refresh(GtkWidget* widget, gpointer user_data);
+ static void close_window(GtkWidget* widget, gpointer user_data);
+ static gboolean drawCallback(GtkWidget* widget, GdkFrameClock* frame_clock, gpointer user_data);
+ static void activate(GtkApplication* app, gpointer user_data);
+
+ private:
+ GtkApplication* app;
+
+ GtkWidget* window;
+ GtkWidget* grid;
+ GtkWidget* refresh_button;
+ GtkWidget* quit_button;
+ vector<GtkWidget*> buttons;
+ GtkWidget* drawing_area;
+
+ int status;
+ AudioData* audiodata;
+};
+
+#endif