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
61a3d1e3
Commit
61a3d1e3
authored
Feb 26, 2020
by
Jean-Baptiste Mardelle
Browse files
Improve some effect focus cases, fix compile warning
parent
2bcd6e07
Pipeline
#15677
passed with stage
in 14 minutes and 1 second
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/assets/keyframes/model/keyframemodellist.cpp
View file @
61a3d1e3
...
...
@@ -205,20 +205,6 @@ bool KeyframeModelList::updateKeyframe(GenTime pos, const QVariant &value, const
pCore
->
pushUndo
(
command
);
}
return
true
;
QWriteLocker
locker
(
&
m_lock
);
Q_ASSERT
(
m_parameters
.
count
(
index
)
>
0
);
Fun
undo
=
[]()
{
return
true
;
};
Fun
redo
=
[]()
{
return
true
;
};
if
(
singleKeyframe
())
{
bool
ok
=
false
;
Keyframe
kf
=
m_parameters
.
begin
()
->
second
->
getNextKeyframe
(
GenTime
(
-
1
),
&
ok
);
pos
=
kf
.
first
;
}
bool
res
=
m_parameters
.
at
(
index
)
->
updateKeyframe
(
pos
,
value
,
undo
,
redo
);
if
(
res
)
{
PUSH_UNDO
(
undo
,
redo
,
i18n
(
"Update keyframe"
));
}
return
res
;
}
bool
KeyframeModelList
::
updateKeyframeType
(
GenTime
pos
,
int
type
,
const
QPersistentModelIndex
&
index
)
...
...
src/assets/keyframes/view/keyframeview.cpp
View file @
61a3d1e3
...
...
@@ -106,6 +106,7 @@ void KeyframeView::slotAddRemove()
}
else
{
slotAddKeyframe
(
m_position
);
}
emit
activateEffect
();
}
void
KeyframeView
::
slotEditType
(
int
type
,
const
QPersistentModelIndex
&
index
)
...
...
@@ -149,6 +150,7 @@ void KeyframeView::slotGoToNext()
// no keyframe after current position
emit
seekToPos
(
m_duration
-
1
);
}
emit
activateEffect
();
}
void
KeyframeView
::
slotGoToPrev
()
...
...
@@ -167,6 +169,7 @@ void KeyframeView::slotGoToPrev()
// no keyframe after current position
emit
seekToPos
(
m_duration
-
1
);
}
emit
activateEffect
();
}
void
KeyframeView
::
mousePressEvent
(
QMouseEvent
*
event
)
...
...
src/assets/view/widgets/keyframewidget.cpp
View file @
61a3d1e3
...
...
@@ -207,6 +207,7 @@ void KeyframeWidget::slotEditKeyframeType(QAction *action)
{
int
type
=
action
->
data
().
toInt
();
m_keyframeview
->
slotEditType
(
type
,
m_index
);
activateEffect
();
}
void
KeyframeWidget
::
slotRefreshParams
()
...
...
@@ -354,7 +355,9 @@ void KeyframeWidget::addParameter(const QPersistentModelIndex &index)
GeometryWidget
*
geomWidget
=
new
GeometryWidget
(
pCore
->
getMonitor
(
m_model
->
monitorId
),
range
,
rect
,
opacity
,
m_sourceFrameSize
,
false
,
m_model
->
data
(
m_index
,
AssetParameterModel
::
OpacityRole
).
toBool
(),
integerOpacity
,
this
);
connect
(
geomWidget
,
&
GeometryWidget
::
valueChanged
,
[
this
,
index
](
const
QString
v
)
{
m_keyframes
->
updateKeyframe
(
GenTime
(
getPosition
(),
pCore
->
getCurrentFps
()),
QVariant
(
v
),
index
);
});
[
this
,
index
](
const
QString
v
)
{
activateEffect
();
m_keyframes
->
updateKeyframe
(
GenTime
(
getPosition
(),
pCore
->
getCurrentFps
()),
QVariant
(
v
),
index
);
});
paramWidget
=
geomWidget
;
}
else
if
(
type
==
ParamType
::
Roto_spline
)
{
m_monitorHelper
=
new
RotoHelper
(
pCore
->
getMonitor
(
m_model
->
monitorId
),
m_model
,
index
,
this
);
...
...
@@ -386,7 +389,10 @@ void KeyframeWidget::addParameter(const QPersistentModelIndex &index)
factor
=
qFuzzyIsNull
(
factor
)
?
1
:
factor
;
auto
doubleWidget
=
new
DoubleWidget
(
name
,
value
,
min
,
max
,
factor
,
defaultValue
,
comment
,
-
1
,
suffix
,
decimals
,
m_model
->
data
(
index
,
AssetParameterModel
::
OddRole
).
toBool
(),
this
);
connect
(
doubleWidget
,
&
DoubleWidget
::
valueChanged
,
[
this
,
index
](
double
v
)
{
m_keyframes
->
updateKeyframe
(
GenTime
(
getPosition
(),
pCore
->
getCurrentFps
()),
QVariant
(
v
),
index
);
});
[
this
,
index
](
double
v
)
{
activateEffect
();
m_keyframes
->
updateKeyframe
(
GenTime
(
getPosition
(),
pCore
->
getCurrentFps
()),
QVariant
(
v
),
index
);
});
paramWidget
=
doubleWidget
;
}
if
(
paramWidget
)
{
...
...
@@ -430,6 +436,7 @@ void KeyframeWidget::connectMonitor(bool active)
void
KeyframeWidget
::
slotUpdateKeyframesFromMonitor
(
const
QPersistentModelIndex
&
index
,
const
QVariant
&
res
)
{
activateEffect
();
if
(
m_keyframes
->
isEmpty
())
{
GenTime
pos
(
pCore
->
getItemIn
(
m_model
->
getOwnerId
())
+
m_time
->
getValue
(),
pCore
->
getCurrentFps
());
if
(
m_time
->
getValue
()
>
0
)
{
...
...
src/effects/effectstack/view/collapsibleeffectview.cpp
View file @
61a3d1e3
...
...
@@ -398,6 +398,7 @@ void CollapsibleEffectView::slotDisable(bool disable)
QString
effectId
=
m_model
->
getAssetId
();
QString
effectName
=
EffectsRepository
::
get
()
->
getName
(
effectId
);
std
::
static_pointer_cast
<
AbstractEffectItem
>
(
m_model
)
->
markEnabled
(
effectName
,
!
disable
);
emit
activateEffect
(
m_model
);
}
void
CollapsibleEffectView
::
slotDeleteEffect
()
...
...
@@ -727,7 +728,6 @@ void CollapsibleEffectView::dropEvent(QDropEvent *event)
if
(
event
->
source
()
->
objectName
()
==
QStringLiteral
(
"ParameterContainer"
))
{
return
;
}
// emit activateEffect(effectIndex());
QString
itemData
=
event
->
mimeData
()
->
data
(
QStringLiteral
(
"kdenlive/geometry"
));
importKeyframes
(
itemData
);
return
;
...
...
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