Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
67407928
Commit
67407928
authored
Feb 11, 2020
by
Jean-Baptiste Mardelle
Browse files
Fix clip fades cannot be inserted after undoing
parent
2c04791c
Pipeline
#14847
passed with stage
in 16 minutes and 38 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/assets/model/assetparametermodel.cpp
View file @
67407928
...
...
@@ -89,6 +89,9 @@ AssetParameterModel::AssetParameterModel(std::unique_ptr<Mlt::Properties> asset,
QVariant
defaultValue
=
parseAttribute
(
m_ownerId
,
QStringLiteral
(
"default"
),
currentParameter
);
value
=
defaultValue
.
type
()
==
QVariant
::
Double
?
locale
.
toString
(
defaultValue
.
toDouble
())
:
defaultValue
.
toString
();
}
if
(
value
.
isEmpty
())
{
continue
;
}
bool
isFixed
=
(
type
==
QLatin1String
(
"fixed"
));
if
(
isFixed
)
{
m_fixedParams
[
name
]
=
value
;
...
...
src/effects/effectstack/model/effectstackmodel.cpp
View file @
67407928
...
...
@@ -418,6 +418,8 @@ bool EffectStackModel::copyEffect(const std::shared_ptr<AbstractEffectItem> &sou
bool
EffectStackModel
::
appendEffect
(
const
QString
&
effectId
,
bool
makeCurrent
)
{
QWriteLocker
locker
(
&
m_lock
);
std
::
unordered_set
<
int
>
previousFadeIn
=
m_fadeIns
;
std
::
unordered_set
<
int
>
previousFadeOut
=
m_fadeOuts
;
auto
effect
=
EffectItemModel
::
construct
(
effectId
,
shared_from_this
());
PlaylistState
::
ClipState
state
=
pCore
->
getItemState
(
m_ownerId
);
if
(
effect
->
isAudio
())
{
...
...
@@ -473,9 +475,23 @@ bool EffectStackModel::appendEffect(const QString &effectId, bool makeCurrent)
emit
dataChanged
(
QModelIndex
(),
QModelIndex
(),
roles
);
return
true
;
};
Fun
update_undo
=
[
this
,
inFades
,
outFades
,
previousFadeIn
,
previousFadeOut
]()
{
// TODO: only update if effect is fade or keyframe
QVector
<
int
>
roles
=
{
TimelineModel
::
EffectNamesRole
};
if
(
inFades
>
0
)
{
m_fadeIns
=
previousFadeIn
;
roles
<<
TimelineModel
::
FadeInRole
;
}
else
if
(
outFades
>
0
)
{
m_fadeOuts
=
previousFadeOut
;
roles
<<
TimelineModel
::
FadeOutRole
;
}
pCore
->
updateItemKeyframes
(
m_ownerId
);
emit
dataChanged
(
QModelIndex
(),
QModelIndex
(),
roles
);
return
true
;
};
update
();
PUSH_LAMBDA
(
update
,
redo
);
PUSH_LAMBDA
(
update
,
undo
);
PUSH_LAMBDA
(
update
_undo
,
undo
);
PUSH_UNDO
(
undo
,
redo
,
i18n
(
"Add effect %1"
,
EffectsRepository
::
get
()
->
getName
(
effectId
)));
}
else
if
(
makeCurrent
)
{
if
(
auto
srvPtr
=
m_masterService
.
lock
())
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment