1 | /* smplayer, GUI front-end for mplayer.
|
---|
2 | Copyright (C) 2006-2017 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 BASEGUIPLUS_H
|
---|
20 | #define BASEGUIPLUS_H
|
---|
21 |
|
---|
22 | #include "basegui.h"
|
---|
23 | #include "widgetactions.h"
|
---|
24 | #include <QSystemTrayIcon>
|
---|
25 | #include <QPoint>
|
---|
26 | #include "guiconfig.h"
|
---|
27 |
|
---|
28 | #define SCREENS_SUPPORT
|
---|
29 | //#define DETACH_VIDEO_OPTION
|
---|
30 |
|
---|
31 | #define SEND_AUDIO_OPTION
|
---|
32 |
|
---|
33 | #ifdef SEND_AUDIO_OPTION
|
---|
34 | #include "deviceinfo.h"
|
---|
35 | #endif
|
---|
36 |
|
---|
37 | class QMenu;
|
---|
38 | class PlaylistDock;
|
---|
39 |
|
---|
40 | class TimeSliderAction;
|
---|
41 | class VolumeSliderAction;
|
---|
42 | class TimeLabelAction;
|
---|
43 | class InfoWindow;
|
---|
44 | class GlobalShortcuts;
|
---|
45 |
|
---|
46 | class BaseGuiPlus : public BaseGui
|
---|
47 | {
|
---|
48 | Q_OBJECT
|
---|
49 |
|
---|
50 | public:
|
---|
51 | BaseGuiPlus( QWidget* parent = 0, Qt::WindowFlags flags = 0);
|
---|
52 | ~BaseGuiPlus();
|
---|
53 |
|
---|
54 | virtual bool startHidden();
|
---|
55 |
|
---|
56 | #ifdef SCREENS_SUPPORT
|
---|
57 | /* virtual void toggleFullscreen(bool); */
|
---|
58 | #endif
|
---|
59 |
|
---|
60 | public slots:
|
---|
61 | #ifdef GLOBALSHORTCUTS
|
---|
62 | virtual void showPreferencesDialog();
|
---|
63 | #endif
|
---|
64 |
|
---|
65 | protected:
|
---|
66 | virtual void retranslateStrings();
|
---|
67 | virtual void populateMainMenu();
|
---|
68 |
|
---|
69 | void loadConfig();
|
---|
70 | void saveConfig();
|
---|
71 | void updateShowAllAct();
|
---|
72 |
|
---|
73 | virtual void aboutToEnterFullscreen();
|
---|
74 | virtual void aboutToExitFullscreen();
|
---|
75 | virtual void aboutToEnterCompactMode();
|
---|
76 | virtual void aboutToExitCompactMode();
|
---|
77 |
|
---|
78 | virtual void closeEvent( QCloseEvent * e );
|
---|
79 |
|
---|
80 | // Functions for other GUI's
|
---|
81 | TimeSliderAction * createTimeSliderAction(QWidget * parent);
|
---|
82 | VolumeSliderAction * createVolumeSliderAction(QWidget * parent);
|
---|
83 | TimeLabelAction * createTimeLabelAction(TimeLabelAction::TimeLabelType type, QWidget * parent);
|
---|
84 |
|
---|
85 | #ifdef SCREENS_SUPPORT
|
---|
86 | bool isVideoDetached();
|
---|
87 | #endif
|
---|
88 |
|
---|
89 | protected slots:
|
---|
90 | // Reimplemented methods
|
---|
91 | virtual void updateWidgets();
|
---|
92 | virtual void closeWindow();
|
---|
93 | virtual void setWindowCaption(const QString & title);
|
---|
94 | virtual void resizeWindow(int w, int h);
|
---|
95 | virtual void updateMediaInfo();
|
---|
96 | // New
|
---|
97 | virtual void trayIconActivated(QSystemTrayIcon::ActivationReason);
|
---|
98 | virtual void toggleShowAll();
|
---|
99 | virtual void showAll(bool b);
|
---|
100 | virtual void showAll();
|
---|
101 | virtual void quit();
|
---|
102 | #ifdef Q_OS_OS2
|
---|
103 | void trayAvailable();
|
---|
104 | #endif
|
---|
105 |
|
---|
106 | #if DOCK_PLAYLIST
|
---|
107 | virtual void showPlaylist(bool b);
|
---|
108 | void playlistClosed();
|
---|
109 |
|
---|
110 | #if !USE_DOCK_TOPLEVEL_EVENT
|
---|
111 | void dockVisibilityChanged(bool visible);
|
---|
112 | #else
|
---|
113 | void dockTopLevelChanged(bool floating);
|
---|
114 | #endif
|
---|
115 |
|
---|
116 | void stretchWindow();
|
---|
117 | void shrinkWindow();
|
---|
118 | #endif
|
---|
119 |
|
---|
120 | #ifdef SCREENS_SUPPORT
|
---|
121 | void updateSendToScreen();
|
---|
122 | void sendVideoToScreen(int screen);
|
---|
123 |
|
---|
124 | void detachVideo(bool);
|
---|
125 |
|
---|
126 | void showScreensInfo();
|
---|
127 | #endif
|
---|
128 |
|
---|
129 | #ifdef SEND_AUDIO_OPTION
|
---|
130 | void updateSendAudioMenu();
|
---|
131 | void addListToSendAudioMenu(const DeviceList & audio_devices, const QString & device_name);
|
---|
132 | void sendAudioClicked();
|
---|
133 | #endif
|
---|
134 |
|
---|
135 | #ifdef CHROMECAST_SUPPORT
|
---|
136 | void playOnChromecast();
|
---|
137 | #endif
|
---|
138 |
|
---|
139 | #ifdef GLOBALSHORTCUTS
|
---|
140 | void updateGlobalShortcuts();
|
---|
141 | #endif
|
---|
142 |
|
---|
143 | protected:
|
---|
144 | QSystemTrayIcon * tray;
|
---|
145 | QMenu * context_menu;
|
---|
146 |
|
---|
147 | MyAction * quitAct;
|
---|
148 | MyAction * showTrayAct;
|
---|
149 | MyAction * showAllAct;
|
---|
150 |
|
---|
151 | #ifdef CHROMECAST_SUPPORT
|
---|
152 | MyAction * playOnChromecastAct;
|
---|
153 | #endif
|
---|
154 |
|
---|
155 | #ifdef DETACH_VIDEO_OPTION
|
---|
156 | MyAction * detachVideoAct;
|
---|
157 | #endif
|
---|
158 |
|
---|
159 | #ifdef SCREENS_SUPPORT
|
---|
160 | MyAction * showScreensInfoAct;
|
---|
161 | QMenu * sendToScreen_menu;
|
---|
162 | MyActionGroup * sendToScreenGroup;
|
---|
163 |
|
---|
164 | InfoWindow * screens_info_window;
|
---|
165 | QLabel * detached_label;
|
---|
166 | #endif
|
---|
167 |
|
---|
168 | #ifdef SEND_AUDIO_OPTION
|
---|
169 | DeviceList audio_devices;
|
---|
170 | QMenu * sendAudio_menu;
|
---|
171 | MyAction * sendAudioAct;
|
---|
172 | #endif
|
---|
173 |
|
---|
174 | #ifdef GLOBALSHORTCUTS
|
---|
175 | GlobalShortcuts * global_shortcuts;
|
---|
176 | #endif
|
---|
177 |
|
---|
178 | // To save state
|
---|
179 | QPoint mainwindow_pos;
|
---|
180 | bool mainwindow_visible;
|
---|
181 |
|
---|
182 | QPoint playlist_pos;
|
---|
183 | bool trayicon_playlist_was_visible;
|
---|
184 |
|
---|
185 | //QPoint infowindow_pos;
|
---|
186 | //bool infowindow_visible;
|
---|
187 |
|
---|
188 | int widgets_size; // To be able to restore the original size after exiting from compact mode
|
---|
189 |
|
---|
190 | #if DOCK_PLAYLIST
|
---|
191 | PlaylistDock * playlistdock;
|
---|
192 | bool fullscreen_playlist_was_visible;
|
---|
193 | bool fullscreen_playlist_was_floating;
|
---|
194 | bool compact_playlist_was_visible;
|
---|
195 | bool ignore_playlist_events;
|
---|
196 | #endif
|
---|
197 | };
|
---|
198 |
|
---|
199 | #endif
|
---|