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"
25 #include "thread_ipc.h"
26 #include "thread_encode.h"
32 class PreferencesModel;
35 class MainWindow: public QMainWindow, private Ui::MainWindow
40 MainWindow(const x264_cpu_t *const cpuFeatures);
44 virtual void closeEvent(QCloseEvent *e);
45 virtual void showEvent(QShowEvent *e);
46 virtual void resizeEvent(QResizeEvent *e);
47 virtual bool eventFilter(QObject *o, QEvent *e);
48 virtual void dragEnterEvent(QDragEnterEvent *event);
49 virtual void dropEvent(QDropEvent *event);
50 virtual bool winEvent(MSG *message, long *result);
55 IPCThread *m_ipcThread;
57 JobListModel *m_jobList;
58 OptionsModel *m_options;
59 QStringList *m_droppedFiles;
60 QList<QFile*> m_toolsList;
62 PreferencesModel *m_preferences;
63 RecentlyUsed *m_recentlyUsed;
65 const x264_cpu_t *const m_cpuFeatures;
66 const QString m_appDir;
68 bool createJob(QString &sourceFileName, QString &outputFileName, OptionsModel *options, bool &runImmediately, const bool restart = false, int fileNo = -1, int fileTotal = 0, bool *applyToAll = NULL);
69 bool createJobMultiple(const QStringList &filePathIn);
71 bool appendJob(const QString &sourceFileName, const QString &outputFileName, OptionsModel *options, const bool runImmediately);
72 void updateButtons(EncodeThread::JobStatus status);
73 void updateTaskbar(EncodeThread::JobStatus status, const QIcon &icon);
74 unsigned int countPendingJobs(void);
75 unsigned int countRunningJobs(void);
78 void addButtonPressed();
79 void openActionTriggered();
80 void abortButtonPressed(void);
81 void browseButtonPressed(void);
82 void deleteButtonPressed(void);
83 void copyLogToClipboard(bool checked);
84 void handleDroppedFiles(void);
86 void instanceCreated(DWORD pid);
87 void jobSelected(const QModelIndex & current, const QModelIndex & previous);
88 void jobChangedData(const QModelIndex &top, const QModelIndex &bottom);
89 void jobLogExtended(const QModelIndex & parent, int start, int end);
91 void pauseButtonPressed(bool checked);
92 void restartButtonPressed(void);
93 void saveLogFile(const QModelIndex &index);
95 void showPreferences(void);
96 void showWebLink(void);
97 void shutdownComputer(void);
98 void startButtonPressed(void);
99 void updateLabelPos(void);