This repository has been archived by the owner on Jul 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_window.hpp
124 lines (112 loc) · 2.75 KB
/
main_window.hpp
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/*
Copyright (C) 2015, 2019 daltomi <[email protected]>
This file is part of flvlc.
flvlc is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
flvlc is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with flvlc. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <FL/Fl.H>
#include <FL/filename.H>
#include <FL/x.H>
/**
icons xpm
*/
#include "icons.h"
/**
should by define
*/
extern void event_control(Fl_Widget *);
extern void window_close_x(Fl_Widget *, void *);
#include <FL/Fl_Box.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Group.H>
#include <FL/Fl_Menu_Bar.H>
#include <FL/Fl_Native_File_Chooser.H>
#include <FL/Fl_Slider.H>
#include <FL/Fl_Tooltip.H>
#include <FL/Fl_Window.H>
#include <FL/fl_ask.H>
#include "version.hpp"
class MainWindow : public Fl_Double_Window {
public:
MainWindow();
enum class STATE : char {
MUTE,
PLAY,
PAUSE,
VOLUME,
VIDEO,
STOP,
NEXT,
PREV,
MENU_QUIT,
MENU_OPEN_FILE,
MENU_OPEN_URL,
PLAYLIST,
REPEAT,
WATCH,
SUBTITLES,
PREFERENCES,
SNAPSHOT
};
enum class REPEAT : char { NONE = 0, MEDIA, PLAYLIST };
enum class WATCH : char { OFF = 0, ON };
/**
should by define
*/
int handle(int);
Fl_Slider *sl_video;
Fl_Button *btn_play_pause;
Fl_Button *btn_stop;
Fl_Button *btn_prev;
Fl_Button *btn_next;
Fl_Slider *sl_volume;
Fl_Button *btn_mute;
Fl_Button *btn_repeat;
Fl_Button *btn_watch;
Fl_Button *btn_playlist;
Fl_Button *btn_subtitles;
Fl_Button *btn_preferences;
Fl_Button *btn_snapshot;
Fl_Window *display;
Fl_Box *box_status;
Fl_Box *box_time;
Fl_Group *box_controls;
REPEAT repeat_current;
private:
bool toggle_mute = false;
bool toggle_pause = false;
bool toggle_repeat = false;
Fl_Tooltip *tips;
private:
static Fl_Menu_Item menu_items[];
static void cb_menu(Fl_Menu_ *, long);
void conf_button(Fl_Button *btn, STATE state, const char *tip,
Fl_Pixmap &active, Fl_Pixmap &inactive);
public:
int get_id() const;
void center_on_screen();
int get_w() const;
int get_h() const;
void mute_toggle();
void repeat_toggle();
void play_pause_toggle();
void enable_seek_controls(bool prev, bool next);
void toggle_fullscreen();
void toggle_maximize();
void show_play_controls();
void hide_play_controls();
void popup_menu();
void watch_on();
void watch_off();
void showOSD();
};