2012-01-29 04:06:07 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Simple x264 Launcher
|
2013-05-11 21:52:07 +02:00
|
|
|
// Copyright (C) 2004-2013 LoRd_MuldeR <MuldeR2@GMX.de>
|
2012-01-29 04:06:07 +01:00
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation; either version 2 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License along
|
|
|
|
// with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
//
|
|
|
|
// http://www.gnu.org/licenses/gpl-2.0.txt
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2013-11-14 02:29:18 +01:00
|
|
|
#include <QDialog>
|
2012-02-02 13:52:52 +01:00
|
|
|
|
2012-01-29 19:14:46 +01:00
|
|
|
class OptionsModel;
|
2013-07-03 21:34:21 +02:00
|
|
|
class RecentlyUsed;
|
2013-11-14 02:29:18 +01:00
|
|
|
class QComboBox;
|
|
|
|
|
|
|
|
namespace Ui
|
|
|
|
{
|
|
|
|
class AddJobDialog;
|
|
|
|
}
|
2012-01-29 19:14:46 +01:00
|
|
|
|
2013-11-14 02:29:18 +01:00
|
|
|
class AddJobDialog : public QDialog
|
2012-01-29 04:06:07 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2013-05-08 22:46:25 +02:00
|
|
|
AddJobDialog(QWidget *parent, OptionsModel *options, RecentlyUsed *recentlyUsed, bool x64supported, bool use10BitEncoding, bool saveToSourceFolder);
|
|
|
|
~AddJobDialog(void);
|
|
|
|
|
2012-01-29 21:31:09 +01:00
|
|
|
QString sourceFile(void);
|
|
|
|
QString outputFile(void);
|
2013-11-14 02:29:18 +01:00
|
|
|
QString preset(void);
|
|
|
|
QString tuning(void);
|
|
|
|
QString profile(void);
|
|
|
|
QString params(void);
|
|
|
|
bool runImmediately(void);
|
|
|
|
bool applyToAll(void);
|
|
|
|
void setRunImmediately(bool run);
|
|
|
|
void setSourceFile(const QString &path);
|
|
|
|
void setOutputFile(const QString &path);
|
|
|
|
void setSourceEditable(const bool editable);
|
|
|
|
void setApplyToAllVisible(const bool visible);
|
2013-05-08 00:04:40 +02:00
|
|
|
|
|
|
|
static QString generateOutputFileName(const QString &sourceFilePath, const QString &destinationDirectory, const int filterIndex, const bool saveToSourceDir);
|
|
|
|
static int getFilterIdx(const QString &fileExt);
|
|
|
|
static QString getFilterExt(const int filterIndex);
|
2013-05-08 22:46:25 +02:00
|
|
|
static QString AddJobDialog::getFilterStr(const int filterIndex);
|
|
|
|
static QString getFilterLst(void);
|
|
|
|
static QString getInputFilterLst(void);
|
2012-01-29 15:57:23 +01:00
|
|
|
|
2012-01-29 04:06:07 +01:00
|
|
|
protected:
|
2012-01-29 19:14:46 +01:00
|
|
|
OptionsModel *m_options;
|
2012-01-31 03:03:17 +01:00
|
|
|
OptionsModel *m_defaults;
|
2013-05-08 00:04:40 +02:00
|
|
|
RecentlyUsed *m_recentlyUsed;
|
|
|
|
|
2012-02-03 12:31:51 +01:00
|
|
|
const bool m_x64supported;
|
2012-03-29 15:20:26 +02:00
|
|
|
const bool m_use10BitEncoding;
|
2012-05-14 21:47:47 +02:00
|
|
|
const bool m_saveToSourceFolder;
|
2012-02-03 12:31:51 +01:00
|
|
|
|
2012-01-31 00:13:32 +01:00
|
|
|
virtual void showEvent(QShowEvent *event);
|
|
|
|
virtual bool eventFilter(QObject *o, QEvent *e);
|
2012-02-10 18:42:16 +01:00
|
|
|
virtual void dragEnterEvent(QDragEnterEvent *event);
|
|
|
|
virtual void dropEvent(QDropEvent *event);
|
2012-01-29 04:06:07 +01:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void modeIndexChanged(int index);
|
2012-01-29 15:57:23 +01:00
|
|
|
void browseButtonClicked(void);
|
2012-01-31 03:03:17 +01:00
|
|
|
void configurationChanged(void);
|
|
|
|
void templateSelected(void);
|
2012-01-31 22:30:21 +01:00
|
|
|
void saveTemplateButtonClicked(void);
|
|
|
|
void deleteTemplateButtonClicked(void);
|
2012-02-16 02:08:46 +01:00
|
|
|
void editorActionTriggered(void);
|
2012-02-16 14:33:26 +01:00
|
|
|
void copyActionTriggered(void);
|
|
|
|
void pasteActionTriggered(void);
|
2012-01-29 15:57:23 +01:00
|
|
|
|
|
|
|
virtual void accept(void);
|
2012-01-29 19:14:46 +01:00
|
|
|
|
|
|
|
private:
|
2013-11-14 02:29:18 +01:00
|
|
|
Ui::AddJobDialog *const ui;
|
|
|
|
|
2012-01-31 22:30:21 +01:00
|
|
|
void loadTemplateList(void);
|
2012-01-29 19:14:46 +01:00
|
|
|
void restoreOptions(OptionsModel *options);
|
|
|
|
void saveOptions(OptionsModel *options);
|
|
|
|
void updateComboBox(QComboBox *cbox, const QString &text);
|
2013-05-11 01:50:05 +02:00
|
|
|
|
|
|
|
QString currentSourcePath(const bool bWithName = false);
|
|
|
|
QString currentOutputPath(const bool bWithName = false);
|
|
|
|
int currentOutputIndx(void);
|
2012-01-29 04:06:07 +01:00
|
|
|
};
|