From cab38b5e90c53666001ece0abc9bd98a2799ab2c Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Tue, 26 Mar 2019 22:48:26 +1100 Subject: [PATCH] added option to always use originals rather than proxies on export --- dialogs/exportdialog.cpp | 2 +- dialogs/preferencesdialog.cpp | 16 +++++++++++++--- global/config.cpp | 7 ++++++- global/config.h | 5 +++++ rendering/cacher.cpp | 4 +++- 5 files changed, 28 insertions(+), 6 deletions(-) diff --git a/dialogs/exportdialog.cpp b/dialogs/exportdialog.cpp index 4b36513f9..b667ef3d3 100644 --- a/dialogs/exportdialog.cpp +++ b/dialogs/exportdialog.cpp @@ -658,7 +658,7 @@ void ExportDialog::comp_type_changed(int) { break; case COMPRESSION_TYPE_CFR: videoBitrateLabel->setText(tr("Quality (CRF):")); - videobitrateSpinbox->setValue(36); + videobitrateSpinbox->setValue(23); videobitrateSpinbox->setMaximum(51); videobitrateSpinbox->setToolTip(tr("Quality Factor:\n\n0 = lossless\n17-18 = visually lossless (compressed, but unnoticeable)\n23 = high quality\n51 = lowest quality possible")); break; diff --git a/dialogs/preferencesdialog.cpp b/dialogs/preferencesdialog.cpp index ca1a85ebb..8a23b3275 100644 --- a/dialogs/preferencesdialog.cpp +++ b/dialogs/preferencesdialog.cpp @@ -778,17 +778,27 @@ void PreferencesDialog::setup_ui() { row++; + QHBoxLayout* misc_general = new QHBoxLayout(); + // General -> Use Software Fallbacks When Possible QCheckBox* use_software_fallbacks_checkbox = new QCheckBox(tr("Use Software Fallbacks When Possible")); AddBoolPair(use_software_fallbacks_checkbox, &olive::CurrentConfig.use_software_fallback, true); - general_layout->addWidget(use_software_fallbacks_checkbox, row, 0, 1, 4); + misc_general->addWidget(use_software_fallbacks_checkbox); - row++; + // General -> Don't Use Proxies When Exporting + QCheckBox* dont_use_proxies_when_exporting = new QCheckBox(tr("Don't Use Proxies When Exporting")); + dont_use_proxies_when_exporting->setToolTip(tr("Use originals instead of proxies when exporting")); + AddBoolPair(dont_use_proxies_when_exporting, &olive::CurrentConfig.dont_use_proxies_on_export); + misc_general->addWidget(dont_use_proxies_when_exporting); // General -> Default Sequence Settings QPushButton* default_sequence_settings = new QPushButton(tr("Default Sequence Settings")); connect(default_sequence_settings, SIGNAL(clicked(bool)), this, SLOT(edit_default_sequence_settings())); - general_layout->addWidget(default_sequence_settings); + misc_general->addWidget(default_sequence_settings); + + general_layout->addLayout(misc_general, row, 0, 1, 5); + + row++; tabWidget->addTab(general_tab, tr("General")); diff --git a/global/config.cpp b/global/config.cpp index 760fb789a..aaaaa7987 100644 --- a/global/config.cpp +++ b/global/config.cpp @@ -81,7 +81,8 @@ Config::Config() default_sequence_audio_frequency(48000), default_sequence_audio_channel_layout(3), playback_bit_depth(olive::PIX_FMT_RGBA16F), - export_bit_depth(olive::PIX_FMT_RGBA32F) + export_bit_depth(olive::PIX_FMT_RGBA32F), + dont_use_proxies_on_export(true) {} void Config::load(QString path) { @@ -254,6 +255,9 @@ void Config::load(QString path) { } else if (stream.name() == "ExportBitDepth") { stream.readNext(); export_bit_depth = stream.text().toInt(); + } else if (stream.name() == "DontUseProxiesOnExport") { + stream.readNext(); + dont_use_proxies_on_export = (stream.text() == "1"); } } } @@ -332,6 +336,7 @@ void Config::save(QString path) { stream.writeTextElement("DefaultSequenceAudioLayout", QString::number(default_sequence_audio_channel_layout)); stream.writeTextElement("PlaybackBitDepth", QString::number(playback_bit_depth)); stream.writeTextElement("ExportBitDepth", QString::number(export_bit_depth)); + stream.writeTextElement("DontUseProxiesOnExport", QString::number(dont_use_proxies_on_export)); stream.writeEndElement(); // configuration stream.writeEndDocument(); // doc diff --git a/global/config.h b/global/config.h index 2f9ebd9e6..ef5372b16 100644 --- a/global/config.h +++ b/global/config.h @@ -603,6 +603,11 @@ struct Config { */ int export_bit_depth; + /** + * @brief Don't use proxies on export (use originals instead) + */ + bool dont_use_proxies_on_export; + /** * @brief Load config from file * diff --git a/rendering/cacher.cpp b/rendering/cacher.cpp index 917f79b6f..e56915bee 100644 --- a/rendering/cacher.cpp +++ b/rendering/cacher.cpp @@ -39,6 +39,7 @@ #include "rendering/renderfunctions.h" #include "global/timing.h" #include "global/config.h" +#include "global/global.h" #include "global/debug.h" #include "ui/mainwindow.h" @@ -888,7 +889,8 @@ void Cacher::OpenWorker() { QByteArray ba; // do we have a proxy? - if (m->proxy + if ((!olive::Global->is_exporting() || !olive::CurrentConfig.dont_use_proxies_on_export) + && m->proxy && !m->proxy_path.isEmpty() && QFileInfo::exists(m->proxy_path)) { ba = m->proxy_path.toUtf8();