2026-10-26 23:07:03 +01:00
|
|
|
#ifndef XTC_MAIN_WINDOW_HPP
|
|
|
|
|
#define XTC_MAIN_WINDOW_HPP
|
2026-10-26 22:51:25 +01:00
|
|
|
|
|
|
|
|
#include <FL/Fl_Double_Window.H>
|
2026-10-26 23:40:28 +01:00
|
|
|
#include "xtc/xtc_backend.h"
|
|
|
|
|
|
|
|
|
|
class Fl_Box;
|
|
|
|
|
class Fl_Button;
|
|
|
|
|
class Fl_Tabs;
|
2026-10-26 22:51:25 +01:00
|
|
|
|
|
|
|
|
class MainWindow : public Fl_Double_Window {
|
|
|
|
|
public:
|
|
|
|
|
MainWindow();
|
2026-10-26 23:40:28 +01:00
|
|
|
~MainWindow() override;
|
|
|
|
|
MainWindow(const MainWindow &) = delete;
|
|
|
|
|
MainWindow &operator=(const MainWindow &) = delete;
|
|
|
|
|
using Fl_Double_Window::show;
|
|
|
|
|
int handle(int event) override;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
xtc_backend *backend_ = nullptr;
|
|
|
|
|
bool ready_ = false;
|
|
|
|
|
bool running_ = false;
|
|
|
|
|
bool closing_ = false;
|
|
|
|
|
Fl_Button *play_ = nullptr;
|
|
|
|
|
Fl_Button *stop_ = nullptr;
|
|
|
|
|
Fl_Box *indicator_ = nullptr;
|
|
|
|
|
Fl_Box *status_ = nullptr;
|
|
|
|
|
Fl_Box *error_ = nullptr;
|
|
|
|
|
Fl_Tabs *tabs_ = nullptr;
|
|
|
|
|
|
|
|
|
|
void open_backend();
|
|
|
|
|
void start_engine();
|
|
|
|
|
void stop_engine();
|
|
|
|
|
void reconnect_engine();
|
|
|
|
|
void refresh_status();
|
|
|
|
|
bool close_window();
|
|
|
|
|
void report_error(const char *operation, xtc_result result);
|
|
|
|
|
static void play_callback(Fl_Widget *, void *context);
|
|
|
|
|
static void stop_callback(Fl_Widget *, void *context);
|
|
|
|
|
static void reconnect_callback(Fl_Widget *, void *context);
|
|
|
|
|
static void close_callback(Fl_Widget *, void *context);
|
|
|
|
|
static void view_callback(Fl_Widget *widget, void *view);
|
|
|
|
|
static void about_callback(Fl_Widget *, void *);
|
|
|
|
|
static void timer_callback(void *context);
|
2026-10-26 22:51:25 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|