Added a new model to store the system capabilities.
This commit is contained in:
parent
7ed6499ff2
commit
2c97c709fc
@ -10,7 +10,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>372</width>
|
||||
<height>387</height>
|
||||
<height>359</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -121,37 +121,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkUse10BitEncoding">
|
||||
<property name="text">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="labelUse10BitEncoding">
|
||||
<property name="text">
|
||||
<string>Use 10-Bit version of x264 → implies 'High 10' H.264 Profile</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<item>
|
||||
|
75
src/model_sysinfo.h
Normal file
75
src/model_sysinfo.h
Normal file
@ -0,0 +1,75 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Simple x264 Launcher
|
||||
// Copyright (C) 2004-2014 LoRd_MuldeR <MuldeR2@GMX.de>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
//
|
||||
// http://www.gnu.org/licenses/gpl-2.0.txt
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
#include <QString>
|
||||
|
||||
#define SYSINFO_MAKE_FLAG(NAME) \
|
||||
inline void set##NAME##Support(const bool &enable) \
|
||||
{ \
|
||||
if(enable) setFlag(FLAG_HAS_##NAME); else clrFlag(FLAG_HAS_##NAME); \
|
||||
} \
|
||||
inline bool has##NAME##Support(void) const \
|
||||
{ \
|
||||
return ((m_flags & (FLAG_HAS_##NAME)) == FLAG_HAS_##NAME); \
|
||||
}
|
||||
|
||||
#define SYSINFO_MAKE_PATH(NAME) \
|
||||
inline void set##NAME##Path(const QString &path) \
|
||||
{ \
|
||||
m_path##NAME = path; \
|
||||
} \
|
||||
inline const QString & get##NAME##Path(void) const \
|
||||
{ \
|
||||
return m_path##NAME; \
|
||||
}
|
||||
|
||||
class SysinfoModel
|
||||
{
|
||||
public:
|
||||
SysinfoModel(void) { m_flags = 0; }
|
||||
|
||||
SYSINFO_MAKE_FLAG(X64)
|
||||
SYSINFO_MAKE_FLAG(MMX)
|
||||
SYSINFO_MAKE_FLAG(SSE)
|
||||
SYSINFO_MAKE_FLAG(AVS)
|
||||
SYSINFO_MAKE_FLAG(VPS)
|
||||
SYSINFO_MAKE_PATH(VPS)
|
||||
SYSINFO_MAKE_PATH(App)
|
||||
|
||||
protected:
|
||||
static const unsigned int FLAG_HAS_X64 = 0x00000001;
|
||||
static const unsigned int FLAG_HAS_MMX = 0x00000001;
|
||||
static const unsigned int FLAG_HAS_SSE = 0x00000004;
|
||||
static const unsigned int FLAG_HAS_AVS = 0x00000008;
|
||||
static const unsigned int FLAG_HAS_VPS = 0x00000010;
|
||||
|
||||
inline void setFlag(const unsigned int &flag) { m_flags = (m_flags | flag); }
|
||||
inline void clrFlag(const unsigned int &flag) { m_flags = (m_flags & (~flag)); }
|
||||
|
||||
QString m_pathApp;
|
||||
QString m_pathVPS;
|
||||
|
||||
unsigned int m_flags;
|
||||
};
|
||||
|
||||
#undef SYSINFO_MAKE_FLAG
|
||||
#undef SYSINFO_MAKE_PATH
|
@ -26,7 +26,7 @@
|
||||
#define VER_X264_MAJOR 2
|
||||
#define VER_X264_MINOR 3
|
||||
#define VER_X264_PATCH 1
|
||||
#define VER_X264_BUILD 761
|
||||
#define VER_X264_BUILD 763
|
||||
|
||||
#define VER_X264_MINIMUM_REV 2380
|
||||
#define VER_X264_CURRENT_API 142
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "cli.h"
|
||||
#include "ipc.h"
|
||||
#include "model_status.h"
|
||||
#include "model_sysinfo.h"
|
||||
#include "model_jobList.h"
|
||||
#include "model_options.h"
|
||||
#include "model_preferences.h"
|
||||
@ -75,9 +76,8 @@ const char *tpl_last = "<LAST_USED>";
|
||||
*/
|
||||
MainWindow::MainWindow(const x264_cpu_t *const cpuFeatures, IPC *ipc)
|
||||
:
|
||||
m_cpuFeatures(cpuFeatures),
|
||||
m_ipc(ipc),
|
||||
m_appDir(QApplication::applicationDirPath()),
|
||||
m_sysinfo(NULL),
|
||||
m_options(NULL),
|
||||
m_jobList(NULL),
|
||||
m_pendingFiles(new QStringList()),
|
||||
@ -98,6 +98,13 @@ MainWindow::MainWindow(const x264_cpu_t *const cpuFeatures, IPC *ipc)
|
||||
qRegisterMetaType<QUuid>("DWORD");
|
||||
qRegisterMetaType<JobStatus>("JobStatus");
|
||||
|
||||
//Create and initialize the sysinfo object
|
||||
m_sysinfo = new SysinfoModel();
|
||||
m_sysinfo->setAppPath(QApplication::applicationDirPath());
|
||||
m_sysinfo->setMMXSupport(cpuFeatures->mmx && cpuFeatures->mmx2);
|
||||
m_sysinfo->setSSESupport(cpuFeatures->sse);
|
||||
m_sysinfo->setX64Support(cpuFeatures->x64);
|
||||
|
||||
//Load preferences
|
||||
m_preferences = new PreferencesModel();
|
||||
PreferencesModel::loadPreferences(m_preferences);
|
||||
@ -117,7 +124,7 @@ MainWindow::MainWindow(const x264_cpu_t *const cpuFeatures, IPC *ipc)
|
||||
//Update title
|
||||
ui->labelBuildDate->setText(tr("Built on %1 at %2").arg(x264_version_date().toString(Qt::ISODate), QString::fromLatin1(x264_version_time())));
|
||||
ui->labelBuildDate->installEventFilter(this);
|
||||
setWindowTitle(QString("%1 (%2 Mode)").arg(windowTitle(), m_cpuFeatures->x64 ? "64-Bit" : "32-Bit"));
|
||||
setWindowTitle(QString("%1 (%2 Mode)").arg(windowTitle(), m_sysinfo->hasX64Support() ? "64-Bit" : "32-Bit"));
|
||||
if(X264_DEBUG)
|
||||
{
|
||||
setWindowTitle(QString("%1 | !!! DEBUG VERSION !!!").arg(windowTitle()));
|
||||
@ -219,6 +226,8 @@ MainWindow::~MainWindow(void)
|
||||
|
||||
X264_DELETE(m_preferences);
|
||||
X264_DELETE(m_recentlyUsed);
|
||||
X264_DELETE(m_sysinfo);
|
||||
|
||||
VapourSynthCheckThread::unload();
|
||||
AvisynthCheckThread::unload();
|
||||
|
||||
@ -593,7 +602,7 @@ void MainWindow::showPreferences(void)
|
||||
ENSURE_APP_IS_IDLE();
|
||||
m_status = STATUS_BLOCKED;
|
||||
|
||||
PreferencesDialog *preferences = new PreferencesDialog(this, m_preferences, m_cpuFeatures->x64);
|
||||
PreferencesDialog *preferences = new PreferencesDialog(this, m_preferences, m_sysinfo);
|
||||
preferences->exec();
|
||||
|
||||
X264_DELETE(preferences);
|
||||
@ -774,13 +783,13 @@ void MainWindow::init(void)
|
||||
{
|
||||
qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
|
||||
QString current = binaries.takeFirst();
|
||||
QFile *file = new QFile(QString("%1/toolset/%2").arg(m_appDir, current));
|
||||
QFile *file = new QFile(QString("%1/toolset/%2").arg(m_sysinfo->getAppPath(), current));
|
||||
if(file->open(QIODevice::ReadOnly))
|
||||
{
|
||||
if(!x264_is_executable(file->fileName()))
|
||||
{
|
||||
QMessageBox::critical(this, tr("Invalid File!"), tr("<nobr>At least on required tool is not a valid Win32 or Win64 binary:<br><tt style=\"whitespace:nowrap\">%1</tt><br><br>Please re-install the program in order to fix the problem!</nobr>").arg(QDir::toNativeSeparators(QString("%1/toolset/%2").arg(m_appDir, current))).replace("-", "−"));
|
||||
qFatal(QString("Binary is invalid: %1/toolset/%2").arg(m_appDir, current).toLatin1().constData());
|
||||
QMessageBox::critical(this, tr("Invalid File!"), tr("<nobr>At least on required tool is not a valid Win32 or Win64 binary:<br><tt style=\"whitespace:nowrap\">%1</tt><br><br>Please re-install the program in order to fix the problem!</nobr>").arg(QDir::toNativeSeparators(QString("%1/toolset/%2").arg(m_sysinfo->getAppPath(), current))).replace("-", "−"));
|
||||
qFatal(QString("Binary is invalid: %1/toolset/%2").arg(m_sysinfo->getAppPath(), current).toLatin1().constData());
|
||||
INIT_ERROR_EXIT();
|
||||
}
|
||||
m_toolsList << file;
|
||||
@ -788,8 +797,8 @@ void MainWindow::init(void)
|
||||
else
|
||||
{
|
||||
X264_DELETE(file);
|
||||
QMessageBox::critical(this, tr("File Not Found!"), tr("<nobr>At least on required tool could not be found:<br><tt style=\"whitespace:nowrap\">%1</tt><br><br>Please re-install the program in order to fix the problem!</nobr>").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());
|
||||
QMessageBox::critical(this, tr("File Not Found!"), tr("<nobr>At least on required tool could not be found:<br><tt style=\"whitespace:nowrap\">%1</tt><br><br>Please re-install the program in order to fix the problem!</nobr>").arg(QDir::toNativeSeparators(QString("%1/toolset/%2").arg(m_sysinfo->getAppPath(), current))).replace("-", "−"));
|
||||
qFatal(QString("Binary not found: %1/toolset/%2").arg(m_sysinfo->getAppPath(), current).toLatin1().constData());
|
||||
INIT_ERROR_EXIT();
|
||||
}
|
||||
}
|
||||
@ -821,13 +830,13 @@ 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_cpuFeatures->mmx && m_cpuFeatures->mmx2))
|
||||
if(!m_sysinfo->hasMMXSupport())
|
||||
{
|
||||
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_cpuFeatures->mmx && m_cpuFeatures->sse))
|
||||
else if(!m_sysinfo->hasSSESupport())
|
||||
{
|
||||
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"));
|
||||
@ -862,7 +871,12 @@ void MainWindow::init(void)
|
||||
int val = QMessageBox::critical(this, tr("Avisynth Error"), QString("<nobr>%1</nobr>").arg(text).replace("-", "−"), tr("Quit"), tr("Ignore"));
|
||||
if(val != 1) INIT_ERROR_EXIT();
|
||||
}
|
||||
if((!result) || (avisynthVersion < 2.5))
|
||||
if(result && (avisynthVersion >= 2.5))
|
||||
{
|
||||
qDebug("Avisynth support is officially enabled now!");
|
||||
m_sysinfo->setAVSSupport(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!m_preferences->disableWarnings())
|
||||
{
|
||||
@ -879,8 +893,8 @@ void MainWindow::init(void)
|
||||
if(!CLIParser::checkFlag(CLI_PARAM_SKIP_VPS_CHECK, arguments))
|
||||
{
|
||||
qDebug("[Check for VapourSynth support]");
|
||||
volatile double avisynthVersion = 0.0;
|
||||
const int result = VapourSynthCheckThread::detect(m_vapoursynthPath);
|
||||
QString vapoursynthPath;
|
||||
const int result = VapourSynthCheckThread::detect(vapoursynthPath);
|
||||
if(result < 0)
|
||||
{
|
||||
QString text = tr("A critical error was encountered while checking your VapourSynth installation.").append("<br>");
|
||||
@ -889,7 +903,13 @@ void MainWindow::init(void)
|
||||
int val = QMessageBox::critical(this, tr("VapourSynth Error"), QString("<nobr>%1</nobr>").arg(text).replace("-", "−"), tr("Quit"), tr("Ignore"));
|
||||
if(val != 1) INIT_ERROR_EXIT();
|
||||
}
|
||||
if((!result) || (m_vapoursynthPath.isEmpty()))
|
||||
if(result && (!vapoursynthPath.isEmpty()))
|
||||
{
|
||||
qDebug("VapourSynth support is officially enabled now!");
|
||||
m_sysinfo->setVPSSupport(true);
|
||||
m_sysinfo->setVPSPath(vapoursynthPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!m_preferences->disableWarnings())
|
||||
{
|
||||
@ -1079,7 +1099,7 @@ void MainWindow::checkUpdates(void)
|
||||
return;
|
||||
}
|
||||
|
||||
UpdaterDialog *updater = new UpdaterDialog(this, QString("%1/toolset").arg(m_appDir));
|
||||
UpdaterDialog *updater = new UpdaterDialog(this, m_sysinfo);
|
||||
const int ret = updater->exec();
|
||||
|
||||
if(updater->getSuccess())
|
||||
@ -1272,7 +1292,7 @@ void MainWindow::dropEvent(QDropEvent *event)
|
||||
bool MainWindow::createJob(QString &sourceFileName, QString &outputFileName, OptionsModel *options, bool &runImmediately, const bool restart, int fileNo, int fileTotal, bool *applyToAll)
|
||||
{
|
||||
bool okay = false;
|
||||
AddJobDialog *addDialog = new AddJobDialog(this, options, m_recentlyUsed, m_cpuFeatures->x64, m_preferences->saveToSourcePath());
|
||||
AddJobDialog *addDialog = new AddJobDialog(this, options, m_recentlyUsed, m_sysinfo, m_preferences->saveToSourcePath());
|
||||
|
||||
addDialog->setRunImmediately(runImmediately);
|
||||
if(!sourceFileName.isEmpty()) addDialog->setSourceFile(sourceFileName);
|
||||
@ -1356,11 +1376,8 @@ bool MainWindow::appendJob(const QString &sourceFileName, const QString &outputF
|
||||
sourceFileName,
|
||||
outputFileName,
|
||||
options,
|
||||
QString("%1/toolset").arg(m_appDir),
|
||||
m_vapoursynthPath,
|
||||
m_cpuFeatures->x64,
|
||||
false /*m_preferences->use10BitEncoding()*/,
|
||||
m_cpuFeatures->x64 && m_preferences->useAvisyth64Bit(),
|
||||
m_sysinfo,
|
||||
m_preferences->useAvisyth64Bit(),
|
||||
m_skipVersionTest,
|
||||
m_preferences->processPriority(),
|
||||
m_abortOnTimeout
|
||||
|
@ -27,6 +27,7 @@
|
||||
class IPC;
|
||||
class JobListModel;
|
||||
class OptionsModel;
|
||||
class SysinfoModel;
|
||||
class QFile;
|
||||
class QLibrary;
|
||||
class PreferencesModel;
|
||||
@ -84,14 +85,10 @@ private:
|
||||
QStringList *m_pendingFiles;
|
||||
QList<QFile*> m_toolsList;
|
||||
|
||||
SysinfoModel *m_sysinfo;
|
||||
PreferencesModel *m_preferences;
|
||||
RecentlyUsed *m_recentlyUsed;
|
||||
|
||||
QString m_vapoursynthPath;
|
||||
|
||||
const x264_cpu_t *const m_cpuFeatures;
|
||||
const QString m_appDir;
|
||||
|
||||
bool createJob(QString &sourceFileName, QString &outputFileName, OptionsModel *options, bool &runImmediately, const bool restart = false, int fileNo = -1, int fileTotal = 0, bool *applyToAll = NULL);
|
||||
bool createJobMultiple(const QStringList &filePathIn);
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
#include "global.h"
|
||||
#include "model_preferences.h"
|
||||
#include "model_sysinfo.h"
|
||||
|
||||
#include <QSettings>
|
||||
#include <QDesktopServices>
|
||||
@ -52,10 +53,10 @@ static inline void UPDATE_COMBOBOX(QComboBox *const cobox, const int value, cons
|
||||
}
|
||||
}
|
||||
|
||||
PreferencesDialog::PreferencesDialog(QWidget *parent, PreferencesModel *preferences, bool x64)
|
||||
PreferencesDialog::PreferencesDialog(QWidget *parent, PreferencesModel *preferences, const SysinfoModel *sysinfo)
|
||||
:
|
||||
QDialog(parent),
|
||||
m_x64(x64),
|
||||
m_sysinfo(sysinfo),
|
||||
ui(new Ui::PreferencesDialog())
|
||||
{
|
||||
ui->setupUi(this);
|
||||
@ -69,7 +70,6 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, PreferencesModel *preferen
|
||||
ui->comboBoxPriority->setItemData(3, QVariant::fromValue(-2)); //Idle
|
||||
|
||||
ui->labelRunNextJob->installEventFilter(this);
|
||||
ui->labelUse10BitEncoding->installEventFilter(this);
|
||||
ui->labelUse64BitAvs2YUV->installEventFilter(this);
|
||||
ui->labelShutdownComputer->installEventFilter(this);
|
||||
ui->labelSaveLogFiles->installEventFilter(this);
|
||||
@ -82,7 +82,6 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, PreferencesModel *preferen
|
||||
ui->checkBoxDummy2->installEventFilter(this);
|
||||
|
||||
connect(ui->resetButton, SIGNAL(clicked()), this, SLOT(resetButtonPressed()));
|
||||
connect(ui->checkUse10BitEncoding, SIGNAL(toggled(bool)), this, SLOT(use10BitEncodingToggled(bool)));
|
||||
connect(ui->checkDisableWarnings, SIGNAL(toggled(bool)), this, SLOT(disableWarningsToggled(bool)));
|
||||
|
||||
m_preferences = preferences;
|
||||
@ -99,7 +98,7 @@ void PreferencesDialog::showEvent(QShowEvent *event)
|
||||
|
||||
UPDATE_CHECKBOX(ui->checkRunNextJob, m_preferences->autoRunNextJob());
|
||||
UPDATE_CHECKBOX(ui->checkShutdownComputer, m_preferences->shutdownComputer());
|
||||
UPDATE_CHECKBOX(ui->checkUse64BitAvs2YUV, m_preferences->useAvisyth64Bit());
|
||||
UPDATE_CHECKBOX(ui->checkUse64BitAvs2YUV, m_preferences->useAvisyth64Bit() && m_sysinfo->hasX64Support());
|
||||
UPDATE_CHECKBOX(ui->checkSaveLogFiles, m_preferences->saveLogFiles());
|
||||
UPDATE_CHECKBOX(ui->checkSaveToSourceFolder, m_preferences->saveToSourcePath());
|
||||
UPDATE_CHECKBOX(ui->checkEnableSounds, m_preferences->enableSounds());
|
||||
@ -110,8 +109,8 @@ void PreferencesDialog::showEvent(QShowEvent *event)
|
||||
|
||||
UPDATE_COMBOBOX(ui->comboBoxPriority, qBound(-2, m_preferences->processPriority(), 1), 0);
|
||||
|
||||
ui->checkUse64BitAvs2YUV->setEnabled(m_x64);
|
||||
ui->labelUse64BitAvs2YUV->setEnabled(m_x64);
|
||||
ui->checkUse64BitAvs2YUV->setEnabled(m_sysinfo->hasX64Support());
|
||||
ui->labelUse64BitAvs2YUV->setEnabled(m_sysinfo->hasX64Support());
|
||||
}
|
||||
|
||||
bool PreferencesDialog::eventFilter(QObject *o, QEvent *e)
|
||||
@ -125,7 +124,6 @@ bool PreferencesDialog::eventFilter(QObject *o, QEvent *e)
|
||||
{
|
||||
emulateMouseEvent(o, e, ui->labelRunNextJob, ui->checkRunNextJob);
|
||||
emulateMouseEvent(o, e, ui->labelShutdownComputer, ui->checkShutdownComputer);
|
||||
emulateMouseEvent(o, e, ui->labelUse10BitEncoding, ui->checkUse10BitEncoding);
|
||||
emulateMouseEvent(o, e, ui->labelUse64BitAvs2YUV, ui->checkUse64BitAvs2YUV);
|
||||
emulateMouseEvent(o, e, ui->labelSaveLogFiles, ui->checkSaveLogFiles);
|
||||
emulateMouseEvent(o, e, ui->labelSaveToSourceFolder, ui->checkSaveToSourceFolder);
|
||||
@ -176,21 +174,21 @@ void PreferencesDialog::resetButtonPressed(void)
|
||||
showEvent(NULL);
|
||||
}
|
||||
|
||||
void PreferencesDialog::use10BitEncodingToggled(bool checked)
|
||||
{
|
||||
if(checked)
|
||||
{
|
||||
QString text;
|
||||
text += QString("<nobr>%1</nobr><br>").arg(tr("Please note that 10−Bit H.264 streams are <b>not</b> currently supported by hardware (standalone) players!"));
|
||||
text += QString("<nobr>%1</nobr><br>").arg(tr("To play such streams, you will need an <i>up−to−date</i> ffdshow−tryouts, CoreAVC 3.x or another supported s/w decoder."));
|
||||
text += QString("<nobr>%1</nobr><br>").arg(tr("Also be aware that hardware−acceleration (CUDA, DXVA, etc) usually will <b>not</b> work with 10−Bit H.264 streams."));
|
||||
|
||||
if(QMessageBox::warning(this, tr("10-Bit Encoding"), text.replace("-", "−"), tr("Continue"), tr("Revert"), QString(), 1) != 0)
|
||||
{
|
||||
UPDATE_CHECKBOX(ui->checkUse10BitEncoding, false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
//void PreferencesDialog::use10BitEncodingToggled(bool checked)
|
||||
//{
|
||||
// if(checked)
|
||||
// {
|
||||
// QString text;
|
||||
// text += QString("<nobr>%1</nobr><br>").arg(tr("Please note that 10−Bit H.264 streams are <b>not</b> currently supported by hardware (standalone) players!"));
|
||||
// text += QString("<nobr>%1</nobr><br>").arg(tr("To play such streams, you will need an <i>up−to−date</i> ffdshow−tryouts, CoreAVC 3.x or another supported s/w decoder."));
|
||||
// text += QString("<nobr>%1</nobr><br>").arg(tr("Also be aware that hardware−acceleration (CUDA, DXVA, etc) usually will <b>not</b> work with 10−Bit H.264 streams."));
|
||||
//
|
||||
// if(QMessageBox::warning(this, tr("10-Bit Encoding"), text.replace("-", "−"), tr("Continue"), tr("Revert"), QString(), 1) != 0)
|
||||
// {
|
||||
// UPDATE_CHECKBOX(ui->checkUse10BitEncoding, false, true);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
void PreferencesDialog::disableWarningsToggled(bool checked)
|
||||
{
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include <QDialog>
|
||||
|
||||
class PreferencesModel;
|
||||
class SysinfoModel;
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
@ -35,11 +36,9 @@ class PreferencesDialog : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PreferencesDialog(QWidget *parent, PreferencesModel *preferences, bool x64);
|
||||
PreferencesDialog(QWidget *parent, PreferencesModel *preferences, const SysinfoModel *sysinfo);
|
||||
~PreferencesDialog(void);
|
||||
|
||||
const bool m_x64;
|
||||
|
||||
protected:
|
||||
virtual void done(int n);
|
||||
virtual void showEvent(QShowEvent *event);
|
||||
@ -49,10 +48,10 @@ protected:
|
||||
|
||||
private:
|
||||
Ui::PreferencesDialog *const ui;
|
||||
const SysinfoModel *const m_sysinfo;
|
||||
PreferencesModel *m_preferences;
|
||||
|
||||
private slots:
|
||||
void resetButtonPressed(void);
|
||||
void use10BitEncodingToggled(bool checked);
|
||||
void disableWarningsToggled(bool checked);
|
||||
};
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "uic_win_updater.h"
|
||||
|
||||
#include "global.h"
|
||||
#include "model_sysinfo.h"
|
||||
#include "thread_updater.h"
|
||||
#include "checksum.h"
|
||||
|
||||
@ -63,11 +64,11 @@ while(0)
|
||||
// Constructor & Destructor
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
UpdaterDialog::UpdaterDialog(QWidget *parent, const QString &binDir)
|
||||
UpdaterDialog::UpdaterDialog(QWidget *parent, const SysinfoModel *sysinfo)
|
||||
:
|
||||
QDialog(parent),
|
||||
ui(new Ui::UpdaterDialog()),
|
||||
m_binDir(binDir),
|
||||
m_sysinfo(sysinfo),
|
||||
m_status(UpdateCheckThread::UpdateStatus_NotStartedYet),
|
||||
m_thread(NULL),
|
||||
m_updaterProcess(NULL),
|
||||
@ -473,7 +474,7 @@ bool UpdaterDialog::checkBinaries(QString &wgetBin, QString &gpgvBin)
|
||||
|
||||
for(size_t i = 0; FILE_INFO[i].name; i++)
|
||||
{
|
||||
const QString binPath = QString("%1/common/%2").arg(m_binDir, QString::fromLatin1(FILE_INFO[i].name));
|
||||
const QString binPath = QString("%1/common/%2").arg(m_sysinfo->getAppPath(), QString::fromLatin1(FILE_INFO[i].name));
|
||||
if(okay = okay && checkFileHash(binPath, FILE_INFO[i].hash))
|
||||
{
|
||||
binaries.insert(FILE_INFO[i].name, binPath);
|
||||
|
@ -25,6 +25,7 @@
|
||||
|
||||
class QMovie;
|
||||
class UpdateCheckThread;
|
||||
class SysinfoModel;
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
@ -36,7 +37,7 @@ class UpdaterDialog : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
UpdaterDialog(QWidget *parent, const QString &binDir);
|
||||
UpdaterDialog(QWidget *parent, const SysinfoModel *sysinfo);
|
||||
~UpdaterDialog(void);
|
||||
|
||||
static const int READY_TO_INSTALL_UPDATE = 42;
|
||||
@ -65,9 +66,11 @@ private:
|
||||
bool checkBinaries(QString &wgetBin, QString &gpgvBin);
|
||||
bool checkFileHash(const QString &filePath, const char *expectedHash);
|
||||
|
||||
const SysinfoModel *const m_sysinfo;
|
||||
|
||||
bool m_firstShow;
|
||||
bool m_success;
|
||||
const QString m_binDir;
|
||||
|
||||
QMovie *m_animator;
|
||||
UpdateCheckThread *m_thread;
|
||||
unsigned long m_updaterProcess;
|
||||
|
@ -325,6 +325,7 @@ copy /Y "$(QTDIR)\plugins\imageformats\qgif4.dll" "$(TargetDir)\imageformats"
|
||||
<ClInclude Include="src\model_preferences.h" />
|
||||
<ClInclude Include="src\model_recently.h" />
|
||||
<ClInclude Include="src\model_status.h" />
|
||||
<ClInclude Include="src\model_sysinfo.h" />
|
||||
<ClInclude Include="src\targetver.h" />
|
||||
<ClInclude Include="src\taskbar7.h" />
|
||||
<CustomBuild Include="src\thread_avisynth.h">
|
||||
|
@ -78,6 +78,9 @@
|
||||
<ClInclude Include="src\cli.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\model_sysinfo.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\main.cpp">
|
||||
|
Loading…
Reference in New Issue
Block a user