From a30b5b73003cddb0fde73b46c86ea91fd07b8a86 Mon Sep 17 00:00:00 2001 From: lordmulder Date: Mon, 30 Jan 2012 17:50:19 +0100 Subject: [PATCH] Check x264 version + added simple build script. --- etc/date.exe | Bin 0 -> 39424 bytes gui/win_addJob.ui | 6 +- gui/win_main.ui | 11 +++ src/global.cpp | 8 +- src/model_jobList.cpp | 24 ++++- src/model_options.h | 2 +- src/thread_encode.cpp | 206 ++++++++++++++++++++++++++++++++---------- src/thread_encode.h | 6 +- src/version.h | 5 +- src/win_addJob.cpp | 49 ++++++++-- src/win_addJob.h | 1 + src/win_main.cpp | 40 ++++++-- x264_launcher.vcxproj | 16 ++++ z_build.bat | 70 ++++++++++++++ 14 files changed, 367 insertions(+), 77 deletions(-) create mode 100644 etc/date.exe create mode 100644 z_build.bat diff --git a/etc/date.exe b/etc/date.exe new file mode 100644 index 0000000000000000000000000000000000000000..069bae14814d7b3fe2bab4ebd63dd41025bb5cc8 GIT binary patch literal 39424 zcmeIb4R}=5xi7wEG6_QnOn{(KgN!W^A`lZkED59zgaJ_kAt4AN4I!B@!F+XQZv#jm zI2mQLJ8f#E?P=>NJk)c%tv#1xsYMY;2seRB+lU@Z#VWPbv&Z4IsiqJiW&Xc+t+i(+ zRC{{<_de&j_dI7OYwvfh^{#il>s{~q{+N=7I#?28%mx#UGIkhWdR+Yd*I#Y$9y96X zG3?ODpWSiTvg~Jftn$|Roz1?cO}?rIXLVI$W0T_C=yCegMrU24bJ2=&XG2qsCwKJd z)X9=`shhE7790D@b14O8Y!{frGRk889QzVnQejdUdt)rV=`j0Xh&zI02kso2{M4CbWKl{m5JX;h*nzsipVu;cjO9Ws%PR2Im)>J7~fS)6W zeK1Hf>wrmkT#R+*ZuI-f=>pL>NYGzCZG=}R2=X*{0>=*X6imY70$zgkzrp{)5~$FA z7r2z!>mH&s22Kuy+(V_&IlK3{SjatC>a_vzGQ5n(b~ARmyMyD~^$A~sTkx#%*#1|# zTue*fe-fWyr*eDXFY2AU7PUD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A^qpJew%E7U*=sl|%y5I>C${qomsYOJa!n%k}Z7@=KOWJ|S|%j$6s zQx0Jrl3*#tJp?!MtYhD@3T~dUDor?}%+qzi`e;m$%aKOJT3OZHT&Zkr<}zcQASlfP t?y}|XWwU1H*3@%eGT{F2nFjx()jmapm - buttonAccept - buttonCancel editSource buttonBrowseSource editOutput @@ -770,6 +768,10 @@ cbxPreset cbxTuning cbxProfile + cbxCustomParams + checkBoxRun + buttonAccept + buttonCancel diff --git a/gui/win_main.ui b/gui/win_main.ui index 97a224d..c8adbf4 100644 --- a/gui/win_main.ui +++ b/gui/win_main.ui @@ -290,7 +290,9 @@ + + @@ -360,6 +362,15 @@ MeWiki - x264 Settings + + + + :/buttons/book_open.png:/buttons/book_open.png + + + x264 BluRay Authoring + + buttonAddJob diff --git a/src/global.cpp b/src/global.cpp index e0f275c..f101cc7 100644 --- a/src/global.cpp +++ b/src/global.cpp @@ -230,7 +230,7 @@ void x264_message_handler(QtMsgType type, const char *msg) } else { - QString temp("[LameXP][%1] %2"); + QString temp("[x264][%1] %2"); switch(type) { @@ -253,7 +253,7 @@ void x264_message_handler(QtMsgType type, const char *msg) if(type == QtCriticalMsg || type == QtFatalMsg) { lock.unlock(); - MessageBoxW(NULL, QWCHAR(QString::fromUtf8(msg)), L"LameXP - GURU MEDITATION", MB_ICONERROR | MB_TOPMOST | MB_TASKMODAL); + MessageBoxW(NULL, QWCHAR(QString::fromUtf8(msg)), L"Simple x264 Launcher - GURU MEDITATION", MB_ICONERROR | MB_TOPMOST | MB_TASKMODAL); FatalAppExit(0, L"The application has encountered a critical error and will exit now!"); TerminateProcess(GetCurrentProcess(), -1); } @@ -698,7 +698,7 @@ bool x264_init_qt(int argc, char* argv[]) //Create Qt application instance and setup version info QApplication *application = new QApplication(argc, argv); - application->setApplicationName("LameXP - Audio Encoder Front-End"); + application->setApplicationName("Simple x264 Launcher"); application->setApplicationVersion(QString().sprintf("%d.%02d", x264_version_major(), x264_version_minor())); application->setOrganizationName("LoRd_MuldeR"); application->setOrganizationDomain("mulder.at.gg"); @@ -731,7 +731,7 @@ bool x264_init_qt(int argc, char* argv[]) //Check for process elevation if(!x264_check_elevation()) { - if(QMessageBox::warning(NULL, "LameXP", "LameXP was started with elevated rights. This is a potential security risk!", "Quit Program (Recommended)", "Ignore") == 0) + if(QMessageBox::warning(NULL, "Simple x264 Launcher", "Program was started with elevated rights. This is a potential security risk!", "Quit Program (Recommended)", "Ignore") == 0) { return false; } diff --git a/src/model_jobList.cpp b/src/model_jobList.cpp index 1ebbd4a..c63b7b5 100644 --- a/src/model_jobList.cpp +++ b/src/model_jobList.cpp @@ -210,9 +210,31 @@ QModelIndex JobListModel::insertJob(EncodeThread *thread) return QModelIndex(); } + int n = 2; + QString jobName = QFileInfo(thread->sourceFileName()).completeBaseName(); + + forever + { + bool unique = true; + for(int i = 0; i < m_jobs.count(); i++) + { + if(m_name.value(m_jobs.at(i)).compare(jobName, Qt::CaseInsensitive) == 0) + { + unique = false; + break; + } + } + if(!unique) + { + jobName = QString("%1 (%2)").arg(QFileInfo(thread->sourceFileName()).completeBaseName(), QString::number(n++)); + continue; + } + break; + } + beginInsertRows(QModelIndex(), m_jobs.count(), m_jobs.count()); m_jobs.append(id); - m_name.insert(id, QFileInfo(thread->sourceFileName()).completeBaseName()); + m_name.insert(id, jobName); m_status.insert(id, EncodeThread::JobStatus_Enqueued); m_progress.insert(id, 0); m_threads.insert(id, thread); diff --git a/src/model_options.h b/src/model_options.h index 9c4d75c..1bd3e56 100644 --- a/src/model_options.h +++ b/src/model_options.h @@ -48,7 +48,7 @@ public: QString custom(void) const { return m_custom; } //Setter - void setRCMode(RCMode mode) { m_rcMode = qBound(RCMode_CQ, mode, RCMode_ABR); } + void setRCMode(RCMode mode) { m_rcMode = qBound(RCMode_CRF, mode, RCMode_ABR); } void setBitrate(unsigned int bitrate) { m_bitrate = qBound(100U, bitrate, 250000U); } void setQuantizer(unsigned int quantizer) { m_quantizer = qBound(0U, quantizer, 52U); } void setPreset(const QString &preset) { m_preset = preset.trimmed(); } diff --git a/src/thread_encode.cpp b/src/thread_encode.cpp index eac097c..e285019 100644 --- a/src/thread_encode.cpp +++ b/src/thread_encode.cpp @@ -23,6 +23,7 @@ #include "global.h" #include "model_options.h" +#include "version.h" #include #include @@ -45,17 +46,41 @@ typedef BOOL (WINAPI *AssignProcessToJobObjectFun)(__in HANDLE hJob, __in HANDLE QMutex EncodeThread::m_mutex_startProcess; HANDLE EncodeThread::m_handle_jobObject = NULL; +/* + * Macros + */ +#define CHECK_STATUS(ABORT_FLAG, OK_FLAG) \ +{ \ + if(ABORT_FLAG) \ + { \ + log("\nPROCESS ABORTED BY USER !!!"); \ + setStatus(JobStatus_Aborted); \ + return; \ + } \ + else if(!(OK_FLAG)) \ + { \ + setStatus(JobStatus_Failed); \ + return; \ + } \ +} + +/* + * Static vars + */ +static const unsigned int REV_MULT = 10000; + /////////////////////////////////////////////////////////////////////////////// // Constructor & Destructor /////////////////////////////////////////////////////////////////////////////// -EncodeThread::EncodeThread(const QString &sourceFileName, const QString &outputFileName, const OptionsModel *options, const QString &binDir) +EncodeThread::EncodeThread(const QString &sourceFileName, const QString &outputFileName, const OptionsModel *options, const QString &binDir, bool x64) : m_jobId(QUuid::createUuid()), m_sourceFileName(sourceFileName), m_outputFileName(outputFileName), m_options(new OptionsModel(*options)), - m_binDir(binDir) + m_binDir(binDir), + m_x64(x64) { m_abort = false; } @@ -112,6 +137,26 @@ void EncodeThread::encode(void) bool ok = false; + //Checking version + log(tr("--- VERSION ---\n")); + unsigned int revision; + ok = ((revision = checkVersion(m_x64)) != UINT_MAX); + CHECK_STATUS(m_abort, ok); + + //Is revision supported? + log(tr("\nx264 revision: %1 (core #%2)").arg(QString::number(revision % REV_MULT), QString::number(revision / REV_MULT))); + if((revision % REV_MULT) < VER_X264_MINIMUM_REV) + { + log(tr("\nERROR: Your revision of x264 is too old! (Minimum required revision is %2)").arg(QString::number(VER_X264_MINIMUM_REV))); + setStatus(JobStatus_Failed); + return; + } + if((revision / REV_MULT) != VER_X264_CURRENT_API) + { + log(tr("\nWARNING: Your revision of x264 uses an unsupported core (API) version, take care!")); + log(tr("This application works best with x264 core (API) version %2.").arg(QString::number(VER_X264_CURRENT_API))); + } + //Run encoding passes if(m_options->rcMode() == OptionsModel::RCMode_2Pass) { @@ -127,65 +172,33 @@ void EncodeThread::encode(void) } } - log("--- PASS 1 ---\n"); - ok = runEncodingPass(1, passLogFile); + log(tr("\n--- PASS 1 ---\n")); + ok = runEncodingPass(m_x64, 1, passLogFile); + CHECK_STATUS(m_abort, ok); - if(m_abort) - { - log("\nPROCESS ABORTED BY USER !!!"); - setStatus(JobStatus_Aborted); - return; - } - else if(!ok) - { - setStatus(JobStatus_Failed); - return; - } - - log("\n--- PASS 2 ---\n"); - ok = runEncodingPass(2, passLogFile); - - if(m_abort) - { - log("\nPROCESS ABORTED BY USER !!!"); - setStatus(JobStatus_Aborted); - return; - } - else if(!ok) - { - setStatus(JobStatus_Failed); - return; - } + log(tr("\n--- PASS 2 ---\n")); + ok = runEncodingPass(m_x64,2, passLogFile); + CHECK_STATUS(m_abort, ok); } else { - log("--- ENCODING ---\n"); - ok = runEncodingPass(); - - if(m_abort) - { - log("\nPROCESS ABORTED BY USER !!!"); - setStatus(JobStatus_Aborted); - return; - } - else if(!ok) - { - setStatus(JobStatus_Failed); - return; - } + log(tr("\n--- ENCODING ---\n")); + ok = runEncodingPass(m_x64); + CHECK_STATUS(m_abort, ok); } - log(tr("\nJob finished at %1, %2.\n").arg(QDate::currentDate().toString(Qt::ISODate), QTime::currentTime().toString( Qt::ISODate))); + log(tr("\n--- DONE ---\n")); + log(tr("Job finished at %1, %2.\n").arg(QDate::currentDate().toString(Qt::ISODate), QTime::currentTime().toString( Qt::ISODate))); setStatus(JobStatus_Completed); } -bool EncodeThread::runEncodingPass(int pass, const QString &passLogFile) +bool EncodeThread::runEncodingPass(bool x64, int pass, const QString &passLogFile) { QProcess process; QStringList cmdLine = buildCommandLine(pass, passLogFile); log("Creating process:"); - if(!startProcess(process, QString("%1/x264.exe").arg(m_binDir), cmdLine)) + if(!startProcess(process, QString("%1/%2.exe").arg(m_binDir, x64 ? "x264_x64" : "x264"), cmdLine)) { return false;; } @@ -226,17 +239,17 @@ bool EncodeThread::runEncodingPass(int pass, const QString &passLogFile) { bool ok = false; unsigned int progress = regExpProgress.cap(1).toUInt(&ok); - if(ok) setProgress(progress); setStatus((pass == 2) ? JobStatus_Running_Pass2 : ((pass == 1) ? JobStatus_Running_Pass1 : JobStatus_Running)); setDetails(text.mid(offset).trimmed()); + if(ok) setProgress(progress); } else if((offset = regExpIndexing.lastIndexIn(text)) >= 0) { bool ok = false; unsigned int progress = regExpIndexing.cap(1).toUInt(&ok); - if(ok) setProgress(progress); setStatus(JobStatus_Indexing); setDetails(text.mid(offset).trimmed()); + if(ok) setProgress(progress); } else if(!text.isEmpty()) { @@ -309,6 +322,88 @@ QStringList EncodeThread::buildCommandLine(int pass, const QString &passLogFile) return cmdLine; } +unsigned int EncodeThread::checkVersion(bool x64) +{ + QProcess process; + QStringList cmdLine = QStringList() << "--version"; + + log("Creating process:"); + if(!startProcess(process, QString("%1/%2.exe").arg(m_binDir, x64 ? "x264_x64" : "x264"), cmdLine)) + { + return false;; + } + + QRegExp regExpVersion("x264 (\\d)\\.(\\d+)\\.(\\d+) ([0-9A-Fa-f]{7})"); + + bool bTimeout = false; + bool bAborted = false; + + unsigned int revision = UINT_MAX; + unsigned int coreVers = UINT_MAX; + + while(process.state() != QProcess::NotRunning) + { + if(m_abort) + { + process.kill(); + bAborted = true; + break; + } + if(!process.waitForReadyRead(m_processTimeoutInterval)) + { + if(process.state() == QProcess::Running) + { + process.kill(); + qWarning("x264 process timed out <-- killing!"); + log("\nPROCESS TIMEOUT !!!"); + bTimeout = true; + break; + } + } + while(process.bytesAvailable() > 0) + { + QList lines = process.readLine().split('\r'); + while(!lines.isEmpty()) + { + QString text = QString::fromUtf8(lines.takeFirst().constData()).simplified(); + int offset = -1; + if((offset = regExpVersion.lastIndexIn(text)) >= 0) + { + bool ok1 = false, ok2 = false; + unsigned int temp1 = regExpVersion.cap(2).toUInt(&ok1); + unsigned int temp2 = regExpVersion.cap(3).toUInt(&ok2); + if(ok1) coreVers = temp1; + if(ok2) revision = temp2; + } + if(!text.isEmpty()) + { + log(text); + } + } + } + } + + process.waitForFinished(); + if(process.state() != QProcess::NotRunning) + { + process.kill(); + process.waitForFinished(-1); + } + + if(bTimeout || bAborted || process.exitCode() != EXIT_SUCCESS) + { + return UINT_MAX; + } + + if((revision == UINT_MAX) || (coreVers == UINT_MAX)) + { + log(tr("\nFAILED TO DETERMINE X264 VERSION !!!")); + return UINT_MAX; + } + + return (coreVers * REV_MULT) + revision; +} + /////////////////////////////////////////////////////////////////////////////// // Misc functions /////////////////////////////////////////////////////////////////////////////// @@ -318,8 +413,19 @@ void EncodeThread::setStatus(JobStatus newStatus) if(m_status != newStatus) { m_status = newStatus; + if((newStatus != JobStatus_Completed) && (newStatus != JobStatus_Failed) && (newStatus != JobStatus_Aborted)) + { + setProgress(0); + } + if(newStatus == JobStatus_Failed) + { + setDetails("The job has failed. See log for details!"); + } + if(newStatus == JobStatus_Aborted) + { + setDetails("The job was aborted by the user!"); + } emit statusChanged(m_jobId, newStatus); - setProgress(0); } } diff --git a/src/thread_encode.h b/src/thread_encode.h index 52f474a..92aa3b3 100644 --- a/src/thread_encode.h +++ b/src/thread_encode.h @@ -48,7 +48,7 @@ public: JobStatus_Aborted = 9 }; - EncodeThread(const QString &sourceFileName, const QString &outputFileName, const OptionsModel *options, const QString &binDir); + EncodeThread(const QString &sourceFileName, const QString &outputFileName, const OptionsModel *options, const QString &binDir, bool x64); ~EncodeThread(void); QUuid getId(void) { return this->m_jobId; }; @@ -69,6 +69,7 @@ protected: const QString m_outputFileName; const OptionsModel *m_options; const QString m_binDir; + const bool m_x64; //Flags volatile bool m_abort; @@ -82,8 +83,9 @@ protected: //Encode functions void encode(void); - bool runEncodingPass(int pass = 0, const QString &passLogFile = QString()); + bool runEncodingPass(bool x64, int pass = 0, const QString &passLogFile = QString()); QStringList buildCommandLine(int pass = 0, const QString &passLogFile = QString()); + unsigned int checkVersion(bool x64); //Auxiallary Stuff void log(const QString &text) { emit messageLogged(m_jobId, text); } diff --git a/src/version.h b/src/version.h index 11ab6c4..9772932 100644 --- a/src/version.h +++ b/src/version.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// LameXP - Audio Encoder Front-End +// Simple x264 Launcher // Copyright (C) 2004-2012 LoRd_MuldeR // // This program is free software; you can redistribute it and/or modify @@ -21,3 +21,6 @@ #define VER_X264_MAJOR (2) #define VER_X264_MINOR (0) + +#define VER_X264_MINIMUM_REV (2146) +#define VER_X264_CURRENT_API (120) diff --git a/src/win_addJob.cpp b/src/win_addJob.cpp index a439f10..199bf95 100644 --- a/src/win_addJob.cpp +++ b/src/win_addJob.cpp @@ -33,6 +33,21 @@ #include #include +static const struct +{ + const char *name; + const char *fext; +} +g_filters[] = +{ + {"Avisynth Scripts", "avs"}, + {"Matroska Files", "mkv"}, + {"MPEG-4 Part 14 Container", "mp4"}, + {"Audio Video Interleaved", "avi"}, + {"Flash Video", "flv"}, + {NULL, NULL} +}; + /////////////////////////////////////////////////////////////////////////////// // Validator /////////////////////////////////////////////////////////////////////////////// @@ -165,15 +180,8 @@ void AddJobDialog::browseButtonClicked(void) if(QObject::sender() == buttonBrowseSource) { - QString filters; - filters += tr("Avisynth Scripts (*.avs)").append(";;"); - filters += tr("Matroska Files (*.mkv)").append(";;"); - filters += tr("MPEG-4 Part 14 Container (*.mp4)").append(";;"); - filters += tr("Audio Video Interleaved (*.avi)").append(";;"); - filters += tr("Flash Video (*.flv)").append(";;"); - - QString filePath = QFileDialog::getOpenFileName(this, tr("Open Source File"), initialDir, filters); - + QString filePath = QFileDialog::getOpenFileName(this, tr("Open Source File"), initialDir, makeFileFilter()); + if(!(filePath.isNull() || filePath.isEmpty())) { editSource->setText(QDir::toNativeSeparators(filePath)); @@ -200,7 +208,7 @@ void AddJobDialog::browseButtonClicked(void) QString filters; filters += tr("Matroska Files (*.mkv)").append(";;"); filters += tr("MPEG-4 Part 14 Container (*.mp4)").append(";;"); - filters += tr("H.264 Elementary Stream (*.264)").append(";;"); + filters += tr("H.264 Elementary Stream (*.264)"); QString filePath = QFileDialog::getSaveFileName(this, tr("Choose Output File"), initialDir, filters); @@ -254,6 +262,7 @@ void AddJobDialog::restoreOptions(OptionsModel *options) void AddJobDialog::saveOptions(OptionsModel *options) { + qWarning("Current index: %d", cbxRateControlMode->currentIndex()); options->setRCMode(static_cast(cbxRateControlMode->currentIndex())); options->setQuantizer(spinQuantizer->value()); options->setBitrate(spinBitrate->value()); @@ -262,3 +271,23 @@ void AddJobDialog::saveOptions(OptionsModel *options) options->setProfile(cbxProfile->model()->data(cbxProfile->model()->index(cbxProfile->currentIndex(), 0)).toString()); options->setCustom(cbxCustomParams->currentText()); } + +QString AddJobDialog::makeFileFilter(void) +{ + QString filters("All supported files ("); + + for(size_t index = 0; g_filters[index].name && g_filters[index].fext; index++) + { + filters += QString((index > 0) ? " *.%1" : "*.%1").arg(QString::fromLatin1(g_filters[index].fext)); + } + + filters += QString(");;"); + + for(size_t index = 0; g_filters[index].name && g_filters[index].fext; index++) + { + filters += QString("%1 (*.%2);;").arg(QString::fromLatin1(g_filters[index].name), QString::fromLatin1(g_filters[index].fext)); + } + + filters += QString("All files (*.*)"); + return filters; +} diff --git a/src/win_addJob.h b/src/win_addJob.h index 4440579..1aa34ec 100644 --- a/src/win_addJob.h +++ b/src/win_addJob.h @@ -57,4 +57,5 @@ private: void restoreOptions(OptionsModel *options); void saveOptions(OptionsModel *options); void updateComboBox(QComboBox *cbox, const QString &text); + QString makeFileFilter(void); }; diff --git a/src/win_main.cpp b/src/win_main.cpp index 29bdc6a..e69e15d 100644 --- a/src/win_main.cpp +++ b/src/win_main.cpp @@ -33,9 +33,12 @@ #include #include #include +#include const char *home_url = "http://mulder.brhack.net/"; +#define PRE_RELEASE (1) + /////////////////////////////////////////////////////////////////////////////// // Constructor & Destructor /////////////////////////////////////////////////////////////////////////////// @@ -60,7 +63,8 @@ MainWindow::MainWindow(bool x64supported) //Update title labelBuildDate->setText(tr("Built on %1 at %2").arg(x264_version_date().toString(Qt::ISODate), QString::fromLatin1(x264_version_time()))); - if(m_x64supported) setWindowTitle(QString("%1 (x64)").arg(windowTitle())); + setWindowTitle(QString("%1 (%2 Mode)").arg(windowTitle(), m_x64supported ? "64-Bit" : "32-Bit")); + if(PRE_RELEASE) setWindowTitle(QString("%1 | PRE-RELEASE VERSION").arg(windowTitle())); //Create model m_jobList = new JobListModel(); @@ -89,6 +93,7 @@ MainWindow::MainWindow(bool x64supported) connect(actionWebKomisar, SIGNAL(triggered()), this, SLOT(showWebLink())); connect(actionWebJarod, SIGNAL(triggered()), this, SLOT(showWebLink())); connect(actionWebWiki, SIGNAL(triggered()), this, SLOT(showWebLink())); + connect(actionWebBluRay, SIGNAL(triggered()), this, SLOT(showWebLink())); //Create options object m_options = new OptionsModel(); @@ -118,12 +123,15 @@ void MainWindow::addButtonPressed(void) if(result == QDialog::Accepted) { + qDebug("RC Mode: %d", m_options->rcMode()); + EncodeThread *thrd = new EncodeThread ( addDialog->sourceFile(), addDialog->outputFile(), m_options, - QString("%1/toolset").arg(m_appDir) + QString("%1/toolset").arg(m_appDir), + m_x64supported ); QModelIndex newIndex = m_jobList->insertJob(thrd); @@ -238,6 +246,7 @@ void MainWindow::showWebLink(void) if(QObject::sender() == actionWebKomisar) QDesktopServices::openUrl(QUrl("http://komisar.gin.by/")); if(QObject::sender() == actionWebJarod) QDesktopServices::openUrl(QUrl("http://www.x264.nl/")); if(QObject::sender() == actionWebWiki) QDesktopServices::openUrl(QUrl("http://mewiki.project357.com/wiki/X264_Settings")); + if(QObject::sender() == actionWebBluRay) QDesktopServices::openUrl(QUrl("http://www.x264bluray.com/")); } void MainWindow::launchNextJob(void) @@ -272,6 +281,7 @@ void MainWindow::init(void) static const char *binFiles = "x264.exe:x264_x64.exe:avs2yuv.exe:pipebuf.exe"; QStringList binaries = QString::fromLatin1(binFiles).split(":", QString::SkipEmptyParts); + //Check all binaries while(!binaries.isEmpty()) { QString current = binaries.takeFirst(); @@ -285,13 +295,31 @@ void MainWindow::init(void) X264_DELETE(file); QMessageBox::critical(this, tr("File Not Found!"), tr("At least on required tool could not be found:
%1

Please re-install the program in order to fix the problem!
").arg(QDir::toNativeSeparators(QString("%1/toolset/%2").arg(m_appDir, current))).replace("-", "−")); qFatal(QString("Binary not found: %1/toolset/%2").arg(m_appDir, current).toLatin1().constData()); - return; + close(); qApp->exit(-1); return; } } - qsrand(time(NULL)); int rnd = qrand() % 3; - int val = QMessageBox::warning(this, tr("Pre-Release Version"), tr("Note: This is a pre-release version. Please do NOT use for production!

Click the button #%1 in order to continue...").arg(QString::number(rnd + 1)), tr("(1)"), tr("(2)"), tr("(3)"), qrand() % 3); - if(rnd != val) { close(); } + //Pre-release popup + if(PRE_RELEASE) + { + qsrand(time(NULL)); int rnd = qrand() % 3; + int val = QMessageBox::information(this, tr("Pre-Release Version"), tr("Note: This is a pre-release version. Please do NOT use for production!
Click the button #%1 in order to continue...

(There will be no such message box in the final version of this application)").arg(QString::number(rnd + 1)), tr("(1)"), tr("(2)"), tr("(3)"), qrand() % 3); + if(rnd != val) { close(); qApp->exit(-1); return; } + } + + //Check for Avisynth support + bool avsAvailable = false; + QLibrary *avsLib = new QLibrary("avisynth.dll"); + if(avsLib->load()) + { + avsAvailable = (avsLib->resolve("avs_create_script_environment") != NULL); + } + if(!avsAvailable) + { + avsLib->unload(); X264_DELETE(avsLib); + int val = QMessageBox::warning(this, tr("Avisynth Missing"), tr("It appears that Avisynth is not currently installed on your computer.
Thus Avisynth input will not be working at all!

Please download and install Avisynth:
http://sourceforge.net/projects/avisynth2/files/AviSynth 2.5/
").replace("-", "−"), tr("Quit"), tr("Ignore")); + if(val != 1) { close(); qApp->exit(-1); return; } + } } /////////////////////////////////////////////////////////////////////////////// diff --git a/x264_launcher.vcxproj b/x264_launcher.vcxproj index 35707ad..45fa97b 100644 --- a/x264_launcher.vcxproj +++ b/x264_launcher.vcxproj @@ -91,6 +91,22 @@ QtMain.lib;QtCore4.lib;QtGui4.lib;%(AdditionalDependencies) UseLinkTimeCodeGeneration + + + + + + + + + + + + + + + + diff --git a/z_build.bat b/z_build.bat new file mode 100644 index 0000000..557a8f5 --- /dev/null +++ b/z_build.bat @@ -0,0 +1,70 @@ +@echo off +REM /////////////////////////////////////////////////////////////////////////// +set "MSVC_PATH=D:\Microsoft Visual Studio 10.0\VC" +set "NSIS_PATH=E:\NSIS\_Unicode" +set "QTVC_PATH=E:\QtSDK\4.8.0\MSVC2010" +set "UPX3_PATH=E:\UPX" +REM /////////////////////////////////////////////////////////////////////////// +call "%QTVC_PATH%\bin\qtvars.bat" +call "%MSVC_PATH%\vcvarsall.bat" x86 +echo --------------------------------------------------------------------- +echo BEGIN BUILD +echo --------------------------------------------------------------------- +MSBuild.exe /property:Configuration=release /target:clean "%~dp0\x264_launcher.sln" +if not "%ERRORLEVEL%"=="0" goto BuildError +MSBuild.exe /property:Configuration=release /target:rebuild "%~dp0\x264_launcher.sln" +if not "%ERRORLEVEL%"=="0" goto BuildError +echo --------------------------------------------------------------------- +echo BEGIN PACKAGING +echo --------------------------------------------------------------------- +set "PACK_PATH=%TMP%\~%RANDOM%%RANDOM%.tmp" +mkdir "%PACK_PATH%" +mkdir "%PACK_PATH%\imageformats" +mkdir "%PACK_PATH%\toolset" +copy "%~dp0\bin\Release\*.exe" "%PACK_PATH%" +copy "%~dp0\bin\Release\toolset\*.exe" "%PACK_PATH%\toolset" +REM /////////////////////////////////////////////////////////////////////////// +copy "%MSVC_PATH%\redist\x86\Microsoft.VC100.CRT\*.dll" "%PACK_PATH%" +copy "%QTVC_PATH%\bin\QtCore4.dll" "%PACK_PATH%" +copy "%QTVC_PATH%\bin\QtGui4.dll" "%PACK_PATH%" +copy "%QTVC_PATH%\bin\QtSvg4.dll" "%PACK_PATH%" +copy "%QTVC_PATH%\bin\QtXml4.dll" "%PACK_PATH%" +copy "%QTVC_PATH%\bin\QtXml4.dll" "%PACK_PATH%" +copy "%QTVC_PATH%\plugins\imageformats\*.dll" "%PACK_PATH%\imageformats" +del "%PACK_PATH%\imageformats\*d4.dll" +REM /////////////////////////////////////////////////////////////////////////// +"%UPX3_PATH%\upx.exe" --brute "%PACK_PATH%\*.exe" +"%UPX3_PATH%\upx.exe" --best "%PACK_PATH%\*.dll" +REM /////////////////////////////////////////////////////////////////////////// +if not exist "%~dp0\etc\date.exe" BuildError +for /F "tokens=1,2 delims=:" %%a in ('"%~dp0\etc\date.exe" +ISODATE:%%Y-%%m-%%d') do ( + if "%%a"=="ISODATE" set "ISO_DATE=%%b" +) +if "%ISO_DATE%"=="" BuildError +REM /////////////////////////////////////////////////////////////////////////// +set "NSIS_FILE=%TMP%\~%RANDOM%%RANDOM%.nsi" +echo !define ZIP2EXE_NAME `Simple x264 Launcher (%ISO_DATE%)` > "%NSIS_FILE%" +echo !define ZIP2EXE_OUTFILE `%~dp0\bin\x264_x64.%ISO_DATE%.exe` >> "%NSIS_FILE%" +echo !define ZIP2EXE_COMPRESSOR_LZMA >> "%NSIS_FILE%" +echo !define ZIP2EXE_INSTALLDIR `$PROGRAMFILES\MuldeR\Simple x264 Launcher v2` >> "%NSIS_FILE%" +echo !include `${NSISDIR}\Contrib\zip2exe\Base.nsh` >> "%NSIS_FILE%" +echo !include `${NSISDIR}\Contrib\zip2exe\Modern.nsh` >> "%NSIS_FILE%" +echo !insertmacro SECTION_BEGIN >> "%NSIS_FILE%" +echo File /r `%PACK_PATH%\*.*` >> "%NSIS_FILE%" +echo !insertmacro SECTION_END >> "%NSIS_FILE%" +"%NSIS_PATH%\makensis.exe" "%NSIS_FILE%" +if not "%ERRORLEVEL%"=="0" goto BuildError +del "%NSIS_FILE%" +del /Q /S "%PACK_PATH%\*.*" +REM /////////////////////////////////////////////////////////////////////////// +echo. +echo Build completed. +echo. +pause +goto:eof +REM /////////////////////////////////////////////////////////////////////////// +:BuildError +echo. +echo Build has failed !!! +echo. +pause