[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdenlive] src: Merge branch '16.12'
From: Jean-Baptiste Mardelle <null () kde ! org>
Date: 2017-01-08 13:11:31
Message-ID: E1cQDFz-0007rg-G0 () code ! kde ! org
[Download RAW message or body]
Git commit 66d9cc77c734f8ab7217c3f839c35ecb7b549e02 by Jean-Baptiste Mardelle.
Committed on 08/01/2017 at 13:11.
Pushed by mardelle into branch 'master'.
Merge branch '16.12'
M +35 -2 src/doc/kdenlivedoc.cpp
M +34 -11 src/effectstack/graphicsscenerectmove.cpp
M +2 -0 src/effectstack/graphicsscenerectmove.h
M +2 -2 src/mltcontroller/clipcontroller.cpp
M +1 -0 src/titler/titledocument.cpp
M +2 -2 src/titler/titlewidget.cpp
https://commits.kde.org/kdenlive/66d9cc77c734f8ab7217c3f839c35ecb7b549e02
diff --cc src/doc/kdenlivedoc.cpp
index cdb5bf1dc,2bfc04e44..370410562
--- a/src/doc/kdenlivedoc.cpp
+++ b/src/doc/kdenlivedoc.cpp
@@@ -1520,11 -1470,9 +1520,11 @@@ void KdenliveDoc::updateProjectProfile(
m_timecode.setFormat(fps);
KdenliveSettings::setCurrent_profile(m_profile.path);
pCore->monitorManager()->resetProfiles(m_profile, m_timecode);
- if (!reloadProducers) return;
+ if (!reloadProducers) {
+ return;
+ }
emit updateFps(fpsChanged);
- if (fpsChanged) {
+ if (fpsChanged != 1.0) {
pCore->bin()->reloadAllProducers();
}
}
@@@ -1605,9 -1552,42 +1605,42 @@@ void KdenliveDoc::switchProfile(MltVide
pCore->bin()->doDisplayMessage(i18n("Switch to clip profile %1?", \
profile.descriptiveString()), KMessageWidget::Information, list); } else {
// No known profile, ask user if he wants to use clip profile anyway
- if (KMessageBox::warningContinueCancel(QApplication::activeWindow(), \
i18n("No profile found for your clip.\nCreate and switch to new profile (%1x%2, \
%3fps)?", profile.width, profile.height, \
QString::number((double)profile.frame_rate_num / profile.frame_rate_den, 'f', 2))) == \
KMessageBox::Continue) { + // Check profile fps so that we don't end up with \
an fps = 30.003 which would mess things up + QString adjustMessage;
+ double fps = (double)profile.frame_rate_num / profile.frame_rate_den;
+ double fps_int;
+ double fps_frac = std::modf(fps, &fps_int);
+ if (fps_frac < 0.4) {
+ profile.frame_rate_num = (int) fps_int;
+ profile.frame_rate_den = 1;
+ } else {
+ // Check for 23.98, 29.97, 59.94
+ if (fps_int == 23.0) {
+ if (qAbs(fps - 23.98) < 0.01) {
+ profile.frame_rate_num = 24000;
+ profile.frame_rate_den = 1001;
+ }
+ } else if (fps_int == 29.0) {
+ if (qAbs(fps - 29.97) < 0.01) {
+ profile.frame_rate_num = 30000;
+ profile.frame_rate_den = 1001;
+ }
+ } else if (fps_int == 59.0) {
+ if (qAbs(fps - 59.94) < 0.01) {
+ profile.frame_rate_num = 60000;
+ profile.frame_rate_den = 1001;
+ }
+ } else {
+ // Unknown profile fps, warn user
+ adjustMessage = i18n("\nWarning: unknown non integer fps, might \
cause incorrect duration display."); + }
+ }
+ if ((double)profile.frame_rate_num / profile.frame_rate_den != fps) {
+ adjustMessage = i18n("\nProfile fps adjusted from original %1", \
QString::number(fps, 'f', 4)); + }
+ if (KMessageBox::warningContinueCancel(QApplication::activeWindow(), \
i18n("No profile found for your clip.\nCreate and switch to new profile (%1x%2, \
%3fps)?%4", profile.width, profile.height, \
QString::number((double)profile.frame_rate_num / profile.frame_rate_den, 'f', 2), \
adjustMessage)) == KMessageBox::Continue) { m_profile = profile;
- m_profile.description = QString("%1x%2 \
%3fps").arg(profile.width).arg(profile.height).arg(QString::number((double)profile.frame_rate_num \
/ profile.frame_rate_den, 'f', 2)); + m_profile.description = \
QStringLiteral("%1x%2 \
%3fps").arg(profile.width).arg(profile.height).arg(QString::number((double)profile.frame_rate_num \
/ profile.frame_rate_den, 'f', 2)); ProfilesDialog::saveProfile(m_profile);
updateProjectProfile(true);
emit docModified(true);
diff --cc src/effectstack/graphicsscenerectmove.cpp
index 985ac9ee0,e0f469bbe..e5107f7d4
--- a/src/effectstack/graphicsscenerectmove.cpp
+++ b/src/effectstack/graphicsscenerectmove.cpp
@@@ -725,11 -721,13 +746,13 @@@ void GraphicsSceneRectMove::mousePressE
}
QGraphicsScene::mousePressEvent(e);
} else if (m_tool == TITLE_RECTANGLE) {
+ clearTextSelection();
m_sceneClickPoint = QPointF(xPos, yPos);
- m_selectedItem = NULL;
+ m_selectedItem = Q_NULLPTR;
e->ignore();
} else if (m_tool == TITLE_TEXT) {
+ clearTextSelection();
- MyTextItem *textItem = new MyTextItem(i18n("Text"), NULL);
+ MyTextItem *textItem = new MyTextItem(i18n("Text"), Q_NULLPTR);
yPos = (((int) e->scenePos().y() - (int)(m_fontSize / 2)) / m_gridSize) * \
m_gridSize; textItem->setPos(xPos, yPos);
addItem(textItem);
diff --cc src/effectstack/graphicsscenerectmove.h
index 498c46bc2,38f1cfef6..99a9cad7d
--- a/src/effectstack/graphicsscenerectmove.h
+++ b/src/effectstack/graphicsscenerectmove.h
@@@ -57,12 -57,13 +57,13 @@@ public
Qt::Alignment alignment() const;
void updateShadow(bool enabled, int blur, int xoffset, int yoffset, QColor \
color); QStringList shadowInfo() const;
- void loadShadow(QStringList info);
- void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *evt);
+ void loadShadow(const QStringList &info);
+ void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *evt) Q_DECL_OVERRIDE;
+ void setTextColor(const QColor &col);
protected:
- virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
- virtual void paint( QPainter *painter, const QStyleOptionGraphicsItem * option, \
QWidget* w); + QVariant itemChange(GraphicsItemChange change, const QVariant \
&value) Q_DECL_OVERRIDE; + void paint(QPainter *painter, const \
QStyleOptionGraphicsItem *option, QWidget *w) Q_DECL_OVERRIDE;
private:
Qt::Alignment m_alignment;
diff --cc src/mltcontroller/clipcontroller.cpp
index 7807193f6,0b2cdb0d1..598cbb040
--- a/src/mltcontroller/clipcontroller.cpp
+++ b/src/mltcontroller/clipcontroller.cpp
@@@ -308,11 -308,11 +308,11 @@@ const QString ClipController::getString
if (m_masterProducer) {
int playtime = m_masterProducer->get_int("kdenlive:duration");
if (playtime > 0) {
- return QString(properties().frames_to_time(playtime, mlt_time_smpte));
+ return QString(m_properties->frames_to_time(playtime, \
mlt_time_smpte_df)); }
- return m_masterProducer->get_length_time(mlt_time_smpte);
+ return m_masterProducer->get_length_time(mlt_time_smpte_df);
}
- return QString(i18n("Unknown"));
+ return i18n("Unknown");
}
GenTime ClipController::getPlaytime() const
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic