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 ///////////////////////////////////////////////////////////////////////////////
24 #include "uic_win_main.h"
27 #include "model_status.h"
33 class PreferencesModel;
37 class MainWindow: public QMainWindow, private Ui::MainWindow
42 MainWindow(const x264_cpu_t *const cpuFeatures);
46 virtual void closeEvent(QCloseEvent *e);
47 virtual void showEvent(QShowEvent *e);
48 virtual void resizeEvent(QResizeEvent *e);
49 virtual bool eventFilter(QObject *o, QEvent *e);
50 virtual void dragEnterEvent(QDragEnterEvent *event);
51 virtual void dropEvent(QDropEvent *event);
52 virtual bool winEvent(MSG *message, long *result);
56 bool m_skipVersionTest;
57 bool m_abortOnTimeout;
61 IPCThread *m_ipcThread;
63 JobListModel *m_jobList;
64 OptionsModel *m_options;
65 QStringList *m_droppedFiles;
66 QList<QFile*> m_toolsList;
68 PreferencesModel *m_preferences;
69 RecentlyUsed *m_recentlyUsed;
71 QString m_vapoursynthPath;
73 const x264_cpu_t *const m_cpuFeatures;
74 const QString m_appDir;
76 bool createJob(QString &sourceFileName, QString &outputFileName, OptionsModel *options, bool &runImmediately, const bool restart = false, int fileNo = -1, int fileTotal = 0, bool *applyToAll = NULL);
77 bool createJobMultiple(const QStringList &filePathIn);
79 bool appendJob(const QString &sourceFileName, const QString &outputFileName, OptionsModel *options, const bool runImmediately);
80 void updateButtons(JobStatus status);
81 void updateTaskbar(JobStatus status, const QIcon &icon);
82 unsigned int countPendingJobs(void);
83 unsigned int countRunningJobs(void);
86 void addButtonPressed();
87 void openActionTriggered();
88 void abortButtonPressed(void);
89 void browseButtonPressed(void);
90 void deleteButtonPressed(void);
91 void copyLogToClipboard(bool checked);
92 void handleDroppedFiles(void);
94 void instanceCreated(unsigned int pid);
95 void jobSelected(const QModelIndex & current, const QModelIndex & previous);
96 void jobChangedData(const QModelIndex &top, const QModelIndex &bottom);
97 void jobLogExtended(const QModelIndex & parent, int start, int end);
99 void pauseButtonPressed(bool checked);
100 void restartButtonPressed(void);
101 void saveLogFile(const QModelIndex &index);
102 void showAbout(void);
103 void showPreferences(void);
104 void showWebLink(void);
105 void shutdownComputer(void);
106 void startButtonPressed(void);
107 void updateLabelPos(void);