Skip to content
GitLab
Menu
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
c7d53f8a
Commit
c7d53f8a
authored
Jan 16, 2022
by
Jean-Baptiste Mardelle
Browse files
Time Remap: don't allow keyframe after last frame of source clip
parent
7937551f
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/dialogs/timeremap.cpp
View file @
c7d53f8a
...
...
@@ -190,9 +190,10 @@ void RemapView::setBinClipDuration(std::shared_ptr<ProjectClip> clip, int durati
m_currentKeyframe
=
m_currentKeyframeOriginal
=
{
-
1
,
-
1
};
}
void
RemapView
::
setDuration
(
std
::
shared_ptr
<
Mlt
::
Producer
>
service
,
int
duration
)
void
RemapView
::
setDuration
(
std
::
shared_ptr
<
Mlt
::
Producer
>
service
,
int
duration
,
int
sourceDuration
)
{
m_clip
=
nullptr
;
m_sourceDuration
=
sourceDuration
;
if
(
duration
<
0
)
{
// reset
m_service
=
nullptr
;
...
...
@@ -492,6 +493,13 @@ void RemapView::mouseMoveEvent(QMouseEvent *event)
int
delta
=
realPos
-
m_currentKeyframe
.
second
;
// Check that the move is possible
QMapIterator
<
int
,
int
>
i
(
m_selectedKeyframes
);
while
(
i
.
hasNext
())
{
i
.
next
();
if
(
i
.
value
()
+
delta
>
m_sourceDuration
)
{
return
;
}
}
i
.
toFront
();
QMap
<
int
,
int
>
updated
;
while
(
i
.
hasNext
())
{
i
.
next
();
...
...
@@ -1670,7 +1678,7 @@ void TimeRemap::selectedClip(int cid)
m_in
->
setRange
(
0
,
m_view
->
m_maxLength
-
prod
->
get_in
());
//m_in->setRange(0, m_lastLength - 1);
m_out
->
setRange
(
0
,
INT_MAX
);
m_view
->
setDuration
(
prod
,
m_lastLength
);
m_view
->
setDuration
(
prod
,
m_lastLength
,
prod
->
parent
().
get_length
()
);
qDebug
()
<<
"===== GOT PRODUCER TYPE: "
<<
prod
->
parent
().
type
();
if
(
prod
->
parent
().
type
()
==
mlt_service_chain_type
)
{
Mlt
::
Chain
fromChain
(
prod
->
parent
());
...
...
src/dialogs/timeremap.h
View file @
c7d53f8a
...
...
@@ -35,7 +35,7 @@ public:
friend
class
TimeRemap
;
explicit
RemapView
(
QWidget
*
parent
=
nullptr
);
void
setBinClipDuration
(
std
::
shared_ptr
<
ProjectClip
>
clip
,
int
duration
);
void
setDuration
(
std
::
shared_ptr
<
Mlt
::
Producer
>
service
,
int
duration
);
void
setDuration
(
std
::
shared_ptr
<
Mlt
::
Producer
>
service
,
int
duration
,
int
sourceDuration
=
0
);
void
loadKeyframes
(
const
QString
&
mapData
);
const
QString
getKeyframesData
(
QMap
<
int
,
int
>
keyframes
=
{})
const
;
int
position
()
const
;
...
...
@@ -81,6 +81,7 @@ public slots:
private:
enum
MOVEMODE
{
NoMove
,
TopMove
,
BottomMove
,
CursorMove
,
CursorMoveBottom
};
int
m_duration
;
int
m_sourceDuration
;
int
m_lastMaxDuration
;
int
m_position
;
/** @brief the maximum duration of the parent (bin) clip */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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