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;
58 IPCThread *m_ipcThread;
60 JobListModel *m_jobList;
61 OptionsModel *m_options;
62 QStringList *m_droppedFiles;
63 QList<QFile*> m_toolsList;
65 PreferencesModel *m_preferences;
66 RecentlyUsed *m_recentlyUsed;
67 QString m_vapoursynthPath;
69 const x264_cpu_t *const m_cpuFeatures;
70 const QString m_appDir;
72 bool createJob(QString &sourceFileName, QString &outputFileName, OptionsModel *options, bool &runImmediately, const bool restart = false, int fileNo = -1, int fileTotal = 0, bool *applyToAll = NULL);
73 bool createJobMultiple(const QStringList &filePathIn);
75 bool appendJob(const QString &sourceFileName, const QString &outputFileName, OptionsModel *options, const bool runImmediately);
76 void updateButtons(JobStatus status);
77 void updateTaskbar(JobStatus status, const QIcon &icon);
78 unsigned int countPendingJobs(void);
79 unsigned int countRunningJobs(void);
81 static QString getVapoursynthLocation(void);
84 void addButtonPressed();
85 void openActionTriggered();
86 void abortButtonPressed(void);
87 void browseButtonPressed(void);
88 void deleteButtonPressed(void);
89 void copyLogToClipboard(bool checked);
90 void handleDroppedFiles(void);
92 void instanceCreated(DWORD pid);
93 void jobSelected(const QModelIndex & current, const QModelIndex & previous);
94 void jobChangedData(const QModelIndex &top, const QModelIndex &bottom);
95 void jobLogExtended(const QModelIndex & parent, int start, int end);
97 void pauseButtonPressed(bool checked);
98 void restartButtonPressed(void);
99 void saveLogFile(const QModelIndex &index);
100 void showAbout(void);
101 void showPreferences(void);
102 void showWebLink(void);
103 void shutdownComputer(void);
104 void startButtonPressed(void);
105 void updateLabelPos(void);