[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 <jb () kdenlive ! org>
Date: 2016-12-07 23:11:09
Message-ID: E1cElMj-0008Lo-U6 () code ! kde ! org
[Download RAW message or body]
Git commit 1c4d36900a9a50f2e8276c4f6bf7747464765c38 by Jean-Baptiste Mardelle.
Committed on 07/12/2016 at 23:09.
Pushed by mardelle into branch 'master'.
Merge branch '16.12'
M +2 -2 src/effectstack/widgets/animationwidget.cpp
M +2 -1 src/mltcontroller/effectscontroller.cpp
M +1 -1 src/timeline/abstractclipitem.cpp
M +14 -12 src/timeline/customtrackview.cpp
M +39 -21 src/timeline/keyframeview.cpp
M +1 -0 src/timeline/keyframeview.h
https://commits.kde.org/kdenlive/1c4d36900a9a50f2e8276c4f6bf7747464765c38
diff --cc src/effectstack/widgets/animationwidget.cpp
index 8e31f7eae,f290c6561..6da89ca46
--- a/src/effectstack/widgets/animationwidget.cpp
+++ b/src/effectstack/widgets/animationwidget.cpp
@@@ -728,13 -711,13 +728,13 @@@ void AnimationWidget::buildSliderWidget
double factor = e.hasAttribute(QStringLiteral("factor")) ? \
locale.toDouble(e.attribute(QStringLiteral("factor"))) : 1;
DoubleParameterWidget *doubleparam = new DoubleParameterWidget(paramName, 0,
- \
e.attribute(QStringLiteral("min")).toDouble(), \
e.attribute(QStringLiteral("max")).toDouble(),
- \
e.attribute(QStringLiteral("default")).toDouble() * factor, comment, index, \
e.attribute(QStringLiteral("suffix")), \
e.attribute(QStringLiteral("decimals")).toInt(), true, this); + \
e.attribute(QStringLiteral("min")).toDouble(), \
e.attribute(QStringLiteral("max")).toDouble(), + \
e.attribute(QStringLiteral("default")).toDouble() * factor, comment, index, \
e.attribute(QStringLiteral("suffix")), \
e.attribute(QStringLiteral("decimals")).toInt(), true, this); \
doubleparam->setObjectName(paramTag); doubleparam->factor = factor;
- connect(doubleparam, SIGNAL(valueChanged(double)), this, \
SLOT(slotAdjustKeyframeValue(double))); + connect(doubleparam, \
&DoubleParameterWidget::valueChanged, this, \
&AnimationWidget::slotAdjustKeyframeValue); layout()->addWidget(doubleparam);
- if (!e.hasAttribute(QStringLiteral("intimeline")) || \
e.attribute(QStringLiteral("intimeline")) == QLatin1String("1")) { + if \
((!e.hasAttribute(QStringLiteral("intimeline")) || \
e.attribute(QStringLiteral("intimeline")) == QLatin1String("1")) && \
!e.hasAttribute(QStringLiteral("notintimeline"))) { \
doubleparam->setInTimelineProperty(true); doubleparam->setChecked(true);
m_inTimeline = paramTag;
diff --cc src/mltcontroller/effectscontroller.cpp
index 18f4da1a2,a63366e77..772ac90ae
--- a/src/mltcontroller/effectscontroller.cpp
+++ b/src/mltcontroller/effectscontroller.cpp
@@@ -302,8 -273,9 +302,9 @@@ void EffectsController::initEffect(cons
bool hasValue = e.hasAttribute(QStringLiteral("value"));
// Check if this effect has a variable parameter, init effects default \
value
if ((type == QLatin1String("animatedrect") || type == \
QLatin1String("geometry")) && !hasValue) {
- QString kfr = \
AnimationWidget::getDefaultKeyframes(info.cropStart.frames(fps), \
e.attribute(QStringLiteral("default")), type == QLatin1String("geometry")); + \
int pos = type == QLatin1String("geometry") ? 0 : info.cropStart.frames(fps); + \
QString kfr = AnimationWidget::getDefaultKeyframes(pos, \
e.attribute(QStringLiteral("default")), type == \
QLatin1String("geometry"));
- if (kfr.contains("%")) {
+ if (kfr.contains(QLatin1String("%"))) {
kfr = EffectsController::getStringRectEval(pInfo, kfr);
}
e.setAttribute(QStringLiteral("value"), kfr);
diff --cc src/timeline/abstractclipitem.cpp
index 561ff2d46,7d51cd5fa..166496699
--- a/src/timeline/abstractclipitem.cpp
+++ b/src/timeline/abstractclipitem.cpp
@@@ -514,11 -479,9 +514,11 @@@ void AbstractClipItem::movedKeyframe(QD
int end = (cropStart() + cropDuration()).frames(m_fps) - 1;
for (int i = 0; i < params.count(); ++i) {
QDomElement e = params.item(i).toElement();
- if (e.isNull()) continue;
+ if (e.isNull()) {
+ continue;
+ }
QString paramName = e.attribute(QStringLiteral("name"));
- if (e.attribute(QStringLiteral("type")) == QLatin1String("animated")) {
+ if (e.attribute(QStringLiteral("type")).startsWith(QLatin1String("animated"))) \
{ if (m_keyframeView.activeParam(paramName)) {
// inserting a keyframe touches all animated params
for (int j = 0; j < params.count(); ++j) {
diff --cc src/timeline/customtrackview.cpp
index f501f8bef,19939d439..b44dd8aac
--- a/src/timeline/customtrackview.cpp
+++ b/src/timeline/customtrackview.cpp
@@@ -7285,25 -6834,24 +7285,25 @@@ void CustomTrackView::splitAudio(bool w
if (!info.isValid()) {
// Operate on current selection
selection = scene()->selectedItems();
- destTrack = m_timeline->audioTarget;
if (selection.isEmpty()) {
emit displayMessage(i18n("You must select at least one clip for this \
action"), ErrorMessage);
- if (!hasMasterCommand)
+ if (!hasMasterCommand) {
delete masterCommand;
+ }
return;
}
- } else {
- new SplitAudioCommand(this, info.track, destTrack, info.startPos, \
masterCommand);
- }
- for (int i = 0; i < selection.count(); ++i) {
- if (selection.at(i)->type() == AVWidget) {
- ClipItem *clip = static_cast <ClipItem *>(selection.at(i));
- if (clip->clipType() == AV || clip->clipType() == Playlist) {
- if (clip->parentItem()) {
- emit displayMessage(i18n("Cannot split audio of grouped \
clips"), ErrorMessage);
- } else {
- new SplitAudioCommand(this, clip->track(), destTrack, \
clip->startPos(), masterCommand); + if (KdenliveSettings::splitaudio()) {
+ destTrack = m_timeline->audioTarget;
+ }
+ for (int i = 0; i < selection.count(); ++i) {
+ if (selection.at(i)->type() == AVWidget) {
+ ClipItem *clip = static_cast <ClipItem *>(selection.at(i));
+ if (clip->clipType() == AV || clip->clipType() == Playlist) {
+ if (clip->parentItem()) {
+ emit displayMessage(i18n("Cannot split audio of grouped \
clips"), ErrorMessage); + } else {
+ new SplitAudioCommand(this, clip->track(), destTrack, \
clip->startPos(), masterCommand); + }
}
}
}
diff --cc src/timeline/keyframeview.cpp
index 37b3dcdab,84777d428..334542855
--- a/src/timeline/keyframeview.cpp
+++ b/src/timeline/keyframeview.cpp
@@@ -75,11 -72,10 +75,11 @@@ QPointF KeyframeView::keyframePoint(con
br.bottom() - br.height() * (value * factor - min) / (max - \
min)); }
-void KeyframeView::drawKeyFrames(QRectF br, int length, bool active, QPainter \
*painter, const QTransform &transformation) +void KeyframeView::drawKeyFrames(const \
QRectF &br, int length, bool active, QPainter *painter, const QTransform \
&transformation) {
- if (duration == 0 || m_keyframeType == NoKeyframe || !m_keyAnim.is_valid() || \
m_keyAnim.key_count() < 1) {
- if (duration == 0 || m_inTimeline.isEmpty() || m_keyframeType == NoKeyframe || \
!m_keyAnim.is_valid() || m_keyAnim.key_count() < 1) ++ if (duration == 0 || \
m_inTimeline.isEmpty() || m_keyframeType == NoKeyframe || !m_keyAnim.is_valid() || \
m_keyAnim.key_count() < 1) { return;
+ }
duration = length;
//m_keyAnim.set_length(length);
painter->save();
@@@ -862,10 -846,11 +870,11 @@@ bool KeyframeView::loadKeyframes(const
m_keyframeType = NoKeyframe;
duration = length;
m_inTimeline.clear();
+ m_notInTimeline.clear();
// reset existing properties
int max = m_keyProperties.count();
- for (int i = max -1; i >= 0; i--) {
- m_keyProperties.set(m_keyProperties.get_name(i), (char*) NULL);
+ for (int i = max - 1; i >= 0; i--) {
+ m_keyProperties.set(m_keyProperties.get_name(i), (char *) Q_NULLPTR);
}
attachToEnd = -2;
m_useOffset = effect.attribute(QStringLiteral("kdenlive:sync_in_out")) != \
QLatin1String("1"); @@@ -898,14 -876,23 +900,28 @@@
info.factor = 1;
}
m_paramInfos.insert(paramName, info);
- if (!e.hasAttribute(QStringLiteral("intimeline")) || \
e.attribute(QStringLiteral("intimeline")) == QLatin1String("1")) {
- // Active parameter
- m_keyframeMin = info.min;
- m_keyframeMax = info.max;
- m_keyframeDefault = locale.toDouble(info.defaultValue);
- m_keyframeFactor = info.factor;
- attachToEnd = \
checkNegatives(e.attribute(QStringLiteral("value")).toUtf8().constData(), duration - \
m_offset);
- m_inTimeline = paramName;
+ if (e.hasAttribute(QStringLiteral("notintimeline"))) {
+ // This param should not be drawn in timeline
+ m_notInTimeline << paramName;
+ } else {
- if (type == QLatin1String("keyframe")) m_keyframeType = NormalKeyframe;
- else if (type == QLatin1String("simplekeyframe")) m_keyframeType = \
SimpleKeyframe;
- else if (type == QLatin1String("geometry") || type == \
QLatin1String("animatedrect")) m_keyframeType = GeometryKeyframe;
- else if (type == QLatin1String("animated")) m_keyframeType = \
AnimatedKeyframe; ++ if (type == QLatin1String("keyframe")) {
++ m_keyframeType = NormalKeyframe;
++ } else if (type == QLatin1String("simplekeyframe")) {
++ m_keyframeType = SimpleKeyframe;
++ } else if (type == QLatin1String("geometry") || type == \
QLatin1String("animatedrect")) { ++ m_keyframeType = GeometryKeyframe;
++ } else if (type == QLatin1String("animated")) {
++ m_keyframeType = AnimatedKeyframe;
++ }
+ if (!e.hasAttribute(QStringLiteral("intimeline")) || \
e.attribute(QStringLiteral("intimeline")) == QLatin1String("1")) { + \
// Active parameter + m_keyframeMin = info.min;
+ m_keyframeMax = info.max;
+ m_keyframeDefault = locale.toDouble(info.defaultValue);
+ m_keyframeFactor = info.factor;
- attachToEnd = \
checkNegatives(e.attribute("value").toUtf8().constData(), duration - m_offset); ++ \
attachToEnd = checkNegatives(e.attribute(QStringLiteral("value")).toUtf8().constData(), \
duration - m_offset); + m_inTimeline = paramName;
+ }
}
// parse keyframes
QString value = e.attribute(QStringLiteral("value"));
@@@ -938,9 -923,8 +954,9 @@@
void KeyframeView::setOffset(int frames)
{
- if (!m_keyAnim.is_valid()) {
- if (duration == 0 || !m_keyAnim.is_valid())
++ if (duration == 0 || !m_keyAnim.is_valid()) {
return;
+ }
if (m_keyAnim.is_key(-m_offset)) {
mlt_keyframe_type type = m_keyAnim.keyframe_type(-m_offset);
double value = \
m_keyProperties.anim_get_double(m_inTimeline.toUtf8().constData(), -m_offset, \
duration - m_offset); @@@ -990,11 -974,13 +1006,13 @@@ void KeyframeView::reset(
duration = 0;
attachToEnd = -2;
activeKeyframe = -1;
+ m_inTimeline.clear();
+ m_notInTimeline.clear();
int max = m_keyProperties.count();
- for (int i = max -1; i >= 0; i--) {
- m_keyProperties.set(m_keyProperties.get_name(i), (char*) NULL);
+ for (int i = max - 1; i >= 0; i--) {
+ m_keyProperties.set(m_keyProperties.get_name(i), (char *) Q_NULLPTR);
}
- emit updateKeyframes();
+ emit updateKeyframes();
}
//static
diff --cc src/timeline/keyframeview.h
index d3deebfb3,34b4e7212..0db983f91
--- a/src/timeline/keyframeview.h
+++ b/src/timeline/keyframeview.h
@@@ -120,11 -120,12 +120,12 @@@ private
int m_handleSize;
bool m_useOffset;
int m_offset;
+ QStringList m_notInTimeline;
- double keyframeUnmap(QRectF br, double y);
- double keyframeMap(QRectF br, double value);
- QPointF keyframeMap(QRectF br, int frame, double value);
- QPointF keyframePoint(QRectF br, int index);
- QPointF keyframePoint(QRectF br, int frame, double value, double factor, double \
min, double max); + double keyframeUnmap(const QRectF &br, double y);
+ double keyframeMap(const QRectF &br, double value);
+ QPointF keyframeMap(const QRectF &br, int frame, double value);
+ QPointF keyframePoint(const QRectF &br, int index);
+ QPointF keyframePoint(const QRectF &br, int frame, double value, double factor, \
double min, double max); struct ParameterInfo {
double factor;
double min;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic