[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 SMPLAYER_H
|
---|
| 20 | #define SMPLAYER_H
|
---|
[112] | 21 |
|
---|
| 22 | #include <QObject>
|
---|
| 23 | #include <QString>
|
---|
| 24 | #include <QStringList>
|
---|
| 25 | #include "basegui.h"
|
---|
| 26 |
|
---|
| 27 | class SMPlayer : public QObject
|
---|
| 28 | {
|
---|
[128] | 29 | Q_OBJECT
|
---|
| 30 |
|
---|
[112] | 31 | public:
|
---|
| 32 | enum ExitCode { ErrorArgument = -3, NoAction = -2, NoRunningInstance = -1, NoError = 0, NoExit = 1 };
|
---|
| 33 |
|
---|
| 34 | SMPlayer(const QString & config_path = QString::null, QObject * parent = 0);
|
---|
| 35 | ~SMPlayer();
|
---|
| 36 |
|
---|
| 37 | //! Process arguments. If ExitCode != NoExit the application must be exited.
|
---|
| 38 | ExitCode processArgs(QStringList args);
|
---|
| 39 |
|
---|
| 40 | BaseGui * gui();
|
---|
| 41 |
|
---|
| 42 | void start();
|
---|
| 43 |
|
---|
[128] | 44 | #ifdef GUI_CHANGE_ON_RUNTIME
|
---|
| 45 | private slots:
|
---|
| 46 | void changeGUI(QString new_gui);
|
---|
| 47 | #endif
|
---|
| 48 |
|
---|
[112] | 49 | private:
|
---|
[128] | 50 | BaseGui * createGUI(QString gui_name);
|
---|
| 51 | void deleteGUI();
|
---|
[112] | 52 | #ifndef PORTABLE_APP
|
---|
| 53 | void createConfigDirectory();
|
---|
| 54 | #endif
|
---|
| 55 | void showInfo();
|
---|
[156] | 56 | void deleteConfig();
|
---|
[176] | 57 | #ifdef FONTS_HACK
|
---|
[165] | 58 | void createFontFile();
|
---|
| 59 | #endif
|
---|
[112] | 60 |
|
---|
[128] | 61 | static BaseGui * main_window;
|
---|
[112] | 62 |
|
---|
[128] | 63 | QStringList files_to_play;
|
---|
| 64 | QString subtitle_file;
|
---|
| 65 | QString actions_list; //!< Actions to be run on startup
|
---|
[112] | 66 | QString gui_to_use;
|
---|
[176] | 67 | QString media_title; //!< Force a title for the first file
|
---|
[112] | 68 |
|
---|
| 69 | // Change position and size
|
---|
| 70 | bool move_gui;
|
---|
| 71 | QPoint gui_position;
|
---|
| 72 |
|
---|
| 73 | bool resize_gui;
|
---|
| 74 | QSize gui_size;
|
---|
| 75 |
|
---|
| 76 | // Options to pass to gui
|
---|
| 77 | int close_at_end; // -1 = not set, 1 = true, 0 false
|
---|
| 78 | int start_in_fullscreen; // -1 = not set, 1 = true, 0 false
|
---|
[128] | 79 |
|
---|
| 80 | #ifdef LOG_SMPLAYER
|
---|
| 81 | // Output log
|
---|
| 82 | static QFile output_log;
|
---|
[165] | 83 | #if QT_VERSION >= 0x050000
|
---|
| 84 | static void myMessageOutput( QtMsgType type, const QMessageLogContext &, const QString & msg );
|
---|
| 85 | #else
|
---|
[128] | 86 | static void myMessageOutput( QtMsgType type, const char *msg );
|
---|
[165] | 87 | #endif
|
---|
[128] | 88 | static bool allow_to_send_log_to_gui;
|
---|
| 89 | #endif
|
---|
[112] | 90 | };
|
---|
| 91 |
|
---|
| 92 | #endif
|
---|