Some more improvements to VapourSynth detection + overhauled the SysinfoModel class.

This commit is contained in:
LoRd_MuldeR 2015-02-28 17:12:35 +01:00
parent 0c6c00202e
commit 2658b4c628
17 changed files with 120 additions and 98 deletions

View File

@ -1,6 +1,10 @@
-----------------------------------------
Simple x264/x265 Launcher version history
-----------------------------------------
Version 2.50 [2015-MM-DD]
* Improved VapourSynth detection code
* Added option to prefer 64-Bit VapourSynth, if available
Version 2.46 [2015-01-31]
* Updated x265 to version 1.4+424

View File

@ -25,19 +25,20 @@ Some key features of the Simple x264/x265 Launcher software include:
# System Requirements #
Simple x264 Launcher is *100% standalone*, i.e. it does **not** require Mircrosoft.NET, Java Runtime Environment or other "external" dependencies.
The required Qt DLLs as well as the encoder binaries are *included* with the application. Frameservers, like *Avisynth* or *VapourSynth*, may need to be installed separately though.
The minimum system requirements to run Simple x264/x265 Launcher are as follows:
* Windows XP with Service Pack 2 or any later Windows system
* 64-Bit Windows is highly recommended (32-Bit Windows works as well)
* 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 2.5+ installed
* VapourSynth input only available with VapourSynth R19+ installed
* 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!
* 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)
Simple x264 Launcher is 100% standalone, i.e. it does **not** require Mircrosoft.NET, Java Runtime Environment or other dependencies.
The required Qt DLLs and encoder binaries are included in the setup.
# Anti-Virus Warning #

View File

@ -141,7 +141,7 @@ Please be aware that this option does NOT have any effect on 32-Bit systems.</st
Please be aware that this option does NOT have any effect on 32-Bit systems.</string>
</property>
<property name="text">
<string>Use 64-Bit Avisynth/Avs2YUV, if running on a 64-Bit machine</string>
<string>Prefer 64-Bit source (Avisynth/VapourSynth) on 64-Bit systems</string>
</property>
</widget>
</item>

View File

@ -93,7 +93,7 @@ QString AVS_BINARY(const SysinfoModel *sysinfo, const bool& x64)
QString AVS_BINARY(const SysinfoModel *sysinfo, const PreferencesModel *preferences)
{
return AVS_BINARY(sysinfo, preferences->getUseAvisyth64Bit() && sysinfo->hasX64Support());
return AVS_BINARY(sysinfo, preferences->getPrefer64BitSource() && sysinfo->getCPUFeatures(SysinfoModel::CPUFeatures_X64));
}
/* --- VapurSynth --- */
@ -105,12 +105,7 @@ QString VPS_BINARY(const SysinfoModel *sysinfo, const bool& x64)
QString VPS_BINARY(const SysinfoModel *sysinfo, const PreferencesModel *preferences)
{
if(sysinfo->hasVPS32Support() && sysinfo->hasVPS64Support() && sysinfo->hasX64Support())
{
return VPS_BINARY(sysinfo, preferences->getUseAvisyth64Bit());
}
else
{
return VPS_BINARY(sysinfo, (sysinfo->hasVPS64Support() && sysinfo->hasX64Support()));
}
const bool vps32 = sysinfo->getVapourSynth(SysinfoModel::VapourSynth_X86);
const bool vps64 = sysinfo->getVapourSynth(SysinfoModel::VapourSynth_X64) && sysinfo->getCPUFeatures(SysinfoModel::CPUFeatures_X64);
return VPS_BINARY(sysinfo, (vps32 && vps64) ? preferences->getPrefer64BitSource() : vps64);
}

View File

