Merge branch 'olive-editor:master' into av1
This commit is contained in:
@@ -44,9 +44,10 @@ namespace olive {
|
||||
|
||||
#define super QDialog
|
||||
|
||||
ExportDialog::ExportDialog(ViewerOutput *viewer_node, QWidget *parent) :
|
||||
ExportDialog::ExportDialog(ViewerOutput *viewer_node, bool stills_only_mode, QWidget *parent) :
|
||||
super(parent),
|
||||
viewer_node_(viewer_node)
|
||||
viewer_node_(viewer_node),
|
||||
stills_only_mode_(stills_only_mode)
|
||||
{
|
||||
QHBoxLayout* layout = new QHBoxLayout(this);
|
||||
|
||||
@@ -156,6 +157,30 @@ ExportDialog::ExportDialog(ViewerOutput *viewer_node, QWidget *parent) :
|
||||
|
||||
row++;
|
||||
|
||||
{
|
||||
QGroupBox *options_group = new QGroupBox();
|
||||
preferences_layout->addWidget(options_group, row, 0, 1, 4);
|
||||
|
||||
QGridLayout *options_layout = new QGridLayout(options_group);
|
||||
|
||||
int opt_row = 0;
|
||||
|
||||
export_bkg_box_ = new QCheckBox(tr("Run In Background"));
|
||||
export_bkg_box_->setToolTip(tr("Exporting in the background allows you to continue using Olive while "
|
||||
"exporting, but may result in slower export speeds, and may"
|
||||
"severely impact editing and playback performance."));
|
||||
options_layout->addWidget(export_bkg_box_, opt_row, 0);
|
||||
|
||||
import_file_after_export_ = new QCheckBox(tr("Import Result After Export"));
|
||||
options_layout->addWidget(import_file_after_export_, opt_row, 1);
|
||||
|
||||
connect(export_bkg_box_, &QCheckBox::toggled, import_file_after_export_, [this](bool e){
|
||||
import_file_after_export_->setEnabled(!e);
|
||||
});
|
||||
}
|
||||
|
||||
row++;
|
||||
|
||||
QHBoxLayout *btn_layout = new QHBoxLayout();
|
||||
btn_layout->setMargin(0);
|
||||
preferences_layout->addLayout(btn_layout, row, 0, 1, 4);
|
||||
@@ -170,12 +195,6 @@ ExportDialog::ExportDialog(ViewerOutput *viewer_node, QWidget *parent) :
|
||||
btn_layout->addWidget(cancel_btn);
|
||||
connect(cancel_btn, &QPushButton::clicked, this, &ExportDialog::reject);
|
||||
|
||||
export_bkg_box_ = new QCheckBox(tr("Run In Background"));
|
||||
export_bkg_box_->setToolTip(tr("Exporting in the background allows you to continue using Olive while "
|
||||
"exporting, but may result in slower export speeds, and may"
|
||||
"severely impact editing and playback performance."));
|
||||
btn_layout->addWidget(export_bkg_box_);
|
||||
|
||||
btn_layout->addStretch();
|
||||
|
||||
splitter->addWidget(preferences_area_);
|
||||
@@ -238,7 +257,7 @@ ExportDialog::ExportDialog(ViewerOutput *viewer_node, QWidget *parent) :
|
||||
subtitles_enabled_->setEnabled(has_subtitle_tracks);
|
||||
|
||||
// If the viewer already has cached params, use them
|
||||
if (viewer_node_->GetLastUsedEncodingParams().IsValid()) {
|
||||
if (!stills_only_mode_ && viewer_node_->GetLastUsedEncodingParams().IsValid()) {
|
||||
SetParams(viewer_node_->GetLastUsedEncodingParams());
|
||||
} else {
|
||||
SetDefaults();
|
||||
@@ -370,6 +389,11 @@ void ExportDialog::ExportFinished()
|
||||
// If this task was cancelled, we stay open so the user can potentially queue another export
|
||||
} else {
|
||||
// Accept this dialog and close
|
||||
if (import_file_after_export_) {
|
||||
QString filename = filename_edit_->text().trimmed();
|
||||
emit RequestImportFile(filename);
|
||||
}
|
||||
|
||||
this->accept();
|
||||
}
|
||||
}
|
||||
@@ -572,7 +596,11 @@ bool ExportDialog::SequenceHasSubtitles() const
|
||||
|
||||
void ExportDialog::SetDefaults()
|
||||
{
|
||||
format_combobox_->SetFormat(ExportFormat::kFormatMPEG4Video);
|
||||
if (!stills_only_mode_) {
|
||||
format_combobox_->SetFormat(ExportFormat::kFormatMPEG4Video);
|
||||
} else {
|
||||
format_combobox_->SetFormat(ExportFormat::kFormatPNG);
|
||||
}
|
||||
FormatChanged(format_combobox_->GetFormat());
|
||||
|
||||
VideoParams vp = viewer_node_->GetVideoParams();
|
||||
@@ -745,7 +773,9 @@ void ExportDialog::done(int r)
|
||||
{
|
||||
preview_viewer_->ConnectViewerNode(nullptr);
|
||||
|
||||
viewer_node_->SetLastUsedEncodingParams(GenerateParams());
|
||||
if (!stills_only_mode_) {
|
||||
viewer_node_->SetLastUsedEncodingParams(GenerateParams());
|
||||
}
|
||||
|
||||
super::done(r);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,10 @@ class ExportDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ExportDialog(ViewerOutput* viewer_node, QWidget* parent = nullptr);
|
||||
ExportDialog(ViewerOutput* viewer_node, bool stills_only_mode, QWidget* parent = nullptr);
|
||||
ExportDialog(ViewerOutput* viewer_node, QWidget* parent = nullptr) :
|
||||
ExportDialog(viewer_node, false, parent)
|
||||
{}
|
||||
|
||||
rational GetSelectedTimebase() const;
|
||||
void SetSelectedTimebase(const rational &r);
|
||||
@@ -64,6 +67,9 @@ public:
|
||||
public slots:
|
||||
virtual void done(int r) override;
|
||||
|
||||
signals:
|
||||
void RequestImportFile(const QString &s);
|
||||
|
||||
private:
|
||||
void AddPreferencesTab(QWidget *inner_widget, const QString &title);
|
||||
|
||||
@@ -115,6 +121,9 @@ private:
|
||||
|
||||
QWidget* preferences_area_;
|
||||
QCheckBox *export_bkg_box_;
|
||||
QCheckBox *import_file_after_export_;
|
||||
|
||||
bool stills_only_mode_;
|
||||
|
||||
private slots:
|
||||
void BrowseFilename();
|
||||
|
||||
@@ -159,7 +159,7 @@ void SequenceDialog::accept()
|
||||
sequence_->SetVideoParams(video_params);
|
||||
sequence_->SetAudioParams(audio_params);
|
||||
sequence_->SetLabel(name_field_->text());
|
||||
sequence_->video_frame_cache()->SetEnabled(parameter_tab_->GetSelectedPreviewAutoCache());
|
||||
sequence_->SetVideoAutoCacheEnabled(parameter_tab_->GetSelectedPreviewAutoCache());
|
||||
}
|
||||
|
||||
QDialog::accept();
|
||||
@@ -178,7 +178,6 @@ void SequenceDialog::SetAsDefaultClicked()
|
||||
OLIVE_CONFIG("DefaultSequenceInterlacing") = parameter_tab_->GetSelectedVideoInterlacingMode();
|
||||
OLIVE_CONFIG("DefaultSequenceAudioFrequency") = parameter_tab_->GetSelectedAudioSampleRate();
|
||||
OLIVE_CONFIG("DefaultSequenceAudioLayout") = QVariant::fromValue(parameter_tab_->GetSelectedAudioChannelLayout());
|
||||
OLIVE_CONFIG("DefaultSequenceAutoCache") = QVariant::fromValue(parameter_tab_->GetSelectedPreviewAutoCache());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,7 +193,7 @@ SequenceDialog::SequenceParamCommand::SequenceParamCommand(Sequence* s,
|
||||
old_video_params_(s->GetVideoParams()),
|
||||
old_audio_params_(s->GetAudioParams()),
|
||||
old_name_(s->GetLabel()),
|
||||
old_autocache_(s->video_frame_cache()->IsEnabled())
|
||||
old_autocache_(s->IsVideoAutoCacheEnabled())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -212,7 +211,7 @@ void SequenceDialog::SequenceParamCommand::redo()
|
||||
sequence_->SetAudioParams(new_audio_params_);
|
||||
}
|
||||
sequence_->SetLabel(new_name_);
|
||||
sequence_->video_frame_cache()->SetEnabled(new_autocache_);
|
||||
sequence_->SetVideoAutoCacheEnabled(new_autocache_);
|
||||
}
|
||||
|
||||
void SequenceDialog::SequenceParamCommand::undo()
|
||||
@@ -224,7 +223,7 @@ void SequenceDialog::SequenceParamCommand::undo()
|
||||
sequence_->SetAudioParams(old_audio_params_);
|
||||
}
|
||||
sequence_->SetLabel(old_name_);
|
||||
sequence_->video_frame_cache()->SetEnabled(old_autocache_);
|
||||
sequence_->SetVideoAutoCacheEnabled(old_autocache_);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -73,10 +73,13 @@ SequenceDialogParameterTab::SequenceDialogParameterTab(Sequence* sequence, QWidg
|
||||
preview_layout->addWidget(new QLabel(tr("Quality:")), row, 0);
|
||||
preview_format_field_ = new PixelFormatComboBox(false);
|
||||
preview_layout->addWidget(preview_format_field_, row, 1, 1, 2);
|
||||
|
||||
/* TEMP: Disable sequence auto-cache, wanna see if clip cache supersedes it.
|
||||
row++;
|
||||
preview_layout->addWidget(new QLabel(tr("Auto-Cache:")), row, 0);
|
||||
preview_layout->addWidget(preview_autocache_field_, row, 1);*/
|
||||
preview_autocache_field_ = new QCheckBox();
|
||||
preview_layout->addWidget(preview_autocache_field_, row, 1);
|
||||
|
||||
layout->addWidget(preview_group);
|
||||
|
||||
// Set values based on input sequence
|
||||
@@ -89,7 +92,7 @@ SequenceDialogParameterTab::SequenceDialogParameterTab(Sequence* sequence, QWidg
|
||||
interlacing_combo_->SetInterlaceMode(vp.interlacing());
|
||||
preview_resolution_field_->SetDivider(vp.divider());
|
||||
preview_format_field_->SetPixelFormat(vp.format());
|
||||
preview_autocache_field_->setChecked(sequence->video_frame_cache()->IsEnabled());
|
||||
preview_autocache_field_->setChecked(sequence->IsVideoAutoCacheEnabled());
|
||||
audio_sample_rate_field_->SetSampleRate(ap.sample_rate());
|
||||
audio_channels_field_->SetChannelLayout(ap.channel_layout());
|
||||
|
||||
|
||||
@@ -66,7 +66,9 @@ public:
|
||||
|
||||
bool GetSelectedPreviewAutoCache() const
|
||||
{
|
||||
return preview_autocache_field_->isChecked();
|
||||
//return preview_autocache_field_->isChecked();
|
||||
// TEMP: Disable sequence auto-cache, wanna see if clip cache supersedes it.
|
||||
return false;
|
||||
}
|
||||
|
||||
public slots:
|
||||
|
||||
@@ -101,7 +101,7 @@ QTreeWidgetItem* SequenceDialogPresetTab::CreateFolder(const QString &name)
|
||||
QTreeWidgetItem *SequenceDialogPresetTab::CreateHDPresetFolder(const QString &name, int width, int height, int divider)
|
||||
{
|
||||
const VideoParams::Format default_format = static_cast<VideoParams::Format>(OLIVE_CONFIG("OfflinePixelFormat").toInt());
|
||||
const bool default_autocache = OLIVE_CONFIG("DefaultSequenceAutoCache").toBool();
|
||||
const bool default_autocache = false;
|
||||
QTreeWidgetItem* parent = CreateFolder(name);
|
||||
AddStandardItem(parent, std::make_shared<SequencePreset>(tr("%1 23.976 FPS").arg(name),
|
||||
width,
|
||||
@@ -164,7 +164,7 @@ QTreeWidgetItem *SequenceDialogPresetTab::CreateHDPresetFolder(const QString &na
|
||||
QTreeWidgetItem *SequenceDialogPresetTab::CreateSDPresetFolder(const QString &name, int width, int height, const rational& frame_rate, const rational &standard_par, const rational &wide_par, int divider)
|
||||
{
|
||||
const VideoParams::Format default_format = static_cast<VideoParams::Format>(OLIVE_CONFIG("OfflinePixelFormat").toInt());
|
||||
const bool default_autocache = OLIVE_CONFIG("DefaultSequenceAutoCache").toBool();
|
||||
const bool default_autocache = false;
|
||||
QTreeWidgetItem* parent = CreateFolder(name);
|
||||
preset_tree_->addTopLevelItem(parent);
|
||||
AddStandardItem(parent, std::make_shared<SequencePreset>(tr("%1 Standard").arg(name),
|
||||
|
||||
Reference in New Issue
Block a user