diff --git a/src/model_options.cpp b/src/model_options.cpp index 49d4067..cf80c9a 100644 --- a/src/model_options.cpp +++ b/src/model_options.cpp @@ -22,6 +22,7 @@ #include "model_options.h" #include "global.h" +#include "model_sysinfo.h" #include #include @@ -32,10 +33,10 @@ #define COMPARE_STR(OTHER, NAME) ((this->NAME).compare((model->NAME), Qt::CaseInsensitive) == 0) #define ASSIGN_FROM(OTHER, NAME) ((this->NAME) = (OTHER.NAME)) -OptionsModel::OptionsModel(void) +OptionsModel::OptionsModel(const SysinfoModel *sysinfo) { m_encoderType = EncType_X264; - m_encoderArch = EncArch_x32; + m_encoderArch = sysinfo->hasX64Support() ? EncArch_x64 : EncArch_x32; m_encoderVariant = EncVariant_LoBit; m_rcMode = RCMode_CRF; m_bitrate = 1200; @@ -189,7 +190,7 @@ bool OptionsModel::loadTemplate(OptionsModel *model, const QString &name) return complete; } -QMap OptionsModel::loadAllTemplates(void) +QMap OptionsModel::loadAllTemplates(const SysinfoModel *sysinfo) { QMap list; const QString appDir = x264_data_path(); @@ -201,7 +202,7 @@ QMap OptionsModel::loadAllTemplates(void) QString name = allTemplates.takeFirst(); if(!(name.contains('<') || name.contains('>') || name.contains('\\') || name.contains('/'))) { - OptionsModel *options = new OptionsModel(); + OptionsModel *options = new OptionsModel(sysinfo); if(loadTemplate(options, name)) { list.insert(name, options); diff --git a/src/model_options.h b/src/model_options.h index 72583c5..34826f0 100644 --- a/src/model_options.h +++ b/src/model_options.h @@ -25,10 +25,12 @@ #include #include +class SysinfoModel; + class OptionsModel { public: - OptionsModel(void); + OptionsModel(const SysinfoModel *sysinfo); OptionsModel(const OptionsModel &rhs); ~OptionsModel(void); @@ -91,7 +93,7 @@ public: static QString rcMode2String(RCMode mode); static bool saveTemplate(OptionsModel *model, const QString &name); static bool loadTemplate(OptionsModel *model, const QString &name); - static QMap loadAllTemplates(void); + static QMap loadAllTemplates(const SysinfoModel *sysinfo); static bool templateExists(const QString &name); static bool deleteTemplate(const QString &name); diff --git a/src/version.h b/src/version.h index f231f5a..396aeb2 100644 --- a/src/version.h +++ b/src/version.h @@ -26,7 +26,7 @@ #define VER_X264_MAJOR 2 #define VER_X264_MINOR 3 #define VER_X264_PATCH 1 -#define VER_X264_BUILD 771 +#define VER_X264_BUILD 772 #define VER_X264_MINIMUM_REV 2380 #define VER_X264_CURRENT_API 142 diff --git a/src/win_addJob.cpp b/src/win_addJob.cpp index 4a8ac0e..a444018 100644 --- a/src/win_addJob.cpp +++ b/src/win_addJob.cpp @@ -229,7 +229,7 @@ AddJobDialog::AddJobDialog(QWidget *parent, OptionsModel *const options, Recentl m_recentlyUsed(recentlyUsed), m_sysinfo(sysinfo), m_preferences(preferences), - m_defaults(new OptionsModel()), + m_defaults(new OptionsModel(sysinfo)), ui(new Ui::AddJobDialog()) { //Init the dialog, from the .ui file @@ -356,7 +356,7 @@ bool AddJobDialog::eventFilter(QObject *o, QEvent *e) { if((o == ui->labelHelpScreenX264) && (e->type() == QEvent::MouseButtonPress)) { - OptionsModel options; saveOptions(&options); + OptionsModel options(m_sysinfo); saveOptions(&options); HelpDialog *helpScreen = new HelpDialog(this, false, m_sysinfo, &options, m_preferences); helpScreen->exec(); X264_DELETE(helpScreen); @@ -612,7 +612,7 @@ void AddJobDialog::saveTemplateButtonClicked(void) name = tr("New Template (%1)").arg(QString::number(n++)); } - OptionsModel *options = new OptionsModel(); + OptionsModel *options = new OptionsModel(m_sysinfo); saveOptions(options); if(options->equals(m_defaults)) @@ -832,7 +832,7 @@ void AddJobDialog::loadTemplateList(void) ui->cbxTemplate->addItem(tr(""), QVariant::fromValue(m_defaults)); ui->cbxTemplate->setCurrentIndex(0); - QMap templates = OptionsModel::loadAllTemplates(); + QMap templates = OptionsModel::loadAllTemplates(m_sysinfo); QStringList templateNames = templates.keys(); templateNames.sort(); diff --git a/src/win_main.cpp b/src/win_main.cpp index 6056c40..73d99b1 100644 --- a/src/win_main.cpp +++ b/src/win_main.cpp @@ -111,7 +111,7 @@ MainWindow::MainWindow(const x264_cpu_t *const cpuFeatures, IPC *ipc) RecentlyUsed::loadRecentlyUsed(m_recentlyUsed); //Create options object - m_options = new OptionsModel(); + m_options = new OptionsModel(m_sysinfo); OptionsModel::loadTemplate(m_options, QString::fromLatin1(tpl_last)); //Freeze minimum size @@ -1060,7 +1060,7 @@ void MainWindow::handleCommand(const int &command, const QStringList &args, cons { if(QFileInfo(args[0]).exists() && QFileInfo(args[0]).isFile()) { - OptionsModel options; + OptionsModel options(m_sysinfo); bool runImmediately = (countRunningJobs() < (m_preferences->getAutoRunNextJob() ? m_preferences->getMaxRunningJobCount() : 1)); if(!(args[2].isEmpty() || X264_STRCMP(args[2], "-"))) {