cache: improved code flow

This commit is contained in:
itsmattkc
2021-09-23 00:16:05 -07:00
parent e101f3f4fe
commit 0b205ece9c
8 changed files with 55 additions and 95 deletions
+4 -4
View File
@@ -136,7 +136,7 @@ void SequenceDialog::accept()
sequence_->SetVideoParams(video_params);
sequence_->SetAudioParams(audio_params);
sequence_->SetLabel(name_field_->text());
sequence_->SetAutoCacheEnabled(parameter_tab_->GetSelectedPreviewAutoCache());
sequence_->SetVideoAutoCacheEnabled(parameter_tab_->GetSelectedPreviewAutoCache());
}
QDialog::accept();
@@ -171,7 +171,7 @@ SequenceDialog::SequenceParamCommand::SequenceParamCommand(Sequence* s,
old_video_params_(s->GetVideoParams()),
old_audio_params_(s->GetAudioParams()),
old_name_(s->GetLabel()),
old_autocache_(s->GetAutoCacheEnabled())
old_autocache_(s->GetVideoAutoCacheEnabled())
{
}
@@ -189,7 +189,7 @@ void SequenceDialog::SequenceParamCommand::redo()
sequence_->SetAudioParams(new_audio_params_);
}
sequence_->SetLabel(new_name_);
sequence_->SetAutoCacheEnabled(new_autocache_);
sequence_->SetVideoAutoCacheEnabled(new_autocache_);
}
void SequenceDialog::SequenceParamCommand::undo()
@@ -201,7 +201,7 @@ void SequenceDialog::SequenceParamCommand::undo()
sequence_->SetAudioParams(old_audio_params_);
}
sequence_->SetLabel(old_name_);
sequence_->SetAutoCacheEnabled(old_autocache_);
sequence_->SetVideoAutoCacheEnabled(old_autocache_);
}
}
@@ -54,7 +54,7 @@ SequenceDialogParameterTab::SequenceDialogParameterTab(Sequence* sequence, QWidg
preview_layout->addWidget(preview_resolution_label_, row, 2);
row++;
preview_layout->addWidget(new QLabel(tr("Quality:")), row, 0);
preview_format_field_ = new PixelFormatComboBox(false);
preview_format_field_ = new PixelFormatComboBox(true);
preview_layout->addWidget(preview_format_field_, row, 1, 1, 2);
row++;
preview_layout->addWidget(new QLabel(tr("Auto-Cache:")), row, 0);
@@ -68,7 +68,7 @@ SequenceDialogParameterTab::SequenceDialogParameterTab(Sequence* sequence, QWidg
video_section_->SetVideoParams(vp);
preview_resolution_field_->SetDivider(vp.divider());
preview_format_field_->SetPixelFormat(vp.format());
preview_autocache_field_->setChecked(sequence->GetAutoCacheEnabled());
preview_autocache_field_->setChecked(sequence->GetVideoAutoCacheEnabled());
audio_sample_rate_field_->SetSampleRate(ap.sample_rate());
audio_channels_field_->SetChannelLayout(ap.channel_layout());