int sample_aspect_den;
int display_aspect_num;
int display_aspect_den;
+ int colorspace;
};
public:
CommentedTime(): t(GenTime(0)) {}
CommentedTime(const GenTime time, QString comment)
- : t(time), c(comment) { }
+ : t(time), c(comment) { }
QString comment() const {
return (c.isEmpty() ? i18n("Marker") : c);
{
m_view.setupUi(this);
+ // Fill colorspace list (see mlt_profile.h)
+ m_view.colorspace->addItem(getColorspaceDescription(601), 601);
+ m_view.colorspace->addItem(getColorspaceDescription(709), 709);
+ m_view.colorspace->addItem(getColorspaceDescription(240), 240);
+ m_view.colorspace->addItem(getColorspaceDescription(0), 0);
+
QStringList profilesFilter;
profilesFilter << "*";
return;
}
QTextStream out(&file);
- out << "description=" << m_view.description->text() << "\n" << "frame_rate_num=" << m_view.frame_num->value() << "\n" << "frame_rate_den=" << m_view.frame_den->value() << "\n" << "width=" << m_view.size_w->value() << "\n" << "height=" << m_view.size_h->value() << "\n" << "progressive=" << m_view.progressive->isChecked() << "\n" << "sample_aspect_num=" << m_view.aspect_num->value() << "\n" << "sample_aspect_den=" << m_view.aspect_den->value() << "\n" << "display_aspect_num=" << m_view.display_num->value() << "\n" << "display_aspect_den=" << m_view.display_den->value() << "\n";
+ out << "description=" << m_view.description->text() << "\n" << "frame_rate_num=" << m_view.frame_num->value() << "\n" << "frame_rate_den=" << m_view.frame_den->value() << "\n" << "width=" << m_view.size_w->value() << "\n" << "height=" << m_view.size_h->value() << "\n" << "progressive=" << m_view.progressive->isChecked() << "\n" << "sample_aspect_num=" << m_view.aspect_num->value() << "\n" << "sample_aspect_den=" << m_view.aspect_den->value() << "\n" << "display_aspect_num=" << m_view.display_num->value() << "\n" << "display_aspect_den=" << m_view.display_den->value() << "\n" << "colorspace=" << m_view.colorspace->itemData(m_view.colorspace->currentIndex()).toInt() << "\n";
if (file.error() != QFile::NoError) {
KMessageBox::error(this, i18n("Cannot write to file %1", path));
}
result.sample_aspect_den = confFile.entryMap().value("sample_aspect_den").toInt();
result.display_aspect_num = confFile.entryMap().value("display_aspect_num").toInt();
result.display_aspect_den = confFile.entryMap().value("display_aspect_den").toInt();
+ result.colorspace = confFile.entryMap().value("colorspace").toInt();
return result;
}
if (profile.frame_rate_den != confFile.entryMap().value("frame_rate_den").toInt()) continue;
if (profile.frame_rate_num != confFile.entryMap().value("frame_rate_num").toInt()) continue;
if (profile.progressive != confFile.entryMap().value("progressive").toInt()) continue;
+ if (profile.colorspace != confFile.entryMap().value("colorspace").toInt()) continue;
return profilesFiles.at(i);
}
if (profile.frame_rate_den != confFile.entryMap().value("frame_rate_den").toInt()) continue;
if (profile.frame_rate_num != confFile.entryMap().value("frame_rate_num").toInt()) continue;
if (profile.progressive != confFile.entryMap().value("progressive").toInt()) continue;
+ if (profile.colorspace != confFile.entryMap().value("colorspace").toInt()) continue;
return customProfiles.at(i) + profilesFiles.at(j);
}
}
return;
}
QTextStream out(&file);
- out << "description=" << profile.description << "\n" << "frame_rate_num=" << profile.frame_rate_num << "\n" << "frame_rate_den=" << profile.frame_rate_den << "\n" << "width=" << profile.width << "\n" << "height=" << profile.height << "\n" << "progressive=" << profile.progressive << "\n" << "sample_aspect_num=" << profile.sample_aspect_num << "\n" << "sample_aspect_den=" << profile.sample_aspect_den << "\n" << "display_aspect_num=" << profile.display_aspect_num << "\n" << "display_aspect_den=" << profile.display_aspect_den << "\n";
+ out << "description=" << profile.description << "\n" << "frame_rate_num=" << profile.frame_rate_num << "\n" << "frame_rate_den=" << profile.frame_rate_den << "\n" << "width=" << profile.width << "\n" << "height=" << profile.height << "\n" << "progressive=" << profile.progressive << "\n" << "sample_aspect_num=" << profile.sample_aspect_num << "\n" << "sample_aspect_den=" << profile.sample_aspect_den << "\n" << "display_aspect_num=" << profile.display_aspect_num << "\n" << "display_aspect_den=" << profile.display_aspect_den << "\n" << "colorspace=" << profile.colorspace << "\n";
if (file.error() != QFile::NoError) {
KMessageBox::error(0, i18n("Cannot write to file %1", profilePath));
}
} else {
m_view.fields->setText(QString::number((double) 2 * values.value("frame_rate_num").toInt() / values.value("frame_rate_den").toInt(), 'f', 2));
}
+
+ int colorix = m_view.colorspace->findData(values.value("colorspace").toInt());
+ if (colorix > -1) m_view.colorspace->setCurrentIndex(colorix);
m_profileIsModified = false;
}
+//static
+QString ProfilesDialog::getColorspaceDescription(int colorspace)
+{
+ //TODO: should the descriptions be translated?
+ switch (colorspace) {
+ case 601:
+ return QString("ITU-R 601");
+ case 709:
+ return QString("ITU-R 709");
+ case 240:
+ return QString("SMPTE240M");
+ default:
+ return i18n("Unknown");
+ }
+}
#include "profilesdialog.moc"
* @return the evaluated value */
static double getStringEval(const MltVideoProfile &profile, QString eval);
+ /** @brief Get the descriptive text for given colorspace code (defined by MLT)
+ * @param colorspace An int as defined in mlt_profile.h
+ * @return The string description */
+ static QString getColorspaceDescription(int colorspace);
+
protected:
virtual void closeEvent(QCloseEvent *event);
#include <kmessagebox.h>
ProjectSettings::ProjectSettings(ProjectList *projectlist, QStringList lumas, int videotracks, int audiotracks, const QString projectPath, bool readOnlyTracks, bool savedProject, QWidget * parent) :
- QDialog(parent), m_savedProject(savedProject), m_projectList(projectlist), m_lumas(lumas)
+ QDialog(parent), m_savedProject(savedProject), m_projectList(projectlist), m_lumas(lumas)
{
setupUi(this);
p_display->setText(values.value("display_aspect_num") + '/' + values.value("display_aspect_den"));
if (values.value("progressive").toInt() == 0) {
p_progressive->setText(i18n("Interlaced (%1 fields per second)",
- QString::number((double)2*values.value("frame_rate_num").toInt()/values.value("frame_rate_den").toInt(), 'f', 2)));
+ QString::number((double)2 * values.value("frame_rate_num").toInt() / values.value("frame_rate_den").toInt(), 'f', 2)));
} else {
p_progressive->setText(i18n("Progressive"));
}
+ p_colorspace->setText(ProfilesDialog::getColorspaceDescription(values.value("colorspace").toInt()));
}
void ProjectSettings::slotUpdateButton(const QString &path)
<rect>
<x>0</x>
<y>0</y>
- <width>385</width>
- <height>332</height>
+ <width>334</width>
+ <height>296</height>
</rect>
</property>
<property name="windowTitle">
</property>
</widget>
</item>
- <item row="6" column="0" colspan="4">
- <widget class="QCheckBox" name="progressive">
- <property name="text">
- <string>Progressive</string>
- </property>
- </widget>
- </item>
- <item row="7" column="0" colspan="2">
+ <item row="9" column="0" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
+ <item row="7" column="0">
+ <widget class="QLabel" name="label_12">
+ <property name="text">
+ <string>Colorspace</string>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="1" colspan="3">
+ <widget class="KComboBox" name="colorspace"/>
+ </item>
+ <item row="8" column="0">
+ <widget class="QCheckBox" name="progressive">
+ <property name="text">
+ <string>Progressive</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
+ <customwidget>
+ <class>KIntSpinBox</class>
+ <extends>QSpinBox</extends>
+ <header>knuminput.h</header>
+ </customwidget>
<customwidget>
<class>KPushButton</class>
<extends>QPushButton</extends>
<extends>QComboBox</extends>
<header>kcombobox.h</header>
</customwidget>
- <customwidget>
- <class>KIntSpinBox</class>
- <extends>QSpinBox</extends>
- <header>knuminput.h</header>
- </customwidget>
</customwidgets>
<resources/>
<connections>
<rect>
<x>0</x>
<y>0</y>
- <width>349</width>
+ <width>295</width>
<height>320</height>
</rect>
</property>
<attribute name="title">
<string>Settings</string>
</attribute>
- <layout class="QGridLayout" name="gridLayout_3">
+ <layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<property name="title">
<string>Video Profile</string>
</property>
- <layout class="QGridLayout" name="gridLayout_2">
+ <layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<item row="0" column="1">
<widget class="KComboBox" name="profiles_list"/>
</item>
- <item row="1" column="0" colspan="2">
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="label_5">
- <property name="text">
- <string>Size:</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLabel" name="p_size">
- <property name="text">
- <string>720x576</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QLabel" name="label_3">
- <property name="text">
- <string>Frame rate:</string>
- </property>
- </widget>
- </item>
- <item row="0" column="3">
- <widget class="QLabel" name="p_fps">
- <property name="text">
- <string>25/1</string>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_9">
- <property name="text">
- <string>Pixel aspect ratio:</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QLabel" name="p_aspect">
- <property name="text">
- <string>59/54</string>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QLabel" name="label_10">
- <property name="text">
- <string>Display aspect ratio:</string>
- </property>
- </widget>
- </item>
- <item row="1" column="3">
- <widget class="QLabel" name="p_display">
- <property name="text">
- <string>4/3</string>
- </property>
- </widget>
- </item>
- </layout>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_5">
+ <property name="text">
+ <string>Size:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLabel" name="p_size">
+ <property name="text">
+ <string>720x576</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>Frame rate:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLabel" name="p_fps">
+ <property name="text">
+ <string>25/1</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="label_9">
+ <property name="text">
+ <string>Pixel aspect ratio:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QLabel" name="p_aspect">
+ <property name="text">
+ <string>59/54</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="label_10">
+ <property name="text">
+ <string>Display aspect ratio:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="QLabel" name="p_display">
+ <property name="text">
+ <string>4/3</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0">
+ <widget class="QLabel" name="label_15">
+ <property name="text">
+ <string>Colorspace</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1">
+ <widget class="QLabel" name="p_colorspace">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
</item>
- <item row="2" column="0" colspan="2">
+ <item row="6" column="0" colspan="2">
<widget class="QLabel" name="p_progressive">
<property name="text">
<string>Interlaced</string>
</property>
</widget>
</item>
- <item row="3" column="3" colspan="3">
+ <item row="3" column="3" colspan="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</spacer>
</item>
- <item row="4" column="0" colspan="3">
+ <item row="4" column="0" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>