From d88c4ca5531e6b1f18226180705f591fff6c4000 Mon Sep 17 00:00:00 2001 From: lordmulder Date: Sun, 2 Aug 2015 19:16:37 +0200 Subject: [PATCH] Refactored code to better manage the encoder binary paths: They are now handled by the individual EncoderInfo class. Also added 12-Bit x265 encoder binaries. --- README.md | 2 +- src/binaries.cpp | 54 -------------------- src/binaries.h | 3 -- src/encoder_abstract.cpp | 2 +- src/encoder_abstract.h | 10 ++-- src/encoder_x264.cpp | 70 ++++++++++++++++---------- src/encoder_x264.h | 6 +-- src/encoder_x265.cpp | 90 +++++++++++++++++++++++----------- src/encoder_x265.h | 7 +-- src/model_options.cpp | 8 +-- src/model_options.h | 31 ++++++++---- src/source_avisynth.cpp | 2 +- src/source_avisynth.h | 5 +- src/source_vapoursynth.cpp | 2 +- src/source_vapoursynth.h | 4 +- src/thread_binaries.cpp | 24 ++++++--- src/thread_binaries.h | 2 +- src/tool_abstract.h | 4 +- src/version.h | 6 +-- src/win_addJob.cpp | 49 ++++++++++++++---- src/win_help.cpp | 5 +- src/win_main.cpp | 4 +- x264_launcher_MSVC2013.vcxproj | 30 ++++++------ z_build.bat | 19 +++---- 24 files changed, 242 insertions(+), 197 deletions(-) diff --git a/README.md b/README.md index fe567d5..1017fc1 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ The minimum system requirements to run Simple x264/x265 Launcher are as follows: * Windows XP with Service Pack 2 or any later Windows system – note that Windows XP is **not** recommended! * 64-Bit editions of Windows are highly recommended, though 32-Bit editions will work as well * The CPU must support at least the MMX and SSE instruction sets -* Avisynth input only available with [Avisynth](http://avisynth.nl/index.php/Main_Page#Official_builds) **2.5+** installed – note that Avisynth **2.6** is recommended these days! +* Avisynth input only available with [Avisynth](http://avisynth.nl/index.php/Main_Page#Official_builds) **2.6** installed – Avisynth **2.5.x** is *not* recommended! * VapourSynth input only available with [VapourSynth](http://www.vapoursynth.com/) **r24+** installed – [Python](https://www.python.org/downloads/windows/) is a prerequisite for VapourSynth! * YV16/YV24 color spaces require Avisynth 2.6 (see section 10) diff --git a/src/binaries.cpp b/src/binaries.cpp index f6ad5f0..ce8b3cc 100644 --- a/src/binaries.cpp +++ b/src/binaries.cpp @@ -30,60 +30,6 @@ //MUtils #include -/* --- Encooders --- */ - -QString ENC_BINARY(const SysinfoModel *sysinfo, const OptionsModel::EncType &encType, const OptionsModel::EncArch &encArch, const OptionsModel::EncVariant &encVariant) -{ - QString baseName, arch, variant; - - //Encoder Type - switch(encType) - { - case OptionsModel::EncType_X264: baseName = "x264"; break; - case OptionsModel::EncType_X265: baseName = "x265"; break; - } - - //Architecture - switch(encArch) - { - case OptionsModel::EncArch_x32: arch = "x86"; break; - case OptionsModel::EncArch_x64: arch = "x64"; break; - } - - //Encoder Variant - switch(encVariant) - { - case OptionsModel::EncVariant_LoBit: - switch(encType) - { - case OptionsModel::EncType_X264: - case OptionsModel::EncType_X265: variant = "8bit"; break; - } - break; - case OptionsModel::EncVariant_HiBit: - switch(encType) - { - case OptionsModel::EncType_X264: variant = "10bit"; break; - case OptionsModel::EncType_X265: variant = "16bit"; break; - } - break; - } - - //Sanity check - if(baseName.isEmpty() || arch.isEmpty() || variant.isEmpty()) - { - MUTILS_THROW("Failed to determine the encoder binarty path!"); - } - - //Return path - return QString("%1/toolset/%2/%3_%4_%2.exe").arg(sysinfo->getAppPath(), arch, baseName, variant); -} - -QString ENC_BINARY(const SysinfoModel *sysinfo, const OptionsModel *options) -{ - return ENC_BINARY(sysinfo, options->encType(), options->encArch(), options->encVariant()); -} - /* --- Avisynth --- */ QString AVS_BINARY(const SysinfoModel *sysinfo, const bool& x64) diff --git a/src/binaries.h b/src/binaries.h index 46bf206..3a48037 100644 --- a/src/binaries.h +++ b/src/binaries.h @@ -24,9 +24,6 @@ class SysinfoModel; class PreferencesModel; -QString ENC_BINARY(const SysinfoModel *sysinfo, const OptionsModel *options); -QString ENC_BINARY(const SysinfoModel *sysinfo, const OptionsModel::EncType &encType, const OptionsModel::EncArch &encArch, const OptionsModel::EncVariant &encVariant); - QString AVS_BINARY(const SysinfoModel *sysinfo, const bool &x64); QString AVS_BINARY(const SysinfoModel *sysinfo, const PreferencesModel *preferences); diff --git a/src/encoder_abstract.cpp b/src/encoder_abstract.cpp index 935ec3d..d2c001a 100644 --- a/src/encoder_abstract.cpp +++ b/src/encoder_abstract.cpp @@ -95,7 +95,7 @@ bool AbstractEncoder::runEncodingPass(AbstractSource* pipedSource, const QString buildCommandLine(cmdLine_Encode, (pipedSource != NULL), frames, m_indexFile, pass, passLogFile); log("Creating encoder process:"); - if(!startProcess(processEncode, ENC_BINARY(m_sysinfo, m_options), cmdLine_Encode)) + if(!startProcess(processEncode, getBinaryPath(), cmdLine_Encode)) { return false; } diff --git a/src/encoder_abstract.h b/src/encoder_abstract.h index 7ec31f9..e59ac58 100644 --- a/src/encoder_abstract.h +++ b/src/encoder_abstract.h @@ -22,6 +22,7 @@ #pragma once #include "tool_abstract.h" +#include "model_options.h" class QRegExp; template class QList; @@ -30,12 +31,13 @@ class AbstractSource; class AbstractEncoderInfo { public: - virtual QString getVariantId(const int &variant) const = 0; + virtual QFlags getVariants(void) const = 0; virtual QStringList getProfiles(const int &variant) const = 0; - virtual QStringList getTunings(void) const = 0; - virtual QStringList supportedOutputFormats(void) const = 0; - virtual bool isRCModeSupported(const int rcMode) const = 0; + virtual QStringList getTunings(void) const = 0; + virtual QStringList supportedOutputFormats(void) const = 0; + virtual bool isRCModeSupported(const int rcMode) const = 0; virtual bool isInputTypeSupported(const int format) const = 0; + virtual QString getBinaryPath(const SysinfoModel *sysinfo, const OptionsModel::EncArch &encArch, const OptionsModel::EncVariant &encVariant) const = 0; }; class AbstractEncoder : public AbstractTool diff --git a/src/encoder_x264.cpp b/src/encoder_x264.cpp index 99b377e..5983638 100644 --- a/src/encoder_x264.cpp +++ b/src/encoder_x264.cpp @@ -27,6 +27,7 @@ #include "model_status.h" #include "binaries.h" #include "mediainfo.h" +#include "model_sysinfo.h" //MUtils #include @@ -37,8 +38,8 @@ #include //x264 version info -static const unsigned int VERSION_X264_MINIMUM_REV = 2533; -static const unsigned int VERSION_X264_CURRENT_API = 146; +static const unsigned int VERSION_X264_MINIMUM_REV = 2555; +static const unsigned int VERSION_X264_CURRENT_API = 148; // ------------------------------------------------------------ // Helper Macros @@ -82,13 +83,6 @@ while(0) } \ while(0) -static QString MAKE_NAME(const char *baseName, const OptionsModel *options) -{ - const QString arch = (options->encArch() == OptionsModel::EncArch_x64) ? "x64" : "x86"; - const QString vari = (options->encVariant() == OptionsModel::EncVariant_HiBit ) ? "10-Bit" : "8-Bit"; - return QString("%1, %2, %3").arg(QString::fromLatin1(baseName), arch, vari); -} - // ------------------------------------------------------------ // Encoder Info // ------------------------------------------------------------ @@ -96,17 +90,12 @@ static QString MAKE_NAME(const char *baseName, const OptionsModel *options) class X264EncoderInfo : public AbstractEncoderInfo { public: - virtual QString getVariantId(const int &variant) const + virtual QFlags getVariants(void) const { - switch(variant) - { - case OptionsModel::EncVariant_LoBit: - return QString::fromLatin1("8-Bit"); - case OptionsModel::EncVariant_HiBit: - return QString::fromLatin1("10-Bit"); - default: - return QString::fromLatin1("N/A"); - } + QFlags variants; + variants |= OptionsModel::EncVariant_8Bit; + variants |= OptionsModel::EncVariant_10Bit; + return variants; } virtual QStringList getTunings(void) const @@ -124,11 +113,11 @@ public: { QStringList profiles; - if(variant == OptionsModel::EncVariant_LoBit) + if(variant == OptionsModel::EncVariant_8Bit) { profiles << "Baseline" << "Main" << "High"; } - if((variant == OptionsModel::EncVariant_LoBit) || (variant == OptionsModel::EncVariant_HiBit)) + if((variant == OptionsModel::EncVariant_8Bit) || (variant == OptionsModel::EncVariant_10Bit)) { profiles << "High10" << "High422" << "High444"; } @@ -169,6 +158,24 @@ public: return false; } } + + virtual QString getBinaryPath(const SysinfoModel *sysinfo, const OptionsModel::EncArch &encArch, const OptionsModel::EncVariant &encVariant) const + { + QString arch, variant; + switch(encArch) + { + case OptionsModel::EncArch_x86_32: arch = "x86"; break; + case OptionsModel::EncArch_x86_64: arch = "x64"; break; + default: MUTILS_THROW("Unknown encoder arch!"); + } + switch(encVariant) + { + case OptionsModel::EncVariant_8Bit: variant = "8bit"; break; + case OptionsModel::EncVariant_10Bit: variant = "10bit"; break; + default: MUTILS_THROW("Unknown encoder arch!"); + } + return QString("%1/toolset/%2/x264_%3_%2.exe").arg(sysinfo->getAppPath(), arch, variant); + } }; static const X264EncoderInfo s_x264EncoderInfo; @@ -184,9 +191,7 @@ const AbstractEncoderInfo &X264Encoder::getEncoderInfo(void) X264Encoder::X264Encoder(JobObject *jobObject, const OptionsModel *options, const SysinfoModel *const sysinfo, const PreferencesModel *const preferences, JobStatus &jobStatus, volatile bool *abort, volatile bool *pause, QSemaphore *semaphorePause, const QString &sourceFile, const QString &outputFile) : - AbstractEncoder(jobObject, options, sysinfo, preferences, jobStatus, abort, pause, semaphorePause, sourceFile, outputFile), - m_encoderName(MAKE_NAME("x264 (H.264/AVC)", m_options)), - m_binaryFile(ENC_BINARY(sysinfo, options)) + AbstractEncoder(jobObject, options, sysinfo, preferences, jobStatus, abort, pause, semaphorePause, sourceFile, outputFile) { if(options->encType() != OptionsModel::EncType_X264) { @@ -199,9 +204,22 @@ X264Encoder::~X264Encoder(void) /*Nothing to do here*/ } -const QString &X264Encoder::getName(void) +QString X264Encoder::getName(void) const { - return m_encoderName; + QString arch, variant; + switch(m_options->encArch()) + { + case OptionsModel::EncArch_x86_32: arch = "x86"; break; + case OptionsModel::EncArch_x86_64: arch = "x64"; break; + default: MUTILS_THROW("Unknown encoder arch!"); + } + switch(m_options->encVariant()) + { + case OptionsModel::EncVariant_8Bit: variant = "8-Bit"; break; + case OptionsModel::EncVariant_10Bit: variant = "10-Bit"; break; + default: MUTILS_THROW("Unknown encoder arch!"); + } + return QString("x264 (H.264/AVC), %1, %2").arg(arch, variant); } // ------------------------------------------------------------ diff --git a/src/encoder_x264.h b/src/encoder_x264.h index 88ed2e1..b4990ad 100644 --- a/src/encoder_x264.h +++ b/src/encoder_x264.h @@ -29,7 +29,7 @@ public: X264Encoder(JobObject *jobObject, const OptionsModel *options, const SysinfoModel *const sysinfo, const PreferencesModel *const preferences, JobStatus &jobStatus, volatile bool *abort, volatile bool *pause, QSemaphore *semaphorePause, const QString &sourceFile, const QString &outputFile); virtual ~X264Encoder(void); - virtual const QString &getName(void); + virtual QString getName(void) const; virtual QString printVersion(const unsigned int &revision, const bool &modified); virtual bool isVersionSupported(const unsigned int &revision, const bool &modified); @@ -37,7 +37,7 @@ public: static const AbstractEncoderInfo& getEncoderInfo(void); protected: - virtual const QString &getBinaryPath() { return m_binaryFile; } + virtual QString getBinaryPath() const { return getEncoderInfo().getBinaryPath(m_sysinfo, m_options->encArch(), m_options->encVariant()); } virtual void buildCommandLine(QStringList &cmdLine, const bool &usePipe, const unsigned int &frames, const QString &indexFile, const int &pass, const QString &passLogFile); virtual void checkVersion_init(QList &patterns, QStringList &cmdLine); @@ -46,6 +46,4 @@ protected: virtual void runEncodingPass_init(QList &patterns); virtual void runEncodingPass_parseLine(const QString &line, QList &patterns, const int &pass, double &last_progress, double &size_estimate); - const QString m_encoderName; - const QString m_binaryFile; }; diff --git a/src/encoder_x265.cpp b/src/encoder_x265.cpp index cd705c1..2851843 100644 --- a/src/encoder_x265.cpp +++ b/src/encoder_x265.cpp @@ -27,6 +27,7 @@ #include "model_status.h" #include "binaries.h" #include "mediainfo.h" +#include "model_sysinfo.h" //MUtils #include @@ -37,8 +38,8 @@ #include //x265 version info -static const unsigned int VERSION_X265_MINIMUM_VER = 16; -static const unsigned int VERSION_X265_MINIMUM_REV = 239; +static const unsigned int VERSION_X265_MINIMUM_VER = 17; +static const unsigned int VERSION_X265_MINIMUM_REV = 382; // ------------------------------------------------------------ // Helper Macros @@ -82,13 +83,6 @@ while(0) } \ while(0) -static QString MAKE_NAME(const char *baseName, const OptionsModel *options) -{ - const QString arch = (options->encArch() == OptionsModel::EncArch_x64) ? "x64" : "x86"; - const QString vari = (options->encVariant() == OptionsModel::EncVariant_HiBit ) ? "16-Bit" : "8-Bit"; - return QString("%1, %2, %3").arg(QString::fromLatin1(baseName), arch, vari); -} - // ------------------------------------------------------------ // Encoder Info // ------------------------------------------------------------ @@ -96,17 +90,13 @@ static QString MAKE_NAME(const char *baseName, const OptionsModel *options) class X265EncoderInfo : public AbstractEncoderInfo { public: - virtual QString getVariantId(const int &variant) const + virtual QFlags getVariants(void) const { - switch(variant) - { - case OptionsModel::EncVariant_LoBit: - return QString::fromLatin1("8-Bit"); - case OptionsModel::EncVariant_HiBit: - return QString::fromLatin1("16-Bit"); - default: - return QString::fromLatin1("N/A"); - } + QFlags variants; + variants |= OptionsModel::EncVariant_8Bit; + variants |= OptionsModel::EncVariant_10Bit; + variants |= OptionsModel::EncVariant_12Bit; + return variants; } virtual QStringList getTunings(void) const @@ -118,7 +108,20 @@ public: virtual QStringList getProfiles(const int &variant) const { - return QStringList(); + QStringList profiles; + switch(variant) + { + case OptionsModel::EncVariant_8Bit: + profiles << "main" << "main-intra" << "mainstillpicture" << "main444-8" << "main444-intra" << "main444-stillpicture"; + break; + case OptionsModel::EncVariant_10Bit: + profiles << "main10" << "main10-intra" << "main422-10" << "main422-10-intra" << "main444-10" << "main444-10-intra"; + break; + case OptionsModel::EncVariant_12Bit: + profiles << "main12" << "main12-intra" << "main422-12" << "main422-12-intra" << "main444-12" << "main444-12-intra"; + break; + } + return profiles; } virtual QStringList supportedOutputFormats(void) const @@ -152,6 +155,25 @@ public: return false; } } + + virtual QString getBinaryPath(const SysinfoModel *sysinfo, const OptionsModel::EncArch &encArch, const OptionsModel::EncVariant &encVariant) const + { + QString arch, variant; + switch(encArch) + { + case OptionsModel::EncArch_x86_32: arch = "x86"; break; + case OptionsModel::EncArch_x86_64: arch = "x64"; break; + default: MUTILS_THROW("Unknown encoder arch!"); + } + switch(encVariant) + { + case OptionsModel::EncVariant_8Bit: variant = "8bit"; break; + case OptionsModel::EncVariant_10Bit: variant = "10bit"; break; + case OptionsModel::EncVariant_12Bit: variant = "12bit"; break; + default: MUTILS_THROW("Unknown encoder arch!"); + } + return QString("%1/toolset/%2/x265_%3_%2.exe").arg(sysinfo->getAppPath(), arch, variant); + } }; static const X265EncoderInfo s_x265EncoderInfo; @@ -167,9 +189,7 @@ const AbstractEncoderInfo &X265Encoder::getEncoderInfo(void) X265Encoder::X265Encoder(JobObject *jobObject, const OptionsModel *options, const SysinfoModel *const sysinfo, const PreferencesModel *const preferences, JobStatus &jobStatus, volatile bool *abort, volatile bool *pause, QSemaphore *semaphorePause, const QString &sourceFile, const QString &outputFile) : - AbstractEncoder(jobObject, options, sysinfo, preferences, jobStatus, abort, pause, semaphorePause, sourceFile, outputFile), - m_encoderName(MAKE_NAME("x265 (H.265/HEVC)", m_options)), - m_binaryFile(ENC_BINARY(sysinfo, options)) + AbstractEncoder(jobObject, options, sysinfo, preferences, jobStatus, abort, pause, semaphorePause, sourceFile, outputFile) { if(options->encType() != OptionsModel::EncType_X265) { @@ -182,9 +202,23 @@ X265Encoder::~X265Encoder(void) /*Nothing to do here*/ } -const QString &X265Encoder::getName(void) +QString X265Encoder::getName(void) const { - return m_encoderName; + QString arch, variant; + switch(m_options->encArch()) + { + case OptionsModel::EncArch_x86_32: arch = "x86"; break; + case OptionsModel::EncArch_x86_64: arch = "x64"; break; + default: MUTILS_THROW("Unknown encoder arch!"); + } + switch(m_options->encVariant()) + { + case OptionsModel::EncVariant_8Bit: variant = "8-Bit"; break; + case OptionsModel::EncVariant_10Bit: variant = "10-Bit"; break; + case OptionsModel::EncVariant_12Bit: variant = "12-Bit"; break; + default: MUTILS_THROW("Unknown encoder arch!"); + } + return QString("x265 (H.265/HEVC), %1, %2").arg(arch, variant); } // ------------------------------------------------------------ @@ -303,11 +337,11 @@ void X265Encoder::buildCommandLine(QStringList &cmdLine, const bool &usePipe, co } } - if(m_options->profile().compare("auto", Qt::CaseInsensitive) != 0) + if(!m_options->profile().simplified().isEmpty()) { - if((m_options->encType() == OptionsModel::EncType_X264) && (m_options->encVariant() == OptionsModel::EncVariant_LoBit)) + if(m_options->profile().simplified().compare(QString::fromLatin1(OptionsModel::PROFILE_UNRESTRICTED), Qt::CaseInsensitive) != 0) { - cmdLine << "--profile" << m_options->profile().toLower(); + cmdLine << "--profile" << m_options->profile().simplified().toLower(); } } diff --git a/src/encoder_x265.h b/src/encoder_x265.h index adaffb4..9a9b70a 100644 --- a/src/encoder_x265.h +++ b/src/encoder_x265.h @@ -29,7 +29,7 @@ public: X265Encoder(JobObject *jobObject, const OptionsModel *options, const SysinfoModel *const sysinfo, const PreferencesModel *const preferences, JobStatus &jobStatus, volatile bool *abort, volatile bool *pause, QSemaphore *semaphorePause, const QString &sourceFile, const QString &outputFile); virtual ~X265Encoder(void); - virtual const QString &getName(void); + virtual QString getName(void) const; virtual QString printVersion(const unsigned int &revision, const bool &modified); virtual bool isVersionSupported(const unsigned int &revision, const bool &modified); @@ -37,7 +37,7 @@ public: static const AbstractEncoderInfo& getEncoderInfo(void); protected: - virtual const QString &getBinaryPath() { return m_binaryFile; } + virtual QString getBinaryPath() const { return getEncoderInfo().getBinaryPath(m_sysinfo, m_options->encArch(), m_options->encVariant()); } virtual void buildCommandLine(QStringList &cmdLine, const bool &usePipe, const unsigned int &frames, const QString &indexFile, const int &pass, const QString &passLogFile); virtual void checkVersion_init(QList &patterns, QStringList &cmdLine); @@ -45,7 +45,4 @@ protected: virtual void runEncodingPass_init(QList &patterns); virtual void runEncodingPass_parseLine(const QString &line, QList &patterns, const int &pass, double &last_progress, double &size_estimate); - - const QString m_encoderName; - const QString m_binaryFile; }; diff --git a/src/model_options.cpp b/src/model_options.cpp index 85a9bd2..370487f 100644 --- a/src/model_options.cpp +++ b/src/model_options.cpp @@ -57,8 +57,8 @@ const char *const OptionsModel::PROFILE_UNRESTRICTED = ""; OptionsModel::OptionsModel(const SysinfoModel *sysinfo) { m_encoderType = EncType_X264; - m_encoderArch = sysinfo->getCPUFeatures(SysinfoModel::CPUFeatures_X64) ? EncArch_x64 : EncArch_x32; - m_encoderVariant = EncVariant_LoBit; + m_encoderArch = sysinfo->getCPUFeatures(SysinfoModel::CPUFeatures_X64) ? EncArch_x86_64 : EncArch_x86_32; + m_encoderVariant = EncVariant_8Bit; m_rcMode = RCMode_CRF; m_bitrate = 1200; m_quantizer = 22; @@ -272,8 +272,8 @@ void OptionsModel::fixTemplate(QSettings &settingsFile) if(!(settingsFile.contains(KEY_ENCODER_TYPE) || settingsFile.contains(KEY_ENCODER_ARCH) || settingsFile.contains(KEY_ENCODER_VARIANT))) { settingsFile.setValue(KEY_ENCODER_TYPE, OptionsModel::EncType_X264); - settingsFile.setValue(KEY_ENCODER_ARCH, OptionsModel::EncArch_x32); - settingsFile.setValue(KEY_ENCODER_VARIANT, OptionsModel::EncVariant_LoBit); + settingsFile.setValue(KEY_ENCODER_ARCH, OptionsModel::EncArch_x86_32); + settingsFile.setValue(KEY_ENCODER_VARIANT, OptionsModel::EncVariant_8Bit); } static const char *legacyKey[] = { "custom_params", "custom_params_x264", NULL }; diff --git a/src/model_options.h b/src/model_options.h index 7d5a766..011eeff 100644 --- a/src/model_options.h +++ b/src/model_options.h @@ -39,26 +39,39 @@ public: { EncType_X264 = 0, EncType_X265 = 1, + + EncType_MIN = EncType_X264, + EncType_MAX = EncType_X265, }; enum EncArch { - EncArch_x32 = 0, - EncArch_x64 = 1 + EncArch_x86_32 = 0, + EncArch_x86_64 = 1, + + EncArch_MIN = EncArch_x86_32, + EncArch_MAX = EncArch_x86_64 }; enum EncVariant { - EncVariant_LoBit = 0, // 8-Bit - EncVariant_HiBit = 1, //10-Bit (x264) or 16-Bit (x265) + EncVariant_8Bit = 1, + EncVariant_10Bit = 2, + EncVariant_12Bit = 4, + + EncVariant_MIN = EncVariant_8Bit, + EncVariant_MAX = EncVariant_12Bit }; enum RCMode { - RCMode_CRF = 0, - RCMode_CQ = 1, + RCMode_CRF = 0, + RCMode_CQ = 1, RCMode_2Pass = 2, - RCMode_ABR = 3, + RCMode_ABR = 3, + + RCMode_MIN = RCMode_CRF, + RCMode_MAX = RCMode_ABR, }; static const char *const TUNING_UNSPECIFIED; @@ -79,8 +92,8 @@ public: //Setter void setEncType(EncType type) { m_encoderType = qBound(EncType_X264, type, EncType_X265); } - void setEncArch(EncArch arch) { m_encoderArch = qBound(EncArch_x32, arch, EncArch_x64); } - void setEncVariant(EncVariant variant) { m_encoderVariant = qBound(EncVariant_LoBit, variant, EncVariant_HiBit); } + void setEncArch(EncArch arch) { m_encoderArch = qBound(EncArch_x86_32, arch, EncArch_x86_64); } + void setEncVariant(EncVariant variant) { m_encoderVariant = qBound(EncVariant_8Bit, variant, EncVariant_12Bit); } void setRCMode(RCMode mode) { m_rcMode = qBound(RCMode_CRF, mode, RCMode_ABR); } void setBitrate(unsigned int bitrate) { m_bitrate = qBound(10U, bitrate, 800000U); } void setQuantizer(double quantizer) { m_quantizer = qBound(0.0, quantizer, 52.0); } diff --git a/src/source_avisynth.cpp b/src/source_avisynth.cpp index f37d7e2..aaebee2 100644 --- a/src/source_avisynth.cpp +++ b/src/source_avisynth.cpp @@ -51,7 +51,7 @@ AvisynthSource::~AvisynthSource(void) /*Nothing to do here*/ } -const QString &AvisynthSource::getName(void) +QString AvisynthSource::getName(void) const { return m_sourceName; } diff --git a/src/source_avisynth.h b/src/source_avisynth.h index df27a89..b5a2809 100644 --- a/src/source_avisynth.h +++ b/src/source_avisynth.h @@ -29,7 +29,7 @@ public: AvisynthSource(JobObject *jobObject, const OptionsModel *options, const SysinfoModel *const sysinfo, const PreferencesModel *const preferences, JobStatus &jobStatus, volatile bool *abort, volatile bool *pause, QSemaphore *semaphorePause, const QString &sourceFile); virtual ~AvisynthSource(void); - virtual const QString &getName(void); + virtual QString getName(void) const; virtual bool isSourceAvailable(void); virtual QString printVersion(const unsigned int &revision, const bool &modified); @@ -44,7 +44,8 @@ protected: virtual void checkSourceProperties_init(QList &patterns, QStringList &cmdLine); virtual void checkSourceProperties_parseLine(const QString &line, QList &patterns, unsigned int &frames, unsigned int &fSizeW, unsigned int &fSizeH, unsigned int &fpsNom, unsigned int &fpsDen); - virtual const QString &getBinaryPath() { return m_binaryFile; } + + virtual QString getBinaryPath() const { return m_binaryFile; } virtual void buildCommandLine(QStringList &cmdLine); const QString m_sourceName; diff --git a/src/source_vapoursynth.cpp b/src/source_vapoursynth.cpp index 297d3ce..52b2eba 100644 --- a/src/source_vapoursynth.cpp +++ b/src/source_vapoursynth.cpp @@ -48,7 +48,7 @@ VapoursynthSource::~VapoursynthSource(void) /*Nothing to do here*/ } -const QString &VapoursynthSource::getName(void) +QString VapoursynthSource::getName(void) const { return m_sourceName; } diff --git a/src/source_vapoursynth.h b/src/source_vapoursynth.h index a6b44e3..caf7216 100644 --- a/src/source_vapoursynth.h +++ b/src/source_vapoursynth.h @@ -29,7 +29,7 @@ public: VapoursynthSource(JobObject *jobObject, const OptionsModel *options, const SysinfoModel *const sysinfo, const PreferencesModel *const preferences, JobStatus &jobStatus, volatile bool *abort, volatile bool *pause, QSemaphore *semaphorePause, const QString &sourceFile); virtual ~VapoursynthSource(void); - virtual const QString &getName(void); + virtual QString getName(void) const; virtual bool isSourceAvailable(void); virtual QString printVersion(const unsigned int &revision, const bool &modified); @@ -44,7 +44,7 @@ protected: virtual void checkSourceProperties_init(QList &patterns, QStringList &cmdLine); virtual void checkSourceProperties_parseLine(const QString &line, QList &patterns, unsigned int &frames, unsigned int &fSizeW, unsigned int &fSizeH, unsigned int &fpsNom, unsigned int &fpsDen); - virtual const QString &getBinaryPath() { return m_binaryFile; } + virtual QString getBinaryPath() const { return m_binaryFile; } virtual void buildCommandLine(QStringList &cmdLine); const QString m_sourceName; diff --git a/src/thread_binaries.cpp b/src/thread_binaries.cpp index eb4b40a..cc26b49 100644 --- a/src/thread_binaries.cpp +++ b/src/thread_binaries.cpp @@ -34,6 +34,7 @@ #include "model_sysinfo.h" #include "win_updater.h" #include "binaries.h" +#include "encoder_factory.h" //MUtils #include @@ -45,6 +46,7 @@ QScopedPointer BinariesCheckThread::m_binPath[MAX_BINARIES]; //Whatever #define NEXT(X) ((*reinterpret_cast(&(X)))++) +#define SHFL(X) ((*reinterpret_cast(&(X))) <<= 1) //------------------------------------- // External API @@ -141,17 +143,25 @@ void BinariesCheckThread::checkBinaries3(volatile bool &success, const SysinfoMo //Create list of all required binary files QStringList binFiles; - for(OptionsModel::EncArch arch = OptionsModel::EncArch_x32; arch <= OptionsModel::EncArch_x64; NEXT(arch)) + for(OptionsModel::EncType encdr = OptionsModel::EncType_X264; encdr <= OptionsModel::EncType_X265; NEXT(encdr)) { - for(OptionsModel::EncType encdr = OptionsModel::EncType_X264; encdr <= OptionsModel::EncType_X265; NEXT(encdr)) + const AbstractEncoderInfo &encInfo = EncoderFactory::getEncoderInfo(encdr); + const QFlags variants = encInfo.getVariants(); + for(OptionsModel::EncArch arch = OptionsModel::EncArch_x86_32; arch <= OptionsModel::EncArch_x86_64; NEXT(arch)) { - for(OptionsModel::EncVariant varnt = OptionsModel::EncVariant_LoBit; varnt <= OptionsModel::EncVariant_HiBit; NEXT(varnt)) + for(OptionsModel::EncVariant varnt = OptionsModel::EncVariant_MIN; varnt <= OptionsModel::EncVariant_MAX; SHFL(varnt)) { - binFiles << ENC_BINARY(sysinfo, encdr, arch, varnt); + if(variants.testFlag(varnt)) + { + binFiles << encInfo.getBinaryPath(sysinfo, arch, varnt); + } } } - binFiles << AVS_BINARY(sysinfo, arch == OptionsModel::EncArch_x64); - binFiles << CHK_BINARY(sysinfo, arch == OptionsModel::EncArch_x64); + } + for(OptionsModel::EncArch arch = OptionsModel::EncArch_x86_32; arch <= OptionsModel::EncArch_x86_64; NEXT(arch)) + { + binFiles << AVS_BINARY(sysinfo, arch == OptionsModel::EncArch_x86_64); + binFiles << CHK_BINARY(sysinfo, arch == OptionsModel::EncArch_x86_64); } for(size_t i = 0; UpdaterDialog::BINARIES[i].name; i++) { @@ -173,7 +183,7 @@ void BinariesCheckThread::checkBinaries3(volatile bool &success, const SysinfoMo if(!MUtils::OS::is_executable_file(file->fileName())) { success = false; - qWarning("Required tool does NOT seem to be a valid Win32/Win64 binary:\n%s\n", MUTILS_UTF8(file->fileName())); + qWarning("Required tool does NOT look like a valid Win32/Win64 binary:\n%s\n", MUTILS_UTF8(file->fileName())); return; } if(currentFile < MAX_BINARIES) diff --git a/src/thread_binaries.h b/src/thread_binaries.h index 937a9da..ad4081d 100644 --- a/src/thread_binaries.h +++ b/src/thread_binaries.h @@ -50,7 +50,7 @@ private: volatile bool m_success; const SysinfoModel *const m_sysinfo; - static const size_t MAX_BINARIES = 16; + static const size_t MAX_BINARIES = 32; static QMutex m_binLock; static QScopedPointer m_binPath[MAX_BINARIES]; diff --git a/src/tool_abstract.h b/src/tool_abstract.h index a413643..6ef7d3b 100644 --- a/src/tool_abstract.h +++ b/src/tool_abstract.h @@ -45,7 +45,7 @@ public: AbstractTool(JobObject *jobObject, const OptionsModel *options, const SysinfoModel *const sysinfo, const PreferencesModel *const preferences, JobStatus &jobStatus, volatile bool *abort, volatile bool *pause, QSemaphore *semaphorePause); virtual ~AbstractTool(void) {/*NOP*/} - virtual const QString &getName(void) = 0; + virtual QString getName(void) const = 0; virtual unsigned int checkVersion(bool &modified); virtual bool isVersionSupported(const unsigned int &revision, const bool &modified) = 0; @@ -64,7 +64,7 @@ protected: static const unsigned int m_processTimeoutMaxCounter = 120; static const unsigned int m_processTimeoutWarning = 24; - virtual const QString &getBinaryPath(void) = 0; + virtual QString getBinaryPath(void) const = 0; virtual void checkVersion_init(QList &patterns, QStringList &cmdLine) = 0; virtual void checkVersion_parseLine(const QString &line, QList &patterns, unsigned int &core, unsigned int &build, bool &modified) = 0; diff --git a/src/version.h b/src/version.h index 4c5b8b0..91dcf2a 100644 --- a/src/version.h +++ b/src/version.h @@ -24,9 +24,9 @@ #endif #define VER_X264_MAJOR 2 -#define VER_X264_MINOR 5 -#define VER_X264_PATCH 1 -#define VER_X264_BUILD 951 +#define VER_X264_MINOR 6 +#define VER_X264_PATCH 0 +#define VER_X264_BUILD 958 #define VER_X264_PORTABLE_EDITION (0) diff --git a/src/win_addJob.cpp b/src/win_addJob.cpp index 4baa85e..2bc54ee 100644 --- a/src/win_addJob.cpp +++ b/src/win_addJob.cpp @@ -35,6 +35,7 @@ //MUtils #include +#include //Qt #include @@ -56,6 +57,7 @@ #define ARRAY_SIZE(ARRAY) (sizeof((ARRAY))/sizeof((ARRAY[0]))) #define VALID_DIR(PATH) ((!(PATH).isEmpty()) && QFileInfo(PATH).exists() && QFileInfo(PATH).isDir()) +#define SHFL(X) ((*reinterpret_cast(&(X))) <<= 1) #define REMOVE_USAFED_ITEM \ { \ @@ -87,6 +89,18 @@ WIDGET->addAction(_action); \ } +static void setIndexByData(QComboBox *const box, const int &data) +{ + for(int i = 0; i < box->count(); i++) + { + if(box->itemData(i).toInt() == data) + { + box->setCurrentIndex(i); + break; + } + } +} + Q_DECLARE_METATYPE(const void*) /////////////////////////////////////////////////////////////////////////////// @@ -453,8 +467,23 @@ void AddJobDialog::encoderIndexChanged(int index) const AbstractEncoderInfo &encoderInfo = EncoderFactory::getEncoderInfo(ui->cbxEncoderType->currentIndex()); //Update encoder variants - ui->cbxEncoderVariant->setItemText(OptionsModel::EncVariant_LoBit, encoderInfo.getVariantId(OptionsModel::EncVariant_LoBit)); - ui->cbxEncoderVariant->setItemText(OptionsModel::EncVariant_HiBit, encoderInfo.getVariantId(OptionsModel::EncVariant_HiBit)); + const QFlags variants = encoderInfo.getVariants(); + ui->cbxEncoderVariant->clear(); + for(OptionsModel::EncVariant varnt = OptionsModel::EncVariant_MIN; varnt <= OptionsModel::EncVariant_MAX; SHFL(varnt)) + { + if(variants.testFlag(varnt)) + { + QString varntText; + switch(varnt) + { + case OptionsModel::EncVariant_8Bit: varntText = tr("8-Bit"); break; + case OptionsModel::EncVariant_10Bit: varntText = tr("10-Bit"); break; + case OptionsModel::EncVariant_12Bit: varntText = tr("12-Bit"); break; + default: MUTILS_THROW("Bad encoder variant!"); + } + ui->cbxEncoderVariant->addItem(varntText, QVariant(varnt)); + } + } //Update tunings QStringList tunings = encoderInfo.getTunings(); @@ -505,10 +534,10 @@ void AddJobDialog::modeIndexChanged(int index) void AddJobDialog::accept(void) { //Check 64-Bit support - if((ui->cbxEncoderArch->currentIndex() == OptionsModel::EncArch_x64) && (!m_sysinfo->getCPUFeatures(SysinfoModel::CPUFeatures_X64))) + if((ui->cbxEncoderArch->currentIndex() == OptionsModel::EncArch_x86_64) && (!m_sysinfo->getCPUFeatures(SysinfoModel::CPUFeatures_X64))) { QMessageBox::warning(this, tr("64-Bit unsupported!"), tr("Sorry, this computer does not support 64-Bit encoders!")); - ui->cbxEncoderArch->setCurrentIndex(OptionsModel::EncArch_x32); + ui->cbxEncoderArch->setCurrentIndex(OptionsModel::EncArch_x86_32); return; } @@ -984,10 +1013,10 @@ void AddJobDialog::restoreOptions(const OptionsModel *options) //Ignore config changes while restoring template! m_monitorConfigChanges = false; - ui->cbxEncoderType ->setCurrentIndex(options->encType()); - ui->cbxEncoderArch ->setCurrentIndex(options->encArch()); - ui->cbxEncoderVariant ->setCurrentIndex(options->encVariant()); - ui->cbxRateControlMode->setCurrentIndex(options->rcMode()); + ui->cbxEncoderType ->setCurrentIndex(options->encType()); + ui->cbxEncoderArch ->setCurrentIndex(options->encArch()); + setIndexByData(ui->cbxEncoderVariant, options->encVariant()); + ui->cbxRateControlMode -> setCurrentIndex(options->rcMode()); ui->spinQuantizer->setValue(options->quantizer()); ui->spinBitrate ->setValue(options->bitrate()); @@ -1007,7 +1036,7 @@ void AddJobDialog::saveOptions(OptionsModel *options) { options->setEncType(static_cast(ui->cbxEncoderType->currentIndex())); options->setEncArch(static_cast(ui->cbxEncoderArch->currentIndex())); - options->setEncVariant(static_cast(ui->cbxEncoderVariant->currentIndex())); + options->setEncVariant(static_cast(ui->cbxEncoderVariant->itemData(ui->cbxEncoderVariant->currentIndex()).toInt())); options->setRCMode(static_cast(ui->cbxRateControlMode->currentIndex())); options->setQuantizer(ui->spinQuantizer->value()); @@ -1206,3 +1235,5 @@ QString AddJobDialog::getInputFilterLst(void) filters << QString("All files (*.*)"); return filters.join(";;"); } + + diff --git a/src/win_help.cpp b/src/win_help.cpp index 308ef5e..8a49034 100644 --- a/src/win_help.cpp +++ b/src/win_help.cpp @@ -26,6 +26,7 @@ #include "global.h" #include "model_options.h" #include "binaries.h" +#include "encoder_factory.h" //MUtils #include @@ -86,7 +87,7 @@ void HelpDialog::showEvent(QShowEvent *event) if(!m_avs2yuv) { - m_process->start(ENC_BINARY(m_sysinfo, m_options), QStringList() << "--version"); + m_process->start(EncoderFactory::getEncoderInfo(m_options->encType()).getBinaryPath(m_sysinfo, m_options->encArch(), m_options->encVariant()), QStringList() << "--version"); } else { @@ -135,7 +136,7 @@ void HelpDialog::finished(void) m_startAgain = false; if(!m_avs2yuv) { - m_process->start(ENC_BINARY(m_sysinfo, m_options), QStringList() << "--fullhelp"); + m_process->start(EncoderFactory::getEncoderInfo(m_options->encType()).getBinaryPath(m_sysinfo, m_options->encArch(), m_options->encVariant()), QStringList() << "--fullhelp"); ui->plainTextEdit->appendPlainText("\n--------\n"); if(!m_process->waitForStarted()) diff --git a/src/win_main.cpp b/src/win_main.cpp index ed71e38..935b9b3 100644 --- a/src/win_main.cpp +++ b/src/win_main.cpp @@ -787,8 +787,8 @@ void MainWindow::init(void) qDebug("[Validating binaries]"); if(!BinariesCheckThread::check(m_sysinfo.data())) { - QMessageBox::critical(this, tr("Invalid File!"), tr("At least one required tool is missing or is not a valid Win32/Win64 binary.
Please re-install the program in order to fix the problem!
").replace("-", "−")); - qFatal("At least one required tool is missing or is not a valid Win32/Win64 binary!"); + QMessageBox::critical(this, tr("Invalid File!"), tr("At least one tool is missing or is not a valid Win32/Win64 binary.
Please re-install the program in order to fix the problem!
").replace("-", "−")); + qFatal("At least one tool is missing or is not a valid Win32/Win64 binary!"); } qDebug(" "); diff --git a/x264_launcher_MSVC2013.vcxproj b/x264_launcher_MSVC2013.vcxproj index 708fc44..7ce05ad 100644 --- a/x264_launcher_MSVC2013.vcxproj +++ b/x264_launcher_MSVC2013.vcxproj @@ -65,7 +65,7 @@ Windows true - $(ProjectDir)\..\Prerequisites\Qt4\MSVC-2013\Debug\lib;$(SolutionDir)\..\Prerequisites\VisualLeakDetector\lib\$(Platform);%(AdditionalLibraryDirectories) + $(ProjectDir)\..\Prerequisites\Qt4\$(PlatformToolset)\Debug\lib;$(SolutionDir)\..\Prerequisites\VisualLeakDetector\lib\$(Platform);%(AdditionalLibraryDirectories) QtCored4.lib;QtGuid4.lib;Winmm.lib;Psapi.lib;SensAPI.lib;%(AdditionalDependencies) x264_entry_point @@ -87,13 +87,13 @@ copy /Y "$(SolutionDir)res\toolset\common\*.exe" "$(TargetDir)\toolset\common\" copy /Y "$(SolutionDir)res\toolset\common\*.gpg" "$(TargetDir)\toolset\common\" for %%i in (QtCored4, QtGuid4, QtSvgd4, QtXmld4) do ( - copy /Y "$(ProjectDir)\..\Prerequisites\Qt4\MSVC-2013\Debug\bin\%%i.dll" "$(TargetDir)" - copy /Y "$(ProjectDir)\..\Prerequisites\Qt4\MSVC-2013\Debug\bin\%%i.pdb" "$(TargetDir)" + copy /Y "$(ProjectDir)\..\Prerequisites\Qt4\$(PlatformToolset)\Debug\bin\%%i.dll" "$(TargetDir)" + copy /Y "$(ProjectDir)\..\Prerequisites\Qt4\$(PlatformToolset)\Debug\bin\%%i.pdb" "$(TargetDir)" ) for %%i in (qicod4, qsvgd4, qjpegd4, qtiffd4, qgifd4) do ( - copy /Y "$(ProjectDir)\..\Prerequisites\Qt4\MSVC-2013\Debug\plugins\imageformats\%%i.dll" "$(TargetDir)\imageformats" - copy /Y "$(ProjectDir)\..\Prerequisites\Qt4\MSVC-2013\Debug\plugins\imageformats\%%i.pdb" "$(TargetDir)\imageformats" + copy /Y "$(ProjectDir)\..\Prerequisites\Qt4\$(PlatformToolset)\Debug\plugins\imageformats\%%i.dll" "$(TargetDir)\imageformats" + copy /Y "$(ProjectDir)\..\Prerequisites\Qt4\$(PlatformToolset)\Debug\plugins\imageformats\%%i.pdb" "$(TargetDir)\imageformats" ) copy /Y "$(SolutionDir)\..\Prerequisites\VisualLeakDetector\bin\$(Platform)\*.dll" "$(TargetDir)" @@ -135,7 +135,7 @@ copy /Y "$(SolutionDir)\..\Prerequisites\VisualLeakDetector\bin\$(Platform)\*.ma false true true - $(ProjectDir)\..\Prerequisites\Qt4\MSVC-2013\Shared\lib;%(AdditionalLibraryDirectories) + $(ProjectDir)\..\Prerequisites\Qt4\$(PlatformToolset)\Shared\lib;%(AdditionalLibraryDirectories) QtCore4.lib;QtGui4.lib;Winmm.lib;dwmapi.lib;Psapi.lib;SensAPI.lib;%(AdditionalDependencies) UseLinkTimeCodeGeneration false @@ -170,15 +170,15 @@ copy /Y "$(SolutionDir)res\toolset\x64\*.exe" "$(TargetDir)\toolset\x64\" copy /Y "$(SolutionDir)res\toolset\common\*.exe" "$(TargetDir)\toolset\common\" copy /Y "$(SolutionDir)res\toolset\common\*.gpg" "$(TargetDir)\toolset\common\" -copy /Y "$(ProjectDir)\..\Prerequisites\Qt4\MSVC-2013\Shared\bin\QtCore4.dll" "$(TargetDir)" -copy /Y "$(ProjectDir)\..\Prerequisites\Qt4\MSVC-2013\Shared\bin\QtGui4.dll" "$(TargetDir)" -copy /Y "$(ProjectDir)\..\Prerequisites\Qt4\MSVC-2013\Shared\bin\QtSvg4.dll" "$(TargetDir)" -copy /Y "$(ProjectDir)\..\Prerequisites\Qt4\MSVC-2013\Shared\bin\QtXml4.dll" "$(TargetDir)" -copy /Y "$(ProjectDir)\..\Prerequisites\Qt4\MSVC-2013\Shared\plugins\imageformats\qico4.dll" "$(TargetDir)\imageformats" -copy /Y "$(ProjectDir)\..\Prerequisites\Qt4\MSVC-2013\Shared\plugins\imageformats\qsvg4.dll" "$(TargetDir)\imageformats" -copy /Y "$(ProjectDir)\..\Prerequisites\Qt4\MSVC-2013\Shared\plugins\imageformats\qjpeg4.dll" "$(TargetDir)\imageformats" -copy /Y "$(ProjectDir)\..\Prerequisites\Qt4\MSVC-2013\Shared\plugins\imageformats\qtiff4.dll" "$(TargetDir)\imageformats" -copy /Y "$(ProjectDir)\..\Prerequisites\Qt4\MSVC-2013\Shared\plugins\imageformats\qgif4.dll" "$(TargetDir)\imageformats" +copy /Y "$(ProjectDir)\..\Prerequisites\Qt4\$(PlatformToolset)\Shared\bin\QtCore4.dll" "$(TargetDir)" +copy /Y "$(ProjectDir)\..\Prerequisites\Qt4\$(PlatformToolset)\Shared\bin\QtGui4.dll" "$(TargetDir)" +copy /Y "$(ProjectDir)\..\Prerequisites\Qt4\$(PlatformToolset)\Shared\bin\QtSvg4.dll" "$(TargetDir)" +copy /Y "$(ProjectDir)\..\Prerequisites\Qt4\$(PlatformToolset)\Shared\bin\QtXml4.dll" "$(TargetDir)" +copy /Y "$(ProjectDir)\..\Prerequisites\Qt4\$(PlatformToolset)\Shared\plugins\imageformats\qico4.dll" "$(TargetDir)\imageformats" +copy /Y "$(ProjectDir)\..\Prerequisites\Qt4\$(PlatformToolset)\Shared\plugins\imageformats\qsvg4.dll" "$(TargetDir)\imageformats" +copy /Y "$(ProjectDir)\..\Prerequisites\Qt4\$(PlatformToolset)\Shared\plugins\imageformats\qjpeg4.dll" "$(TargetDir)\imageformats" +copy /Y "$(ProjectDir)\..\Prerequisites\Qt4\$(PlatformToolset)\Shared\plugins\imageformats\qtiff4.dll" "$(TargetDir)\imageformats" +copy /Y "$(ProjectDir)\..\Prerequisites\Qt4\$(PlatformToolset)\Shared\plugins\imageformats\qgif4.dll" "$(TargetDir)\imageformats" Copy Toolset diff --git a/z_build.bat b/z_build.bat index 39dbb50..c8c98b8 100644 --- a/z_build.bat +++ b/z_build.bat @@ -6,6 +6,7 @@ set "MSVC_PATH=C:\Program Files\Microsoft Visual Studio 12.0\VC" set "NSIS_PATH=C:\Program Files\NSIS\Unicode" set "UPX3_PATH=C:\Program Files\UPX" set "PDOC_PATH=C:\Program Files\Pandoc" +set "TOOLS_VER=120" REM ############################################### REM # DO NOT MODIFY ANY LINES BELOW THIS LINE !!! # @@ -99,17 +100,13 @@ copy "%~dp0\*.txt" "%PACK_PATH%" REM /////////////////////////////////////////////////////////////////////////// REM // Copy dependencies REM /////////////////////////////////////////////////////////////////////////// -for %%i in (100, 110, 120) do ( - if exist "%MSVC_PATH%\redist\x86\Microsoft.VC%%i.CRT\*.dll" ( - copy "%MSVC_PATH%\redist\x86\Microsoft.VC%%i.CRT\msvc?%%i.dll" "%PACK_PATH%" - ) -) -copy "%~dp0\..\Prerequisites\Qt4\MSVC-2013\Shared\bin\QtCore4.dll" "%PACK_PATH%" -copy "%~dp0\..\Prerequisites\Qt4\MSVC-2013\Shared\bin\QtGui4.dll" "%PACK_PATH%" -copy "%~dp0\..\Prerequisites\Qt4\MSVC-2013\Shared\bin\QtSvg4.dll" "%PACK_PATH%" -copy "%~dp0\..\Prerequisites\Qt4\MSVC-2013\Shared\bin\QtXml4.dll" "%PACK_PATH%" -copy "%~dp0\..\Prerequisites\Qt4\MSVC-2013\Shared\bin\QtXml4.dll" "%PACK_PATH%" -copy "%~dp0\..\Prerequisites\Qt4\MSVC-2013\Shared\plugins\imageformats\*.dll" "%PACK_PATH%\imageformats" +copy "%MSVC_PATH%\redist\x86\Microsoft.VC%TOOLS_VER%.CRT\*.dll" "%PACK_PATH%" +copy "%~dp0\..\Prerequisites\Qt4\v%TOOLS_VER%_xp\Shared\bin\QtCore4.dll" "%PACK_PATH%" +copy "%~dp0\..\Prerequisites\Qt4\v%TOOLS_VER%_xp\Shared\bin\QtGui4.dll" "%PACK_PATH%" +copy "%~dp0\..\Prerequisites\Qt4\v%TOOLS_VER%_xp\Shared\bin\QtSvg4.dll" "%PACK_PATH%" +copy "%~dp0\..\Prerequisites\Qt4\v%TOOLS_VER%_xp\Shared\bin\QtXml4.dll" "%PACK_PATH%" +copy "%~dp0\..\Prerequisites\Qt4\v%TOOLS_VER%_xp\Shared\bin\QtXml4.dll" "%PACK_PATH%" +copy "%~dp0\..\Prerequisites\Qt4\v%TOOLS_VER%_xp\Shared\plugins\imageformats\*.dll" "%PACK_PATH%\imageformats" del "%PACK_PATH%\imageformats\*d4.dll" 2> NUL REM ///////////////////////////////////////////////////////////////////////////