Skip to content

Commit 9087ef7

Browse files
committed
show BT.2020 colorspace in a few more places
1 parent 88f4fcc commit 9087ef7

File tree

4 files changed

+35
-6
lines changed

4 files changed

+35
-6
lines changed

src/dialogs/customprofiledialog.cpp

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013-2024 Meltytech, LLC
2+
* Copyright (c) 2013-2025 Meltytech, LLC
33
*
44
* This program is free software: you can redistribute it and/or modify
55
* it under the terms of the GNU General Public License as published by
@@ -38,7 +38,17 @@ CustomProfileDialog::CustomProfileDialog(QWidget *parent)
3838
ui->aspectDenSpinner->setValue(MLT.profile().display_aspect_den());
3939
ui->fpsSpinner->setValue(MLT.profile().fps());
4040
ui->scanModeCombo->setCurrentIndex(MLT.profile().progressive());
41-
ui->colorspaceCombo->setCurrentIndex(MLT.profile().colorspace() == 709);
41+
switch (MLT.profile().colorspace()) {
42+
case 601:
43+
ui->colorspaceCombo->setCurrentIndex(0);
44+
break;
45+
case 2020:
46+
ui->colorspaceCombo->setCurrentIndex(2);
47+
break;
48+
default:
49+
ui->colorspaceCombo->setCurrentIndex(1);
50+
break;
51+
}
4252
}
4353

4454
CustomProfileDialog::~CustomProfileDialog()
@@ -69,7 +79,17 @@ void CustomProfileDialog::on_buttonBox_accepted()
6979
Util::normalizeFrameRate(ui->fpsSpinner->value(), numerator, denominator);
7080
MLT.profile().set_frame_rate(numerator, denominator);
7181
MLT.profile().set_progressive(ui->scanModeCombo->currentIndex());
72-
MLT.profile().set_colorspace((ui->colorspaceCombo->currentIndex() == 1) ? 709 : 601);
82+
switch (ui->colorspaceCombo->currentIndex()) {
83+
case 0:
84+
MLT.profile().set_colorspace(601);
85+
break;
86+
case 2:
87+
MLT.profile().set_colorspace(2020);
88+
break;
89+
default:
90+
MLT.profile().set_colorspace(709);
91+
break;
92+
}
7393
MLT.updatePreviewProfile();
7494
MLT.setPreviewScale(Settings.playerPreviewScale());
7595

src/dialogs/customprofiledialog.ui

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@
5353
<string notr="true">ITU-R BT.709</string>
5454
</property>
5555
</item>
56+
<item>
57+
<property name="text">
58+
<string>ITU-R BT.2020</string>
59+
</property>
60+
</item>
5661
</widget>
5762
</item>
5863
<item>

src/widgets/mltclipproducerwidget.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024 Meltytech, LLC
2+
* Copyright (c) 2024-2025 Meltytech, LLC
33
*
44
* This program is free software: you can redistribute it and/or modify
55
* it under the terms of the GNU General Public License as published by
@@ -156,8 +156,10 @@ void MltClipProducerWidget::setProducer(Mlt::Producer *p)
156156
int colorspace = m_producer->get_int("meta.media.colorspace");
157157
if (colorspace == 601)
158158
m_colorspaceLabel->setText("ITU-R BT.601");
159-
else if (colorspace)
159+
else if (colorspace == 709)
160160
m_colorspaceLabel->setText("ITU-R BT.709");
161+
else if (colorspace == 2020)
162+
m_colorspaceLabel->setText("ITU-R BT.2020");
161163
else
162164
m_colorspaceLabel->setText("");
163165
m_durationLabel->setText(QString(m_producer->get_length_time(Settings.timeFormat())));

src/widgets/timelinepropertieswidget.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015-2022 Meltytech, LLC
2+
* Copyright (c) 2015-2025 Meltytech, LLC
33
*
44
* This program is free software: you can redistribute it and/or modify
55
* it under the terms of the GNU General Public License as published by
@@ -45,6 +45,8 @@ TimelinePropertiesWidget::TimelinePropertiesWidget(Mlt::Service &service, QWidge
4545
ui->colorspaceLabel->setText("ITU-R BT.601");
4646
else if (profile.colorspace() == 709)
4747
ui->colorspaceLabel->setText("ITU-R BT.709");
48+
else if (profile.colorspace() == 2020)
49+
ui->colorspaceLabel->setText("ITU-R BT.2020");
4850
else
4951
ui->colorspaceLabel->setText("");
5052
}

0 commit comments

Comments
 (0)