[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 BASEGUIPLUS_H
|
---|
| 20 | #define BASEGUIPLUS_H
|
---|
[112] | 21 |
|
---|
| 22 | #include "basegui.h"
|
---|
[181] | 23 | #include "widgetactions.h"
|
---|
[112] | 24 | #include <QSystemTrayIcon>
|
---|
| 25 | #include <QPoint>
|
---|
| 26 | #include "guiconfig.h"
|
---|
| 27 |
|
---|
[181] | 28 | #define SCREENS_SUPPORT
|
---|
| 29 | //#define DETACH_VIDEO_OPTION
|
---|
| 30 |
|
---|
[188] | 31 | #define SEND_AUDIO_OPTION
|
---|
| 32 |
|
---|
| 33 | #ifdef SEND_AUDIO_OPTION
|
---|
| 34 | #include "deviceinfo.h"
|
---|
| 35 | #endif
|
---|
| 36 |
|
---|
[112] | 37 | class QMenu;
|
---|
| 38 | class PlaylistDock;
|
---|
| 39 |
|
---|
| 40 | class TimeSliderAction;
|
---|
| 41 | class VolumeSliderAction;
|
---|
[181] | 42 | class TimeLabelAction;
|
---|
| 43 | class InfoWindow;
|
---|
| 44 | class GlobalShortcuts;
|
---|
[112] | 45 |
|
---|
| 46 | class BaseGuiPlus : public BaseGui
|
---|
| 47 | {
|
---|
| 48 | Q_OBJECT
|
---|
| 49 |
|
---|
| 50 | public:
|
---|
[128] | 51 | BaseGuiPlus( QWidget* parent = 0, Qt::WindowFlags flags = 0);
|
---|
[112] | 52 | ~BaseGuiPlus();
|
---|
| 53 |
|
---|
| 54 | virtual bool startHidden();
|
---|
| 55 |
|
---|
[181] | 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 |
|
---|
[112] | 65 | protected:
|
---|
| 66 | virtual void retranslateStrings();
|
---|
[181] | 67 | virtual void populateMainMenu();
|
---|
[112] | 68 |
|
---|
| 69 | void loadConfig();
|
---|
| 70 | void saveConfig();
|
---|
| 71 | void updateShowAllAct();
|
---|
| 72 |
|
---|
[181] | 73 | virtual void aboutToEnterFullscreen();
|
---|
| 74 | virtual void aboutToExitFullscreen();
|
---|
[112] | 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);
|
---|
[181] | 83 | TimeLabelAction * createTimeLabelAction(TimeLabelAction::TimeLabelType type, QWidget * parent);
|
---|
[112] | 84 |
|
---|
[181] | 85 | #ifdef SCREENS_SUPPORT
|
---|
| 86 | bool isVideoDetached();
|
---|
| 87 | #endif
|
---|
| 88 |
|
---|
[112] | 89 | protected slots:
|
---|
| 90 | // Reimplemented methods
|
---|
[188] | 91 | virtual void updateWidgets();
|
---|
[112] | 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);
|
---|
[156] | 100 | virtual void showAll();
|
---|
[112] | 101 | virtual void quit();
|
---|
[182] | 102 | #ifdef Q_OS_OS2
|
---|
| 103 | void trayAvailable();
|
---|
| 104 | #endif
|
---|
[112] | 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 |
|
---|
[181] | 120 | #ifdef SCREENS_SUPPORT
|
---|
| 121 | void updateSendToScreen();
|
---|
| 122 | void sendVideoToScreen(int screen);
|
---|
[156] | 123 |
|
---|
[181] | 124 | void detachVideo(bool);
|
---|
| 125 |
|
---|
| 126 | void showScreensInfo();
|
---|
| 127 | #endif
|
---|
| 128 |
|
---|
[188] | 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 |
|
---|
[181] | 139 | #ifdef GLOBALSHORTCUTS
|
---|
| 140 | void updateGlobalShortcuts();
|
---|
| 141 | #endif
|
---|
| 142 |
|
---|
[112] | 143 | protected:
|
---|
| 144 | QSystemTrayIcon * tray;
|
---|
| 145 | QMenu * context_menu;
|
---|
| 146 |
|
---|
| 147 | MyAction * quitAct;
|
---|
| 148 | MyAction * showTrayAct;
|
---|
| 149 | MyAction * showAllAct;
|
---|
| 150 |
|
---|
[188] | 151 | #ifdef CHROMECAST_SUPPORT
|
---|
| 152 | MyAction * playOnChromecastAct;
|
---|
| 153 | #endif
|
---|
| 154 |
|
---|
[181] | 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 |
|
---|
[188] | 168 | #ifdef SEND_AUDIO_OPTION
|
---|
| 169 | DeviceList audio_devices;
|
---|
| 170 | QMenu * sendAudio_menu;
|
---|
| 171 | MyAction * sendAudioAct;
|
---|
| 172 | #endif
|
---|
| 173 |
|
---|
[181] | 174 | #ifdef GLOBALSHORTCUTS
|
---|
| 175 | GlobalShortcuts * global_shortcuts;
|
---|
| 176 | #endif
|
---|
| 177 |
|
---|
[112] | 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 |
|
---|
[181] | 188 | int widgets_size; // To be able to restore the original size after exiting from compact mode
|
---|
[112] | 189 |
|
---|
| 190 | #if DOCK_PLAYLIST
|
---|
[181] | 191 | PlaylistDock * playlistdock;
|
---|
[112] | 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
|
---|