@ -57,7 +57,7 @@ const char *const OptionsModel::PROFILE_UNRESTRICTED = "<Unrestricted>";
OptionsModel::OptionsModel(const SysinfoModel *sysinfo)
{
m_encoderType = EncType_X264;
m_encoderArch = sysinfo->hasX64Support() ? EncArch_x64 : EncArch_x32;
m_encoderArch = sysinfo->getCPUFeatures(SysinfoModel::CPUFeatures_X64) ? EncArch_x64 : EncArch_x32;
m_encoderVariant = EncVariant_LoBit;
m_rcMode = RCMode_CRF;
m_bitrate = 1200;

View File

@ -72,7 +72,7 @@ void PreferencesModel::initPreferences(PreferencesModel *preferences)
INIT_VALUE(AutoRunNextJob, true );
INIT_VALUE(MaxRunningJobCount, 1 );
INIT_VALUE(ShutdownComputer, false);
INIT_VALUE(UseAvisyth64Bit, false);
INIT_VALUE(Prefer64BitSource, false);
INIT_VALUE(SaveLogFiles, false);
INIT_VALUE(SaveToSourcePath, false);
INIT_VALUE(ProcessPriority, -1 );
@ -94,7 +94,7 @@ void PreferencesModel::loadPreferences(PreferencesModel *preferences)
LOAD_VALUE_B(AutoRunNextJob );
LOAD_VALUE_U(MaxRunningJobCount);
LOAD_VALUE_B(ShutdownComputer );
LOAD_VALUE_B(UseAvisyth64Bit );
LOAD_VALUE_B(Prefer64BitSource );
LOAD_VALUE_B(SaveLogFiles );
LOAD_VALUE_B(SaveToSourcePath );
LOAD_VALUE_I(ProcessPriority );
@ -117,7 +117,7 @@ void PreferencesModel::savePreferences(PreferencesModel *preferences)
STORE_VALUE(AutoRunNextJob );
STORE_VALUE(MaxRunningJobCount);
STORE_VALUE(ShutdownComputer );
STORE_VALUE(UseAvisyth64Bit );
STORE_VALUE(Prefer64BitSource );
STORE_VALUE(SaveLogFiles );
STORE_VALUE(SaveToSourcePath );
STORE_VALUE(ProcessPriority );

View File

@ -56,7 +56,7 @@ public:
PREFERENCES_MAKE_B(AutoRunNextJob)
PREFERENCES_MAKE_U(MaxRunningJobCount)
PREFERENCES_MAKE_B(ShutdownComputer)
PREFERENCES_MAKE_B(UseAvisyth64Bit)
PREFERENCES_MAKE_B(Prefer64BitSource)
PREFERENCES_MAKE_B(SaveLogFiles)
PREFERENCES_MAKE_B(SaveToSourcePath)
PREFERENCES_MAKE_I(ProcessPriority)

View File

@ -24,23 +24,28 @@
#include <QMutex>
#include <QMutexLocker>
#include <QString>
#include <QFlags>
///////////////////////////////////////////////////////////////////////////////
#define SYSINFO_MAKE_FLAG(NAME, VALUE) \
#define SYSINFO_MAKE_FLAG(NAME) \
protected: \
static const unsigned int FLAG_HAS_##NAME = VALUE; \
QFlags<NAME##_t> m_flag##NAME; \
public: \
inline void set##NAME##Support(const bool &enable) \
inline void set##NAME(const NAME##_t &flag, const bool &enable) \
{ \
QMutexLocker lock(&m_mutex); \
if(enable) setFlag(FLAG_HAS_##NAME); else clrFlag(FLAG_HAS_##NAME); \
if(enable) m_flag##NAME |= flag; else m_flag##NAME &= (~flag); \
} \
inline bool has##NAME##Support(void) const \
inline bool get##NAME(const NAME##_t &flag) const \
{ \
QMutexLocker lock(&m_mutex); \
const bool enabeld = ((m_flags & (FLAG_HAS_##NAME)) == FLAG_HAS_##NAME); \
return enabeld; \
return m_flag##NAME.testFlag(flag); \
} \
inline bool has##NAME(void) const \
{ \
QMutexLocker lock(&m_mutex); \
return !!m_flag##NAME; \
}
#define SYSINFO_MAKE_PATH(NAME) \
@ -64,23 +69,38 @@
class SysinfoModel
{
public:
SysinfoModel(void) { m_flags = 0; }
SYSINFO_MAKE_FLAG(X64, 0x00000001)
SYSINFO_MAKE_FLAG(MMX, 0x00000002)
SYSINFO_MAKE_FLAG(SSE, 0x00000004)
SYSINFO_MAKE_FLAG(AVS, 0x00000008)
SYSINFO_MAKE_FLAG(VPS32, 0x00000010)
SYSINFO_MAKE_FLAG(VPS64, 0x00000020)
SysinfoModel(void) {}
typedef enum _CPUFeatures_t
{
CPUFeatures_MMX = 0x1,
CPUFeatures_SSE = 0x2,
CPUFeatures_X64 = 0x4,
}
CPUFeatures_t;
typedef enum _Avisynth_t
{
Avisynth_X86 = 0x1,
Avisynth_X64 = 0x2,
}
Avisynth_t;
typedef enum _VapourSynth_t
{
VapourSynth_X86 = 0x1,
VapourSynth_X64 = 0x2,
}
VapourSynth_t;
SYSINFO_MAKE_FLAG(CPUFeatures)
SYSINFO_MAKE_FLAG(Avisynth)
SYSINFO_MAKE_FLAG(VapourSynth)
SYSINFO_MAKE_PATH(VPS)
SYSINFO_MAKE_PATH(App)
protected:
inline void setFlag(const unsigned int &flag) { m_flags = (m_flags | flag); }
inline void clrFlag(const unsigned int &flag) { m_flags = (m_flags & (~flag)); }
unsigned int m_flags;
mutable QMutex m_mutex;
};

View File

@ -62,7 +62,7 @@ const QString &AvisynthSource::getName(void)
bool AvisynthSource::isSourceAvailable()
{
if(!(m_sysinfo->hasAVSSupport()))
if(!(m_sysinfo->hasAvisynth()))
{
log(tr("\nAVS INPUT REQUIRES AVISYNTH, BUT IT IS *NOT* AVAILABLE !!!"));
return false;
@ -188,7 +188,7 @@ void AvisynthSource::checkSourceProperties_parseLine(const QString &line, QList<
if(line.contains("failed to load avisynth.dll", Qt::CaseInsensitive))
{
log(tr("\nWarning: It seems that %1-Bit Avisynth is not currently installed !!!").arg(m_preferences->getUseAvisyth64Bit() ? "64" : "32"));
log(tr("\nWarning: It seems that Avisynth is not currently installed/available !!!"));
}
if(line.contains(QRegExp("couldn't convert input clip to (YV16|YV24)", Qt::CaseInsensitive)))
{

View File

@ -59,8 +59,7 @@ const QString &VapoursynthSource::getName(void)
bool VapoursynthSource::isSourceAvailable()
{
bool vpsSupport = m_sysinfo->hasVPS32Support() || m_sysinfo->hasVPS32Support();
if(!(vpsSupport && (!m_sysinfo->getVPSPath().isEmpty()) && QFileInfo(VPS_BINARY(m_sysinfo, m_preferences)).isFile()))
if(!(m_sysinfo->hasVapourSynth() && (!m_sysinfo->getVPSPath().isEmpty()) && QFileInfo(VPS_BINARY(m_sysinfo, m_preferences)).isFile()))
{
log(tr("\nVPY INPUT REQUIRES VAPOURSYNTH, BUT IT IS *NOT* AVAILABLE !!!"));
return false;

View File

@ -137,13 +137,13 @@ EncodeThread::EncodeThread(const QString &sourceFileName, const QString &outputF
switch(MediaInfo::analyze(m_sourceFileName))
{
case MediaInfo::FILETYPE_AVISYNTH:
if(m_sysinfo->hasAVSSupport())
if(m_sysinfo->hasAvisynth())
{
m_pipedSource = new AvisynthSource (m_jobObject, m_options, m_sysinfo, m_preferences, m_status, &m_abort, &m_pause, &m_semaphorePaused, m_sourceFileName);
}
break;
case MediaInfo::FILETYPE_VAPOURSYNTH:
if(m_sysinfo->hasVPS32Support() || m_sysinfo->hasVPS64Support())
if(m_sysinfo->hasVapourSynth())
{
m_pipedSource = new VapoursynthSource(m_jobObject, m_options, m_sysinfo, m_preferences, m_status, &m_abort, &m_pause, &m_semaphorePaused, m_sourceFileName);
}
@ -255,8 +255,8 @@ void EncodeThread::encode(void)
//Print system info
log(tr("\n--- SYSTEMINFO ---\n"));
log(tr("Binary Path : %1").arg(QDir::toNativeSeparators(m_sysinfo->getAppPath())));
log(tr("Avisynth : %1").arg(m_sysinfo->hasAVSSupport() ? tr("Yes") : tr("No")));
log(tr("VapourSynth : %1").arg((m_sysinfo->hasVPS32Support() || m_sysinfo->hasVPS64Support()) ? tr("Yes") : tr("No")));
log(tr("Avisynth : %1").arg(m_sysinfo->hasAvisynth() ? tr("Yes") : tr("No")));
log(tr("VapourSynth : %1").arg(m_sysinfo->hasVapourSynth() ? tr("Yes") : tr("No")));
//Print encoder settings
log(tr("\n--- SETTINGS ---\n"));

View File

@ -62,10 +62,10 @@ static inline QString &cleanDir(QString &path)
// External API
//-------------------------------------
int VapourSynthCheckThread::detect(QString &path, int &vapourSynthType)
int VapourSynthCheckThread::detect(QString &path, VapourSynthType &type)
{
path.clear();
vapourSynthType = VAPOURSYNTH_OFF;
type &= 0;
QMutexLocker lock(&m_vpsLock);
QEventLoop loop;
@ -99,9 +99,9 @@ int VapourSynthCheckThread::detect(QString &path, int &vapourSynthType)
return -1;
}
if(thread.getSuccess() & (VAPOURSYNTH_X86 | VAPOURSYNTH_X64))
if(!!thread.getSuccess())
{
vapourSynthType = thread.getSuccess();
type |= thread.getSuccess();
path = thread.getPath();
qDebug("VapourSynth check completed successfully.");
return 1;
@ -117,7 +117,7 @@ int VapourSynthCheckThread::detect(QString &path, int &vapourSynthType)
VapourSynthCheckThread::VapourSynthCheckThread(void)
{
m_success = VAPOURSYNTH_OFF;
m_success &= 0;
m_exception = false;
m_vpsPath.clear();
}
@ -128,43 +128,42 @@ VapourSynthCheckThread::~VapourSynthCheckThread(void)
void VapourSynthCheckThread::run(void)
{
m_success = VAPOURSYNTH_OFF;
m_success &= 0;
m_exception = false;
m_vpsPath.clear();
m_success = detectVapourSynthPath1(m_vpsPath, &m_exception);
detectVapourSynthPath1(m_success, m_vpsPath, &m_exception);
}
int VapourSynthCheckThread::detectVapourSynthPath1(QString &path, volatile bool *exception)
void VapourSynthCheckThread::detectVapourSynthPath1(VapourSynthType &success, QString &path, volatile bool *exception)
{
__try
{
return detectVapourSynthPath2(path, exception);
return detectVapourSynthPath2(success, path, exception);
}
__except(1)
{
*exception = true;
qWarning("Unhandled exception error in VapourSynth thread !!!");
return false;
}
}
int VapourSynthCheckThread::detectVapourSynthPath2(QString &path, volatile bool *exception)
void VapourSynthCheckThread::detectVapourSynthPath2(VapourSynthType &success, QString &path, volatile bool *exception)
{
try
{
return detectVapourSynthPath3(path);
return detectVapourSynthPath3(success, path);
}
catch(...)
{
*exception = true;
qWarning("VapourSynth initializdation raised an C++ exception!");
return false;
}
}
int VapourSynthCheckThread::detectVapourSynthPath3(QString &path)
void VapourSynthCheckThread::detectVapourSynthPath3(VapourSynthType &success, QString &path)
{
int success = VAPOURSYNTH_OFF;
success &= 0;
path.clear();
static const char *VPS_REG_KEYS[] =
@ -197,7 +196,7 @@ int VapourSynthCheckThread::detectVapourSynthPath3(QString &path)
if(!VALID_DIR(vapoursynthPath))
{
qWarning("VapourSynth install path not found -> disable VapouSynth support!");
return VAPOURSYNTH_OFF;
return;
}
qDebug("VapourSynth Dir: %s", vapoursynthPath.toUtf8().constData());
@ -249,8 +248,6 @@ int VapourSynthCheckThread::detectVapourSynthPath3(QString &path)
{
path = vapoursynthPath;
}
return success;
}
bool VapourSynthCheckThread::isVapourSynthComplete(const QString &vsCorePath, QFile *&vpsExeFile, QFile *&vpsDllFile)

View File

@ -32,26 +32,30 @@ class VapourSynthCheckThread : public QThread
Q_OBJECT
public:
static int detect(QString &path, int &vapourSynthType);
typedef enum _VapourSynthType_t
{
VAPOURSYNTH_X86 = 0x1,
VAPOURSYNTH_X64 = 0x2
}
VapourSynthType_t;
static const int VAPOURSYNTH_OFF = 0;
static const int VAPOURSYNTH_X86 = 1;
static const int VAPOURSYNTH_X64 = 2;
typedef QFlags<VapourSynthType_t> VapourSynthType;
static int detect(QString &path, VapourSynthType &type);
protected:
VapourSynthCheckThread(void);
~VapourSynthCheckThread(void);
int getSuccess(void) { return m_success; }
bool getException(void) { return m_exception; }
VapourSynthType &getSuccess(void) { return m_success; }
QString getPath(void) { return m_vpsPath; }
private slots:
void start(Priority priority = InheritPriority) { QThread::start(priority); }
private:
int m_success;
volatile bool m_exception;
VapourSynthType m_success;
QString m_vpsPath;
static QMutex m_vpsLock;
@ -62,9 +66,9 @@ private:
virtual void run(void);
//Functions
static int detectVapourSynthPath1(QString &path, volatile bool *exception);
static int detectVapourSynthPath2(QString &path, volatile bool *exception);
static int detectVapourSynthPath3(QString &path);
static void detectVapourSynthPath1(VapourSynthType &success, QString &path, volatile bool *exception);
static void detectVapourSynthPath2(VapourSynthType &success, QString &path, volatile bool *exception);
static void detectVapourSynthPath3(VapourSynthType &success, QString &path);
//Internal functions
static bool isVapourSynthComplete(const QString &vsCorePath, QFile *&vpsExeFile, QFile *&vpsDllFile);

View File

@ -26,7 +26,7 @@
#define VER_X264_MAJOR 2
#define VER_X264_MINOR 5
#define VER_X264_PATCH 0
#define VER_X264_BUILD 922
#define VER_X264_BUILD 925
#define VER_X264_PORTABLE_EDITION (0)

View File

@ -505,7 +505,7 @@ void AddJobDialog::modeIndexChanged(int index)
void AddJobDialog::accept(void)
{
//Check 64-Bit support
if((ui->cbxEncoderArch->currentIndex() == OptionsModel::EncArch_x64) && (!m_sysinfo->hasX64Support()))
if((ui->cbxEncoderArch->currentIndex() == OptionsModel::EncArch_x64) && (!m_sysinfo->getCPUFeatures(SysinfoModel::CPUFeatures_X64)))
{
QMessageBox::warning(this, tr("64-Bit unsupported!"), tr("<nobr>Sorry, this computer does <b>not</b> support 64-Bit encoders!</nobr>"));
ui->cbxEncoderArch->setCurrentIndex(OptionsModel::EncArch_x32);
@ -554,7 +554,7 @@ void AddJobDialog::accept(void)
const int sourceType = MediaInfo::analyze(sourceFile.canonicalFilePath());
if(sourceType == MediaInfo::FILETYPE_AVISYNTH)
{
if(!m_sysinfo->hasAVSSupport())
if(!m_sysinfo->hasAvisynth())
{
if(QMessageBox::warning(this, tr("Avisynth unsupported!"), tr("<nobr>An Avisynth script was selected as input, although Avisynth is <b>not</b> available!</nobr>"), tr("Abort"), tr("Ignore (at your own risk!)")) != 1)
{
@ -564,7 +564,7 @@ void AddJobDialog::accept(void)
}
else if(sourceType == MediaInfo::FILETYPE_VAPOURSYNTH)
{
if(!(m_sysinfo->hasVPS32Support() || m_sysinfo->hasVPS64Support()))
if(!m_sysinfo->hasAvisynth())
{
if(QMessageBox::warning(this, tr("VapurSynth unsupported!"), tr("<nobr>A VapourSynth script was selected as input, although VapourSynth is <b>not/<b> available!</nobr>"), tr("Abort"), tr("Ignore (at your own risk!)")) != 1)
{

View File

@ -124,9 +124,9 @@ MainWindow::MainWindow(const MUtils::CPUFetaures::cpu_info_t &cpuFeatures, MUtil
//Create and initialize the sysinfo object
m_sysinfo.reset(new SysinfoModel());
m_sysinfo->setAppPath(QApplication::applicationDirPath());
m_sysinfo->setMMXSupport(cpuFeatures.features && MUtils::CPUFetaures::FLAG_MMX);
m_sysinfo->setSSESupport(cpuFeatures.features && MUtils::CPUFetaures::FLAG_SSE); //SSE implies MMX2
m_sysinfo->setX64Support(cpuFeatures.x64 && (cpuFeatures.features && MUtils::CPUFetaures::FLAG_SSE2)); //X64 implies SSE2
m_sysinfo->setCPUFeatures(SysinfoModel::CPUFeatures_MMX, cpuFeatures.features & MUtils::CPUFetaures::FLAG_MMX);
m_sysinfo->setCPUFeatures(SysinfoModel::CPUFeatures_SSE, cpuFeatures.features & MUtils::CPUFetaures::FLAG_SSE);
m_sysinfo->setCPUFeatures(SysinfoModel::CPUFeatures_X64, cpuFeatures.x64 && (cpuFeatures.features & MUtils::CPUFetaures::FLAG_SSE2)); //X64 implies SSE2
//Load preferences
m_preferences.reset(new PreferencesModel());
@ -855,16 +855,16 @@ void MainWindow::init(void)
//---------------------------------------
//Make sure this CPU can run x264 (requires MMX + MMXEXT/iSSE to run x264 with ASM enabled, additionally requires SSE1 for most x264 builds)
if(!m_sysinfo->hasMMXSupport())
if(!m_sysinfo->getCPUFeatures(SysinfoModel::CPUFeatures_MMX))
{
QMessageBox::critical(this, tr("Unsupported CPU"), tr("<nobr>Sorry, but this machine is <b>not</b> physically capable of running x264 (with assembly).<br>Please get a CPU that supports at least the MMX and MMXEXT instruction sets!</nobr>"), tr("Quit"));
qFatal("System does not support MMX and MMXEXT, x264 will not work !!!");
INIT_ERROR_EXIT();
}
else if(!m_sysinfo->hasSSESupport())
else if(!m_sysinfo->getCPUFeatures(SysinfoModel::CPUFeatures_SSE))
{
qWarning("WARNING: System does not support SSE1, most x264 builds will not work !!!\n");
int val = QMessageBox::warning(this, tr("Unsupported CPU"), tr("<nobr>It appears that this machine does <b>not</b> support the SSE1 instruction set.<br>Thus most builds of x264 will <b>not</b> run on this computer at all.<br><br>Please get a CPU that supports the MMX and SSE1 instruction sets!</nobr>"), tr("Quit"), tr("Ignore"));
qWarning("WARNING: System does not support SSE (v1), x264/x265 probably will *not* work !!!\n");
int val = QMessageBox::warning(this, tr("Unsupported CPU"), tr("<nobr>It appears that this machine does <b>not</b> support the SSE1 instruction set.<br>Thus most builds of x264/x265 will <b>not</b> run on this computer at all.<br><br>Please get a CPU that supports the MMX and SSE1 instruction sets!</nobr>"), tr("Quit"), tr("Ignore"));
if(val != 1) INIT_ERROR_EXIT();
}
@ -902,7 +902,8 @@ void MainWindow::init(void)
if(result && (avisynthVersion >= 2.5))
{
qDebug("Avisynth support is officially enabled now!");
m_sysinfo->setAVSSupport(true);
m_sysinfo->setAvisynth(SysinfoModel::Avisynth_X86, true);
m_sysinfo->setAvisynth(SysinfoModel::Avisynth_X64, true);
}
else
{
@ -929,8 +930,8 @@ void MainWindow::init(void)
if(!arguments.contains(CLI_PARAM_SKIP_VPS_CHECK))
{
qDebug("[Check for VapourSynth support]");
VapourSynthCheckThread::VapourSynthType vapoursynthType;
QString vapoursynthPath;
int vapoursynthType;
const int result = VapourSynthCheckThread::detect(vapoursynthPath, vapoursynthType);
if(result < 0)
{
@ -940,11 +941,11 @@ void MainWindow::init(void)
const int val = QMessageBox::critical(this, tr("VapourSynth Error"), QString("<nobr>%1</nobr>").arg(text).replace("-", "&minus;"), tr("Quit"), tr("Ignore"));
if(val != 1) INIT_ERROR_EXIT();
}
if(result && vapoursynthType && (!vapoursynthPath.isEmpty()))
if(result && (!!vapoursynthType) && (!vapoursynthPath.isEmpty()))
{
qDebug("VapourSynth support is officially enabled now!");
m_sysinfo->setVPS32Support(vapoursynthType & VapourSynthCheckThread::VAPOURSYNTH_X86);
m_sysinfo->setVPS64Support(vapoursynthType & VapourSynthCheckThread::VAPOURSYNTH_X64);
m_sysinfo->setVapourSynth(SysinfoModel::VapourSynth_X86, (vapoursynthType.testFlag(VapourSynthCheckThread::VAPOURSYNTH_X86)));
m_sysinfo->setVapourSynth(SysinfoModel::VapourSynth_X64, (vapoursynthType.testFlag(VapourSynthCheckThread::VAPOURSYNTH_X64)));
m_sysinfo->setVPSPath(vapoursynthPath);
}
else
@ -970,7 +971,7 @@ void MainWindow::init(void)
//---------------------------------------
//Set Window title
setWindowTitle(QString("%1 (%2)").arg(windowTitle(), m_sysinfo->hasX64Support() ? "64-Bit" : "32-Bit"));
setWindowTitle(QString("%1 (%2)").arg(windowTitle(), m_sysinfo->getCPUFeatures(SysinfoModel::CPUFeatures_X64) ? "64-Bit" : "32-Bit"));
//Enable drag&drop support for this window, required for Qt v4.8.4+
setAcceptDrops(true);

View File

@ -103,7 +103,7 @@ void PreferencesDialog::showEvent(QShowEvent *event)
UPDATE_CHECKBOX(ui->checkRunNextJob, m_preferences->getAutoRunNextJob());
UPDATE_CHECKBOX(ui->checkShutdownComputer, m_preferences->getShutdownComputer());
UPDATE_CHECKBOX(ui->checkUse64BitAvs2YUV, m_preferences->getUseAvisyth64Bit() && m_sysinfo->hasX64Support());
UPDATE_CHECKBOX(ui->checkUse64BitAvs2YUV, m_preferences->getPrefer64BitSource() && m_sysinfo->getCPUFeatures(SysinfoModel::CPUFeatures_X64));
UPDATE_CHECKBOX(ui->checkSaveLogFiles, m_preferences->getSaveLogFiles());
UPDATE_CHECKBOX(ui->checkSaveToSourceFolder, m_preferences->getSaveToSourcePath());
UPDATE_CHECKBOX(ui->checkEnableSounds, m_preferences->getEnableSounds());
@ -114,8 +114,9 @@ void PreferencesDialog::showEvent(QShowEvent *event)
UPDATE_COMBOBOX(ui->comboBoxPriority, qBound(-2, m_preferences->getProcessPriority(), 1), 0);
ui->checkUse64BitAvs2YUV->setEnabled(m_sysinfo->hasX64Support());
ui->labelUse64BitAvs2YUV->setEnabled(m_sysinfo->hasX64Support());
const bool hasX64 = m_sysinfo->getCPUFeatures(SysinfoModel::CPUFeatures_X64);
ui->checkUse64BitAvs2YUV->setEnabled(hasX64);
ui->labelUse64BitAvs2YUV->setEnabled(hasX64);
}
bool PreferencesDialog::eventFilter(QObject *o, QEvent *e)
@ -160,7 +161,7 @@ void PreferencesDialog::done(int n)
{
m_preferences->setAutoRunNextJob(ui->checkRunNextJob->isChecked());
m_preferences->setShutdownComputer(ui->checkShutdownComputer->isChecked());
m_preferences->setUseAvisyth64Bit(ui->checkUse64BitAvs2YUV->isChecked());
m_preferences->setPrefer64BitSource(ui->checkUse64BitAvs2YUV->isChecked());
m_preferences->setSaveLogFiles(ui->checkSaveLogFiles->isChecked());
m_preferences->setSaveToSourcePath(ui->checkSaveToSourceFolder->isChecked());
m_preferences->setMaxRunningJobCount(ui->spinBoxJobCount->value());