From bb35ba421ed4267fbab8a22cca537965718146e6 Mon Sep 17 00:00:00 2001 From: "Simon A. Eugster" Date: Sat, 21 Aug 2010 08:09:25 +0000 Subject: [PATCH] Frame rate: Also show fields per second (frame rate * 2 for interlaced) to avoid confusion. svn path=/trunk/kdenlive/; revision=4741 --- src/profilesdialog.cpp | 21 ++- src/projectsettings.cpp | 8 +- src/widgets/profiledialog_ui.ui | 263 +++++++++++++++++--------------- 3 files changed, 158 insertions(+), 134 deletions(-) diff --git a/src/profilesdialog.cpp b/src/profilesdialog.cpp index 3a8d559a..fdd1ec41 100644 --- a/src/profilesdialog.cpp +++ b/src/profilesdialog.cpp @@ -72,7 +72,7 @@ void ProfilesDialog::slotProfileEdited() void ProfilesDialog::fillList(const QString selectedProfile) { - // List the Mlt profiles + // List the Mlt profiles m_view.profiles_list->clear(); QMap profilesInfo = ProfilesDialog::getProfilesInfo(); QMapIterator i(profilesInfo); @@ -196,7 +196,7 @@ MltVideoProfile ProfilesDialog::getVideoProfile(QString name) if (name.contains('/')) isCustom = true; if (!isCustom) { - // List the Mlt profiles + // List the Mlt profiles profilesFiles = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files); if (profilesFiles.contains(name)) path = KdenliveSettings::mltpath() + name; } @@ -206,7 +206,7 @@ MltVideoProfile ProfilesDialog::getVideoProfile(QString name) if (path.isEmpty() || !QFile::exists(path)) { if (name == "dv_pal") { - kDebug() << "!!! WARNING, COULD NOT FIND DEFAULT MLT PROFILE"; + kDebug() << "!!! WARNING, COULD NOT FIND DEFAULT MLT PROFILE"; return result; } if (name == KdenliveSettings::default_profile()) KdenliveSettings::setDefault_profile("dv_pal"); @@ -249,7 +249,7 @@ bool ProfilesDialog::existingProfileDescription(const QString &desc) QStringList profilesFilter; profilesFilter << "*"; - // List the Mlt profiles + // List the Mlt profiles QStringList profilesFiles = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files); for (int i = 0; i < profilesFiles.size(); ++i) { KConfig confFile(KdenliveSettings::mltpath() + profilesFiles.at(i), KConfig::SimpleConfig); @@ -275,7 +275,7 @@ QString ProfilesDialog::existingProfile(MltVideoProfile profile) QStringList profilesFilter; profilesFilter << "*"; - // Check the Mlt profiles + // Check the Mlt profiles QStringList profilesFiles = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files); for (int i = 0; i < profilesFiles.size(); ++i) { KConfig confFile(KdenliveSettings::mltpath() + profilesFiles.at(i), KConfig::SimpleConfig); @@ -319,7 +319,7 @@ QMap ProfilesDialog::getProfilesInfo() QStringList profilesFilter; profilesFilter << "*"; - // List the Mlt profiles + // List the Mlt profiles QStringList profilesFiles = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files); for (int i = 0; i < profilesFiles.size(); ++i) { KConfig confFile(KdenliveSettings::mltpath() + profilesFiles.at(i), KConfig::SimpleConfig); @@ -367,7 +367,7 @@ QMap< QString, QString > ProfilesDialog::getSettingsForProfile(const QString pro QStringList profilesFilter; profilesFilter << "*"; - // List the Mlt profiles + // List the Mlt profiles profilesFiles = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files); for (int i = 0; i < profilesFiles.size(); ++i) { KConfig confFile(KdenliveSettings::mltpath() + profilesFiles.at(i), KConfig::SimpleConfig); @@ -402,7 +402,7 @@ QString ProfilesDialog::getPathFromDescription(const QString profileDesc) QStringList profilesFilter; profilesFilter << "*"; - // List the Mlt profiles + // List the Mlt profiles profilesFiles = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files); for (int i = 0; i < profilesFiles.size(); ++i) { KConfig confFile(KdenliveSettings::mltpath() + profilesFiles.at(i), KConfig::SimpleConfig); @@ -476,6 +476,11 @@ void ProfilesDialog::slotUpdateDisplay() m_view.frame_num->setValue(values.value("frame_rate_num").toInt()); m_view.frame_den->setValue(values.value("frame_rate_den").toInt()); m_view.progressive->setChecked(values.value("progressive").toInt()); + if (values.value("progressive").toInt()) { + m_view.fields->setText(QString::number((double)values.value("frame_rate_num").toInt()/values.value("frame_rate_den").toInt(), 'f', 2)); + } else { + m_view.fields->setText(QString::number((double)2*values.value("frame_rate_num").toInt()/values.value("frame_rate_den").toInt(), 'f', 2)); + } m_profileIsModified = false; } diff --git a/src/projectsettings.cpp b/src/projectsettings.cpp index 9891810f..fdfdb832 100644 --- a/src/projectsettings.cpp +++ b/src/projectsettings.cpp @@ -196,8 +196,12 @@ void ProjectSettings::slotUpdateDisplay() p_fps->setText(values.value("frame_rate_num") + '/' + values.value("frame_rate_den")); p_aspect->setText(values.value("sample_aspect_num") + '/' + values.value("sample_aspect_den")); p_display->setText(values.value("display_aspect_num") + '/' + values.value("display_aspect_den")); - if (values.value("progressive").toInt() == 0) p_progressive->setText(i18n("Interlaced")); - else p_progressive->setText(i18n("Progressive")); + 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))); + } else { + p_progressive->setText(i18n("Progressive")); + } } void ProjectSettings::slotUpdateButton(const QString &path) diff --git a/src/widgets/profiledialog_ui.ui b/src/widgets/profiledialog_ui.ui index 0d90c8dd..5a385c85 100644 --- a/src/widgets/profiledialog_ui.ui +++ b/src/widgets/profiledialog_ui.ui @@ -1,7 +1,8 @@ - + + ProfilesDialog_UI - - + + 0 0 @@ -9,26 +10,26 @@ 332 - + Profiles - - - - + + + + Profile - - + + - - - + + + Qt::Horizontal - + 40 20 @@ -36,163 +37,156 @@ - - - + + + Properties - - - - + + + + Description - - + + - - - - Size - - - - - - + + + 10000 - - - - + + + + 0 0 - + x - - - + + + 10000 - - - + + + Frame rate - - - + + + 500000 - - - - + + + + 0 0 - + / - - - + + + 10000 - - - + + + Pixel aspect ratio - - + + - - - - + + + + 0 0 - + / - - + + - - - + + + Display aspect ratio - - - + + + 10000 - - - - + + + + 0 0 - + / - - - + + + 10000 - - - + + + Progressive - - - + + + Qt::Vertical - + 105 17 @@ -200,22 +194,43 @@ + + + + Size + + + + + + + Fields per second + + + + + + + interl: 2*fps + + + - - - + + + Use as default - - - + + + Qt::Horizontal - + 40 20 @@ -223,39 +238,39 @@ - - - + + + Qt::Horizontal - + QDialogButtonBox::Ok - - - + + + C - - - + + + false - + S - - - + + + false - + D @@ -263,6 +278,16 @@ + + KPushButton + QPushButton +
kpushbutton.h
+
+ + KLineEdit + QLineEdit +
klineedit.h
+
KComboBox QComboBox @@ -273,16 +298,6 @@ QSpinBox
knuminput.h
- - KLineEdit - QLineEdit -
klineedit.h
-
- - KPushButton - QPushButton -
kpushbutton.h
-
@@ -292,11 +307,11 @@ ProfilesDialog_UI accept() - + 248 254 - + 157 274 @@ -308,11 +323,11 @@ ProfilesDialog_UI reject() - + 316 260 - + 286 274 -- 2.39.2