implemented color management UI functionality in the ExportDialog

Frontend UI work in setting up color management when exporting.
This commit is contained in:
itsmattkc
2019-12-16 16:47:36 +11:00
parent 377e2316be
commit cb5a468b4a
4 changed files with 127 additions and 5 deletions
+27 -2
View File
@@ -4,6 +4,7 @@
#include <QFileDialog>
#include <QHBoxLayout>
#include <QLabel>
#include <QProgressBar>
#include <QPushButton>
#include <QScrollArea>
#include <QSplitter>
@@ -93,6 +94,13 @@ ExportDialog::ExportDialog(ViewerOutput *viewer_node, QWidget *parent) :
row++;
QProgressBar* progress_bar = new QProgressBar();
progress_bar->setEnabled(false);
progress_bar->setValue(0);
preferences_layout->addWidget(progress_bar, row, 0, 1, 4);
row++;
QDialogButtonBox* buttons = new QDialogButtonBox();
buttons->setCenterButtons(true);
buttons->addButton(tr("Export"), QDialogButtonBox::AcceptRole);
@@ -136,6 +144,15 @@ ExportDialog::ExportDialog(ViewerOutput *viewer_node, QWidget *parent) :
connect(video_tab_->width_slider(), SIGNAL(ValueChanged(int64_t)), this, SLOT(ResolutionChanged()));
connect(video_tab_->height_slider(), SIGNAL(ValueChanged(int64_t)), this, SLOT(ResolutionChanged()));
connect(video_tab_->maintain_aspect_checkbox(), SIGNAL(toggled(bool)), this, SLOT(ResolutionChanged()));
connect(video_tab_->codec_combobox(), SIGNAL(currentIndexChanged(int)), this, SLOT(VideoCodecChanged()));
connect(video_tab_, SIGNAL(DisplayChanged(const QString&)), preview_viewer_, SLOT(SetOCIODisplay(const QString&)));
connect(video_tab_, SIGNAL(ViewChanged(const QString&)), preview_viewer_, SLOT(SetOCIOView(const QString&)));
connect(video_tab_, SIGNAL(LookChanged(const QString&)), preview_viewer_, SLOT(SetOCIOLook(const QString&)));
// Set viewer to view the node
preview_viewer_->ConnectViewerNode(viewer_node_);
preview_viewer_->SetColorMenuEnabled(false);
preview_viewer_->SetOCIOParameters(video_tab_->CurrentOCIODisplay(), video_tab_->CurrentOCIOView(), video_tab_->CurrentOCIOLook());
}
void ExportDialog::BrowseFilename()
@@ -174,12 +191,13 @@ void ExportDialog::FormatChanged(int index)
// Update video and audio comboboxes
video_tab_->codec_combobox()->clear();
foreach (int vcodec, current_format.video_codecs()) {
video_tab_->codec_combobox()->addItem(codecs_.at(vcodec).name());
video_tab_->codec_combobox()->addItem(codecs_.at(vcodec).name(), vcodec);
}
VideoCodecChanged();
audio_tab_->codec_combobox()->clear();
foreach (int acodec, current_format.audio_codecs()) {
audio_tab_->codec_combobox()->addItem(codecs_.at(acodec).name());
audio_tab_->codec_combobox()->addItem(codecs_.at(acodec).name(), acodec);
}
}
@@ -201,6 +219,13 @@ void ExportDialog::ResolutionChanged()
}
}
void ExportDialog::VideoCodecChanged()
{
const ExportCodec& codec = codecs_.at(video_tab_->codec_combobox()->currentData().toInt());
video_tab_->show_image_sequence_section(codec.flags() & ExportCodec::kStillImage);
}
void ExportDialog::SetUpFormats()
{
// Set up codecs