colormanager: implement default config
This commit is contained in:
@@ -308,7 +308,7 @@ void ExportDialog::accept()
|
||||
|
||||
AudioRenderingParams audio_render_params(audio_tab_->sample_rate_combobox()->currentData().toInt(),
|
||||
audio_tab_->channel_layout_combobox()->currentData().toULongLong(),
|
||||
SampleFormat::GetConfiguredFormatForMode(render_mode));
|
||||
SampleFormat::kInternalFormat);
|
||||
|
||||
ColorProcessorPtr color_processor = ColorProcessor::Create(color_manager_,
|
||||
color_manager_->GetReferenceColorSpace(),
|
||||
|
||||
@@ -55,7 +55,7 @@ VideoStreamProperties::VideoStreamProperties(ImageStreamPtr stream) :
|
||||
video_color_space_->addItem(colorspace);
|
||||
}
|
||||
|
||||
video_color_space_->setCurrentText(stream_->colorspace());
|
||||
video_color_space_->setCurrentText(stream_->colorspace(false));
|
||||
|
||||
video_layout->addWidget(video_color_space_, row, 1);
|
||||
|
||||
|
||||
@@ -50,13 +50,11 @@ PreferencesQualityTab::PreferencesQualityTab()
|
||||
|
||||
offline_group_ = new PreferencesQualityGroup(tr("Offline Quality"));
|
||||
offline_group_->bit_depth_combobox()->setCurrentIndex(PixelFormat::instance()->GetConfiguredFormatForMode(RenderMode::kOffline));
|
||||
offline_group_->sample_fmt_combobox()->setCurrentIndex(SampleFormat::GetConfiguredFormatForMode(RenderMode::kOffline));
|
||||
offline_group_->ocio_method()->setCurrentIndex(ColorManager::GetOCIOMethodForMode(RenderMode::kOffline));
|
||||
quality_stack_->addWidget(offline_group_);
|
||||
|
||||
online_group_ = new PreferencesQualityGroup(tr("Online Quality"));
|
||||
online_group_->bit_depth_combobox()->setCurrentIndex(PixelFormat::instance()->GetConfiguredFormatForMode(RenderMode::kOnline));
|
||||
online_group_->sample_fmt_combobox()->setCurrentIndex(SampleFormat::GetConfiguredFormatForMode(RenderMode::kOnline));
|
||||
online_group_->ocio_method()->setCurrentIndex(ColorManager::GetOCIOMethodForMode(RenderMode::kOnline));
|
||||
quality_stack_->addWidget(online_group_);
|
||||
|
||||
@@ -71,8 +69,6 @@ void PreferencesQualityTab::Accept()
|
||||
ColorManager::SetOCIOMethodForMode(RenderMode::kOnline, static_cast<ColorManager::OCIOMethod>(online_group_->ocio_method()->currentIndex()));
|
||||
PixelFormat::instance()->SetConfiguredFormatForMode(RenderMode::kOffline, static_cast<PixelFormat::Format>(offline_group_->bit_depth_combobox()->currentData().toInt()));
|
||||
PixelFormat::instance()->SetConfiguredFormatForMode(RenderMode::kOnline, static_cast<PixelFormat::Format>(online_group_->bit_depth_combobox()->currentData().toInt()));
|
||||
SampleFormat::SetConfiguredFormatForMode(RenderMode::kOffline, static_cast<SampleFormat::Format>(offline_group_->sample_fmt_combobox()->currentData().toInt()));
|
||||
SampleFormat::SetConfiguredFormatForMode(RenderMode::kOnline, static_cast<SampleFormat::Format>(online_group_->sample_fmt_combobox()->currentData().toInt()));
|
||||
}
|
||||
|
||||
PreferencesQualityGroup::PreferencesQualityGroup(const QString &title, QWidget *parent) :
|
||||
@@ -113,24 +109,6 @@ PreferencesQualityGroup::PreferencesQualityGroup(const QString &title, QWidget *
|
||||
ocio_method_->addItem(tr("Accurate"));
|
||||
video_layout->addWidget(ocio_method_, row, 1);
|
||||
|
||||
row = 0;
|
||||
|
||||
QGroupBox* audio_group = new QGroupBox(tr("Audio"));
|
||||
|
||||
QGridLayout* audio_layout = new QGridLayout(audio_group);
|
||||
quality_outer_layout->addWidget(audio_group);
|
||||
|
||||
audio_layout->addWidget(new QLabel(tr("Sample Format:")), row, 0);
|
||||
|
||||
sample_fmt_combobox_ = new QComboBox();
|
||||
|
||||
for (int i=0;i<SampleFormat::SAMPLE_FMT_COUNT;i++) {
|
||||
sample_fmt_combobox_->addItem(SampleFormat::GetSampleFormatName(static_cast<SampleFormat::Format>(i)),
|
||||
i);
|
||||
}
|
||||
|
||||
audio_layout->addWidget(sample_fmt_combobox_, row, 1);
|
||||
|
||||
quality_outer_layout->addStretch();
|
||||
}
|
||||
|
||||
@@ -144,9 +122,4 @@ QComboBox *PreferencesQualityGroup::ocio_method()
|
||||
return ocio_method_;
|
||||
}
|
||||
|
||||
QComboBox *PreferencesQualityGroup::sample_fmt_combobox()
|
||||
{
|
||||
return sample_fmt_combobox_;
|
||||
}
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
@@ -40,15 +40,11 @@ public:
|
||||
|
||||
QComboBox* ocio_method();
|
||||
|
||||
QComboBox* sample_fmt_combobox();
|
||||
|
||||
private:
|
||||
QComboBox* bit_depth_combobox_;
|
||||
|
||||
QComboBox* ocio_method_;
|
||||
|
||||
QComboBox* sample_fmt_combobox_;
|
||||
|
||||
};
|
||||
|
||||
class PreferencesQualityTab : public PreferencesTab
|
||||
|
||||
@@ -54,6 +54,7 @@ ProjectPropertiesDialog::ProjectPropertiesDialog(Project* p, QWidget *parent) :
|
||||
color_layout->addWidget(new QLabel(tr("OpenColorIO Configuration:")), row, 0);
|
||||
|
||||
ocio_filename_ = new QLineEdit();
|
||||
ocio_filename_->setPlaceholderText(tr("(default)"));
|
||||
color_layout->addWidget(ocio_filename_, row, 1);
|
||||
|
||||
row++;
|
||||
@@ -86,7 +87,7 @@ ProjectPropertiesDialog::ProjectPropertiesDialog(Project* p, QWidget *parent) :
|
||||
}
|
||||
|
||||
ocio_filename_->setText(working_project_->color_manager()->GetConfigFilename());
|
||||
ListPossibleInputSpaces(working_project_->color_manager()->GetConfigFilename());
|
||||
ListPossibleInputSpaces(working_project_->color_manager()->GetConfig());
|
||||
}
|
||||
|
||||
void ProjectPropertiesDialog::accept()
|
||||
@@ -120,12 +121,12 @@ bool ProjectPropertiesDialog::VerifyOCIOConfig(const QString &fn)
|
||||
}
|
||||
}
|
||||
|
||||
void ProjectPropertiesDialog::ListPossibleInputSpaces(const QString& fn)
|
||||
void ProjectPropertiesDialog::ListPossibleInputSpaces(OCIO::ConstConfigRcPtr config)
|
||||
{
|
||||
try {
|
||||
default_input_colorspace_->clear();
|
||||
|
||||
QStringList input_cs = ColorManager::ListAvailableInputColorspaces(OCIO::Config::CreateFromFile(fn.toUtf8()));
|
||||
QStringList input_cs = ColorManager::ListAvailableInputColorspaces(config);
|
||||
|
||||
foreach (QString cs, input_cs) {
|
||||
default_input_colorspace_->addItem(cs);
|
||||
@@ -145,7 +146,7 @@ void ProjectPropertiesDialog::BrowseForOCIOConfig()
|
||||
if (VerifyOCIOConfig(fn)) {
|
||||
ocio_filename_->setText(fn);
|
||||
|
||||
ListPossibleInputSpaces(fn);
|
||||
ListPossibleInputSpaces(OCIO::Config::CreateFromFile(fn.toUtf8()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public slots:
|
||||
private:
|
||||
bool VerifyOCIOConfig(const QString& fn);
|
||||
|
||||
void ListPossibleInputSpaces(const QString &fn);
|
||||
void ListPossibleInputSpaces(OpenColorIO::v1::ConstConfigRcPtr config);
|
||||
|
||||
Project* working_project_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user