1 ///////////////////////////////////////////////////////////////////////////////
2 // Simple x264 Launcher
3 // Copyright (C) 2004-2013 LoRd_MuldeR <MuldeR2@GMX.de>
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License along
16 // with this program; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 // http://www.gnu.org/licenses/gpl-2.0.txt
20 ///////////////////////////////////////////////////////////////////////////////
25 #include <QMainWindow>
31 class PreferencesModel;
43 class MainWindow: public QMainWindow
48 MainWindow(const x264_cpu_t *const cpuFeatures);
52 virtual void closeEvent(QCloseEvent *e);
53 virtual void showEvent(QShowEvent *e);
54 virtual void resizeEvent(QResizeEvent *e);
55 virtual bool eventFilter(QObject *o, QEvent *e);
56 virtual void dragEnterEvent(QDragEnterEvent *event);
57 virtual void dropEvent(QDropEvent *event);
58 virtual bool winEvent(MSG *message, long *result);
61 Ui::MainWindow *const ui;
64 bool m_skipVersionTest;
65 bool m_abortOnTimeout;
69 IPCThread *m_ipcThread;
71 JobListModel *m_jobList;
72 OptionsModel *m_options;
73 QStringList *m_droppedFiles;
74 QList<QFile*> m_toolsList;
76 PreferencesModel *m_preferences;
77 RecentlyUsed *m_recentlyUsed;
79 QString m_vapoursynthPath;
81 const x264_cpu_t *const m_cpuFeatures;
82 const QString m_appDir;
84 bool createJob(QString &sourceFileName, QString &outputFileName, OptionsModel *options, bool &runImmediately, const bool restart = false, int fileNo = -1, int fileTotal = 0, bool *applyToAll = NULL);
85 bool createJobMultiple(const QStringList &filePathIn);
87 bool appendJob(const QString &sourceFileName, const QString &outputFileName, OptionsModel *options, const bool runImmediately);
88 void updateButtons(JobStatus status);
89 void updateTaskbar(JobStatus status, const QIcon &icon);
90 unsigned int countPendingJobs(void);
91 unsigned int countRunningJobs(void);
93 void parseCommandLineArgs(void);
96 void addButtonPressed();
97 void openActionTriggered();
98 void abortButtonPressed(void);
99 void browseButtonPressed(void);
100 void deleteButtonPressed(void);
101 void copyLogToClipboard(bool checked);
102 void checkUpdates(void);
103 void handleDroppedFiles(void);
105 void instanceCreated(unsigned int pid);
106 void jobSelected(const QModelIndex ¤t, const QModelIndex &previous);
107 void jobChangedData(const QModelIndex &top, const QModelIndex &bottom);
108 void jobLogExtended(const QModelIndex & parent, int start, int end);
109 void launchNextJob();
110 void pauseButtonPressed(bool checked);
111 void restartButtonPressed(void);
112 void saveLogFile(const QModelIndex &index);
113 void showAbout(void);
114 void showPreferences(void);
115 void showWebLink(void);
116 void shutdownComputer(void);
117 void startButtonPressed(void);
118 void updateLabelPos(void);