aboutsummaryrefslogtreecommitdiff
path: root/lib/ui.hpp
blob: c656058c9b4f7a4cfbb0647df0ded3b33cd11f99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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