Fix help display. Regression introduced when 8-Bit/10-Bit support was added.

This commit is contained in:
LoRd_MuldeR 2012-03-29 15:20:26 +02:00
parent b7acf86d6e
commit d55e24e3be
7 changed files with 22 additions and 16 deletions

View File

@ -299,7 +299,7 @@ bool EncodeThread::runEncodingPass(bool x264_x64, bool x264_10bit, bool avs2yuv_
processAvisynth.setStandardOutputProcess(&processEncode);
log("Creating Avisynth process:");
if(!startProcess(processAvisynth, QString("%1/%2.exe").arg(m_binDir, avs2yuv_x64 ? "avs2yuv_x64" : "avs2yuv"), cmdLine_Avisynth, false))
if(!startProcess(processAvisynth, QString("%1/%2.exe").arg(m_binDir, avs2yuv_x64 ? "avs2yuv_x64" : "avs2yuv_x86"), cmdLine_Avisynth, false))
{
return false;
}
@ -693,7 +693,7 @@ unsigned int EncodeThread::checkVersionAvs2yuv(bool x64)
QProcess process;
log("\nCreating process:");
if(!startProcess(process, QString("%1/%2.exe").arg(m_binDir, x64 ? "avs2yuv_x64" : "avs2yuv"), QStringList()))
if(!startProcess(process, QString("%1/%2.exe").arg(m_binDir, x64 ? "avs2yuv_x64" : "avs2yuv_x86"), QStringList()))
{
return false;;
}
@ -802,7 +802,7 @@ bool EncodeThread::checkProperties(bool x64, unsigned int &frames)
cmdLine << pathToLocal(QDir::toNativeSeparators(m_sourceFileName)) << "NUL";
log("Creating process:");
if(!startProcess(process, QString("%1/%2.exe").arg(m_binDir, x64 ? "avs2yuv_x64" : "avs2yuv"), cmdLine))
if(!startProcess(process, QString("%1/%2.exe").arg(m_binDir, x64 ? "avs2yuv_x64" : "avs2yuv_x86"), cmdLine))
{
return false;;
}

View File

@ -22,7 +22,7 @@
#define VER_X264_MAJOR 2
#define VER_X264_MINOR 0
#define VER_X264_PATCH 3
#define VER_X264_BUILD 291
#define VER_X264_BUILD 294
#define VER_X264_MINIMUM_REV 2164
#define VER_X264_CURRENT_API 122

View File

@ -185,12 +185,13 @@ public:
// Constructor & Destructor
///////////////////////////////////////////////////////////////////////////////
AddJobDialog::AddJobDialog(QWidget *parent, OptionsModel *options, bool x64supported)
AddJobDialog::AddJobDialog(QWidget *parent, OptionsModel *options, bool x64supported, bool use10BitEncoding)
:
QDialog(parent),
m_defaults(new OptionsModel()),
m_options(options),
m_x64supported(x64supported),
m_use10BitEncoding(use10BitEncoding),
m_initialDir_src(QDir::fromNativeSeparators(QDesktopServices::storageLocation(QDesktopServices::MoviesLocation))),
m_initialDir_out(QDir::fromNativeSeparators(QDesktopServices::storageLocation(QDesktopServices::MoviesLocation))),
m_lastFilterIndex(0)
@ -310,13 +311,13 @@ bool AddJobDialog::eventFilter(QObject *o, QEvent *e)
{
if((o == labelHelpScreenX264) && (e->type() == QEvent::MouseButtonPress))
{
HelpDialog *helpScreen = new HelpDialog(this, false, m_x64supported);
HelpDialog *helpScreen = new HelpDialog(this, false, m_x64supported, m_use10BitEncoding);
helpScreen->exec();
X264_DELETE(helpScreen);
}
else if((o == labelHelpScreenAvs2YUV) && (e->type() == QEvent::MouseButtonPress))
{
HelpDialog *helpScreen = new HelpDialog(this, true, m_x64supported);
HelpDialog *helpScreen = new HelpDialog(this, true, m_x64supported, m_use10BitEncoding);
helpScreen->exec();
X264_DELETE(helpScreen);
}

View File

@ -32,7 +32,7 @@ class AddJobDialog : public QDialog, private Ui::AddJobDialog
Q_OBJECT
public:
AddJobDialog(QWidget *parent, OptionsModel *options, bool x64supported);
AddJobDialog(QWidget *parent, OptionsModel *options, bool x64supported, bool use10BitEncoding);
~AddJobDialog(void);
QString sourceFile(void);
@ -51,6 +51,7 @@ protected:
OptionsModel *m_defaults;
const bool m_x64supported;
const bool m_use10BitEncoding;
QStringList m_types;
QString m_initialDir_src;

View File

@ -26,16 +26,19 @@
#include <QScrollBar>
#include <QTimer>
#define X264_BINARY(BIN_DIR, IS_10BIT, IS_X64) QString("%1/x264_%2_%3.exe").arg((BIN_DIR), ((IS_10BIT) ? "10bit" : "8bit"), ((IS_X64) ? "x64" : "x86"))
///////////////////////////////////////////////////////////////////////////////
// Constructor & Destructor
///////////////////////////////////////////////////////////////////////////////
HelpDialog::HelpDialog(QWidget *parent, bool avs2yuv, bool x64supported)
HelpDialog::HelpDialog(QWidget *parent, bool avs2yuv, bool x64supported, bool use10BitEncoding)
:
QDialog(parent),
m_appDir(QApplication::applicationDirPath()),
m_appDir(QApplication::applicationDirPath() + "/toolset"),
m_avs2yuv(avs2yuv),
m_x64supported(x64supported),
m_use10BitEncoding(use10BitEncoding),
m_process(new QProcess())
{
//Init the dialog, from the .ui file
@ -74,11 +77,11 @@ void HelpDialog::showEvent(QShowEvent *event)
if(!m_avs2yuv)
{
m_process->start(QString("%1/toolset/%2.exe").arg(m_appDir, m_x64supported ? "x264_x64" : "x264"), QStringList() << "--version");
m_process->start(X264_BINARY(m_appDir, m_use10BitEncoding, m_x64supported), QStringList() << "--version");
}
else
{
m_process->start(QString("%1/toolset/%2.exe").arg(m_appDir, m_x64supported ? "avs2yuv_x64" : "avs2yuv"), QStringList());
m_process->start(QString("%1/%2.exe").arg(m_appDir, m_x64supported ? "avs2yuv_x64" : "avs2yuv_x86"), QStringList());
}
if(!m_process->waitForStarted())
@ -123,7 +126,7 @@ void HelpDialog::finished(void)
m_startAgain = false;
if(!m_avs2yuv)
{
m_process->start(QString("%1/toolset/x264.exe").arg(m_appDir), QStringList() << "--fullhelp");
m_process->start(X264_BINARY(m_appDir, m_use10BitEncoding, m_x64supported), QStringList() << "--fullhelp");
plainTextEdit->appendPlainText("\n--------\n");
if(!m_process->waitForStarted())

View File

@ -30,7 +30,7 @@ class HelpDialog : public QDialog, private Ui::HelpDialog
Q_OBJECT
public:
HelpDialog(QWidget *parent, bool avs2yuv, bool x64supported);
HelpDialog(QWidget *parent, bool avs2yuv, bool x64supported, bool use10BitEncoding);
~HelpDialog(void);
private slots:
@ -46,6 +46,7 @@ private:
protected:
const bool m_avs2yuv;
const bool m_x64supported;
const bool m_use10BitEncoding;
virtual void showEvent(QShowEvent *event);
virtual void closeEvent(QCloseEvent *e);

View File

@ -209,7 +209,7 @@ void MainWindow::addButtonPressed(const QString &filePathIn, const QString &file
if(ok) *ok = false;
AddJobDialog *addDialog = new AddJobDialog(this, options ? options : m_options, m_cpuFeatures->x64);
AddJobDialog *addDialog = new AddJobDialog(this, options ? options : m_options, m_cpuFeatures->x64, m_preferences.use10BitEncoding);
addDialog->setRunImmediately(countRunningJobs() < (m_preferences.autoRunNextJob ? m_preferences.maxRunningJobCount : 1));
if(options) addDialog->setWindowTitle(tr("Restart Job"));
@ -630,7 +630,7 @@ void MainWindow::shutdownComputer(void)
*/
void MainWindow::init(void)
{
static const char *binFiles = "x264_8bit_x86.exe:x264_8bit_x64.exe:x264_10bit_x86.exe:x264_10bit_x64.exe:avs2yuv.exe:avs2yuv_x64.exe";
static const char *binFiles = "x264_8bit_x86.exe:x264_8bit_x64.exe:x264_10bit_x86.exe:x264_10bit_x64.exe:avs2yuv_x86.exe:avs2yuv_x64.exe";
QStringList binaries = QString::fromLatin1(binFiles).split(":", QString::SkipEmptyParts);
updateLabelPos();