1 | /* smplayer, GUI front-end for mplayer.
|
---|
2 | Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net>
|
---|
3 |
|
---|
4 | This program is free software; you can redistribute it and/or modify
|
---|
5 | it under the terms of the GNU General Public License as published by
|
---|
6 | the Free Software Foundation; either version 2 of the License, or
|
---|
7 | (at your option) any later version.
|
---|
8 |
|
---|
9 | This program is distributed in the hope that it will be useful,
|
---|
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
12 | GNU General Public License for more details.
|
---|
13 |
|
---|
14 | You should have received a copy of the GNU General Public License
|
---|
15 | along with this program; if not, write to the Free Software
|
---|
16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
17 | */
|
---|
18 |
|
---|
19 | #ifndef DEFAULTGUI_H
|
---|
20 | #define DEFAULTGUI_H
|
---|
21 |
|
---|
22 | #define BUFFERING_ANIMATION
|
---|
23 |
|
---|
24 | #include "guiconfig.h"
|
---|
25 | #include "baseguiplus.h"
|
---|
26 | #include <QPoint>
|
---|
27 |
|
---|
28 | class QToolBar;
|
---|
29 | class EditableToolbar;
|
---|
30 | class QPushButton;
|
---|
31 | class QResizeEvent;
|
---|
32 | class MyAction;
|
---|
33 | class QMenu;
|
---|
34 | class TimeSliderAction;
|
---|
35 | class VolumeSliderAction;
|
---|
36 | class AutohideWidget;
|
---|
37 | class TimeLabelAction;
|
---|
38 | class MyAction;
|
---|
39 |
|
---|
40 | #if MINI_ARROW_BUTTONS
|
---|
41 | class SeekingButton;
|
---|
42 | #endif
|
---|
43 |
|
---|
44 | #ifdef BUFFERING_ANIMATION
|
---|
45 | class StateWidget;
|
---|
46 | #endif
|
---|
47 |
|
---|
48 | class DefaultGui : public BaseGuiPlus
|
---|
49 | {
|
---|
50 | Q_OBJECT
|
---|
51 |
|
---|
52 | public:
|
---|
53 | DefaultGui( QWidget* parent = 0, Qt::WindowFlags flags = 0 );
|
---|
54 | ~DefaultGui();
|
---|
55 |
|
---|
56 | #if USE_MINIMUMSIZE
|
---|
57 | virtual QSize minimumSizeHint () const;
|
---|
58 | #endif
|
---|
59 |
|
---|
60 | public slots:
|
---|
61 | //virtual void showPlaylist(bool b);
|
---|
62 |
|
---|
63 | protected:
|
---|
64 | virtual void retranslateStrings();
|
---|
65 | virtual QMenu * createPopupMenu();
|
---|
66 |
|
---|
67 | void createStatusBar();
|
---|
68 | void createMainToolBars();
|
---|
69 | void createControlWidget();
|
---|
70 | void createControlWidgetMini();
|
---|
71 | void createFloatingControl();
|
---|
72 | void createActions();
|
---|
73 | void createMenus();
|
---|
74 |
|
---|
75 | void loadConfig();
|
---|
76 | void saveConfig();
|
---|
77 |
|
---|
78 | virtual void aboutToEnterFullscreen();
|
---|
79 | virtual void aboutToExitFullscreen();
|
---|
80 | virtual void aboutToEnterCompactMode();
|
---|
81 | virtual void aboutToExitCompactMode();
|
---|
82 |
|
---|
83 | virtual void resizeEvent( QResizeEvent * );
|
---|
84 | /* virtual void closeEvent( QCloseEvent * ); */
|
---|
85 |
|
---|
86 | protected slots:
|
---|
87 | virtual void updateWidgets();
|
---|
88 | virtual void applyNewPreferences();
|
---|
89 | virtual void displayTime(QString text);
|
---|
90 | virtual void displayFrame(int frame);
|
---|
91 | virtual void displayABSection(int secs_a, int secs_b);
|
---|
92 | virtual void displayVideoInfo(int width, int height, double fps);
|
---|
93 |
|
---|
94 | // Reimplemented:
|
---|
95 | #if AUTODISABLE_ACTIONS
|
---|
96 | virtual void enableActionsOnPlaying();
|
---|
97 | virtual void disableActionsOnStop();
|
---|
98 | #endif
|
---|
99 | virtual void togglePlayAction(Core::State state);
|
---|
100 |
|
---|
101 | void adjustFloatingControlSize();
|
---|
102 |
|
---|
103 | protected:
|
---|
104 | void reconfigureFloatingControl();
|
---|
105 |
|
---|
106 | protected:
|
---|
107 | QLabel * time_display;
|
---|
108 | QLabel * frame_display;
|
---|
109 | QLabel * ab_section_display;
|
---|
110 | QLabel * video_info_display;
|
---|
111 | #ifdef BUFFERING_ANIMATION
|
---|
112 | StateWidget * state_widget;
|
---|
113 | #endif
|
---|
114 |
|
---|
115 | EditableToolbar * controlwidget;
|
---|
116 | EditableToolbar * controlwidget_mini;
|
---|
117 |
|
---|
118 | EditableToolbar * toolbar1;
|
---|
119 | QToolBar * toolbar2;
|
---|
120 |
|
---|
121 | QPushButton * select_audio;
|
---|
122 | QPushButton * select_subtitle;
|
---|
123 |
|
---|
124 | TimeSliderAction * timeslider_action;
|
---|
125 | VolumeSliderAction * volumeslider_action;
|
---|
126 |
|
---|
127 | #if MINI_ARROW_BUTTONS
|
---|
128 | SeekingButton * rewindbutton_action;
|
---|
129 | SeekingButton * forwardbutton_action;
|
---|
130 | #endif
|
---|
131 |
|
---|
132 | AutohideWidget * floating_control;
|
---|
133 | TimeLabelAction * time_label_action;
|
---|
134 |
|
---|
135 | MyAction * viewFrameCounterAct;
|
---|
136 | MyAction * viewVideoInfoAct;
|
---|
137 |
|
---|
138 | #if USE_CONFIGURABLE_TOOLBARS
|
---|
139 | MyAction * editToolbar1Act;
|
---|
140 | MyAction * editControl1Act;
|
---|
141 | MyAction * editControl2Act;
|
---|
142 | MyAction * editFloatingControlAct;
|
---|
143 | #endif
|
---|
144 |
|
---|
145 | QMenu * toolbar_menu;
|
---|
146 | QMenu * statusbar_menu;
|
---|
147 |
|
---|
148 | int last_second;
|
---|
149 |
|
---|
150 | bool fullscreen_toolbar1_was_visible;
|
---|
151 | bool fullscreen_toolbar2_was_visible;
|
---|
152 | bool compact_toolbar1_was_visible;
|
---|
153 | bool compact_toolbar2_was_visible;
|
---|
154 | };
|
---|
155 |
|
---|
156 | #endif
|
---|