[112] | 1 | /* smplayer, GUI front-end for mplayer.
|
---|
[188] | 2 | Copyright (C) 2006-2017 Ricardo Villalba <rvm@users.sourceforge.net>
|
---|
[112] | 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 |
|
---|
[176] | 19 | #ifndef DEFAULTGUI_H
|
---|
| 20 | #define DEFAULTGUI_H
|
---|
[112] | 21 |
|
---|
[176] | 22 | #define BUFFERING_ANIMATION
|
---|
[181] | 23 | //#define LANGUAGE_TOOLBAR
|
---|
[176] | 24 |
|
---|
[181] | 25 | #ifdef IDOPT_BUILD
|
---|
| 26 | #define ADD_QUICK_ACCESS
|
---|
| 27 | #endif
|
---|
| 28 |
|
---|
[112] | 29 | #include "guiconfig.h"
|
---|
| 30 | #include "baseguiplus.h"
|
---|
| 31 | #include <QPoint>
|
---|
| 32 |
|
---|
| 33 | class QToolBar;
|
---|
[128] | 34 | class EditableToolbar;
|
---|
[112] | 35 | class QPushButton;
|
---|
| 36 | class QResizeEvent;
|
---|
| 37 | class MyAction;
|
---|
| 38 | class QMenu;
|
---|
| 39 | class TimeSliderAction;
|
---|
| 40 | class VolumeSliderAction;
|
---|
[165] | 41 | class AutohideWidget;
|
---|
[112] | 42 | class TimeLabelAction;
|
---|
| 43 | class MyAction;
|
---|
| 44 |
|
---|
| 45 | #if MINI_ARROW_BUTTONS
|
---|
| 46 | class SeekingButton;
|
---|
| 47 | #endif
|
---|
| 48 |
|
---|
[176] | 49 | #ifdef BUFFERING_ANIMATION
|
---|
| 50 | class StateWidget;
|
---|
| 51 | #endif
|
---|
| 52 |
|
---|
[112] | 53 | class DefaultGui : public BaseGuiPlus
|
---|
| 54 | {
|
---|
| 55 | Q_OBJECT
|
---|
| 56 |
|
---|
| 57 | public:
|
---|
[128] | 58 | DefaultGui( QWidget* parent = 0, Qt::WindowFlags flags = 0 );
|
---|
[112] | 59 | ~DefaultGui();
|
---|
| 60 |
|
---|
| 61 | #if USE_MINIMUMSIZE
|
---|
| 62 | virtual QSize minimumSizeHint () const;
|
---|
| 63 | #endif
|
---|
| 64 |
|
---|
| 65 | public slots:
|
---|
| 66 | //virtual void showPlaylist(bool b);
|
---|
| 67 |
|
---|
| 68 | protected:
|
---|
| 69 | virtual void retranslateStrings();
|
---|
| 70 | virtual QMenu * createPopupMenu();
|
---|
| 71 |
|
---|
| 72 | void createStatusBar();
|
---|
| 73 | void createMainToolBars();
|
---|
| 74 | void createControlWidget();
|
---|
| 75 | void createControlWidgetMini();
|
---|
| 76 | void createFloatingControl();
|
---|
| 77 | void createActions();
|
---|
| 78 | void createMenus();
|
---|
[181] | 79 | virtual void populateMainMenu();
|
---|
[112] | 80 |
|
---|
| 81 | void loadConfig();
|
---|
| 82 | void saveConfig();
|
---|
| 83 |
|
---|
| 84 | virtual void aboutToEnterFullscreen();
|
---|
| 85 | virtual void aboutToExitFullscreen();
|
---|
| 86 | virtual void aboutToEnterCompactMode();
|
---|
| 87 | virtual void aboutToExitCompactMode();
|
---|
| 88 |
|
---|
| 89 | virtual void resizeEvent( QResizeEvent * );
|
---|
| 90 | /* virtual void closeEvent( QCloseEvent * ); */
|
---|
| 91 |
|
---|
| 92 | protected slots:
|
---|
| 93 | virtual void updateWidgets();
|
---|
[188] | 94 | virtual void displayTime(double sec);
|
---|
[112] | 95 | virtual void displayFrame(int frame);
|
---|
| 96 | virtual void displayABSection(int secs_a, int secs_b);
|
---|
| 97 | virtual void displayVideoInfo(int width, int height, double fps);
|
---|
[188] | 98 | virtual void displayBitrateInfo(int vbitrate, int abitrate);
|
---|
[181] | 99 | void checkCompactMode();
|
---|
| 100 | #ifdef ADD_QUICK_ACCESS
|
---|
| 101 | void adaptForTabletMode();
|
---|
| 102 | #endif
|
---|
[112] | 103 |
|
---|
| 104 | // Reimplemented:
|
---|
| 105 | #if AUTODISABLE_ACTIONS
|
---|
| 106 | virtual void enableActionsOnPlaying();
|
---|
| 107 | virtual void disableActionsOnStop();
|
---|
| 108 | #endif
|
---|
[176] | 109 | virtual void togglePlayAction(Core::State state);
|
---|
[112] | 110 |
|
---|
[176] | 111 | void adjustFloatingControlSize();
|
---|
| 112 |
|
---|
[112] | 113 | protected:
|
---|
[165] | 114 | void reconfigureFloatingControl();
|
---|
| 115 |
|
---|
| 116 | protected:
|
---|
[112] | 117 | QLabel * time_display;
|
---|
| 118 | QLabel * frame_display;
|
---|
| 119 | QLabel * ab_section_display;
|
---|
| 120 | QLabel * video_info_display;
|
---|
[181] | 121 | QLabel * format_info_display;
|
---|
[188] | 122 | QLabel * bitrate_info_display;
|
---|
[176] | 123 | #ifdef BUFFERING_ANIMATION
|
---|
| 124 | StateWidget * state_widget;
|
---|
| 125 | #endif
|
---|
[112] | 126 |
|
---|
[128] | 127 | EditableToolbar * controlwidget;
|
---|
| 128 | EditableToolbar * controlwidget_mini;
|
---|
[112] | 129 |
|
---|
[128] | 130 | EditableToolbar * toolbar1;
|
---|
[181] | 131 |
|
---|
| 132 | #ifdef LANGUAGE_TOOLBAR
|
---|
[112] | 133 | QToolBar * toolbar2;
|
---|
| 134 | QPushButton * select_audio;
|
---|
| 135 | QPushButton * select_subtitle;
|
---|
[181] | 136 | #endif
|
---|
[112] | 137 |
|
---|
| 138 | TimeSliderAction * timeslider_action;
|
---|
| 139 | VolumeSliderAction * volumeslider_action;
|
---|
| 140 |
|
---|
| 141 | #if MINI_ARROW_BUTTONS
|
---|
| 142 | SeekingButton * rewindbutton_action;
|
---|
| 143 | SeekingButton * forwardbutton_action;
|
---|
| 144 | #endif
|
---|
| 145 |
|
---|
[165] | 146 | AutohideWidget * floating_control;
|
---|
[112] | 147 | TimeLabelAction * time_label_action;
|
---|
[181] | 148 | TimeLabelAction * current_time_label_action;
|
---|
| 149 | TimeLabelAction * total_time_label_action;
|
---|
| 150 | TimeLabelAction * remaining_time_label_action;
|
---|
[112] | 151 |
|
---|
| 152 | MyAction * viewFrameCounterAct;
|
---|
| 153 | MyAction * viewVideoInfoAct;
|
---|
[181] | 154 | MyAction * viewFormatInfoAct;
|
---|
[188] | 155 | MyAction * viewBitrateInfoAct;
|
---|
| 156 | MyAction * useMillisecondsAct;
|
---|
[112] | 157 |
|
---|
[128] | 158 | #if USE_CONFIGURABLE_TOOLBARS
|
---|
| 159 | MyAction * editToolbar1Act;
|
---|
| 160 | MyAction * editControl1Act;
|
---|
| 161 | MyAction * editControl2Act;
|
---|
| 162 | MyAction * editFloatingControlAct;
|
---|
| 163 | #endif
|
---|
| 164 |
|
---|
[112] | 165 | QMenu * toolbar_menu;
|
---|
| 166 | QMenu * statusbar_menu;
|
---|
| 167 |
|
---|
| 168 | bool fullscreen_toolbar1_was_visible;
|
---|
[181] | 169 | bool compact_toolbar1_was_visible;
|
---|
| 170 | #ifdef LANGUAGE_TOOLBAR
|
---|
[112] | 171 | bool fullscreen_toolbar2_was_visible;
|
---|
| 172 | bool compact_toolbar2_was_visible;
|
---|
[181] | 173 | #endif
|
---|
[112] | 174 | };
|
---|
| 175 |
|
---|
| 176 | #endif
|
---|