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
761393e4
Commit
761393e4
authored
Aug 28, 2020
by
Jean-Baptiste Mardelle
Browse files
Fix some corruption in same track composition
parent
604b8507
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/timeline2/model/timelinemodel.cpp
View file @
761393e4
...
...
@@ -615,15 +615,13 @@ bool TimelineModel::requestClipMove(int clipId, int trackId, int position, bool
std
::
pair
<
int
,
int
>
mixData
=
getTrackById_const
(
old_trackId
)
->
getMixInfo
(
clipId
);
int
offset
=
position
-
mixData
.
first
;
qDebug
()
<<
"==== MIX UPDATED: "
<<
mixData
.
second
<<
", OFFSET: "
<<
offset
;
if
(
finalMove
&&
(
old_trackId
!=
trackId
||
position
>=
mixData
.
first
+
mixData
.
second
)
)
{;
if
(
old_trackId
!=
trackId
||
position
>=
mixData
.
first
+
mixData
.
second
)
{;
// Clip moved to another track, or outside of mix duration, delete mix
move_mix
=
[
this
,
old_trackId
,
clipId
]()
{
qDebug
()
<<
"======
\n
RESETTING SUB PLAYLIST
\n
===="
;
m_allClips
[
clipId
]
->
setSubPlaylistIndex
(
0
);
return
getTrackById_const
(
old_trackId
)
->
deleteMix
(
clipId
);
};
restore_mix
=
[
this
,
old_trackId
,
clipId
,
mixData
]()
{
m_allClips
[
clipId
]
->
setSubPlaylistIndex
(
1
);
return
getTrackById_const
(
old_trackId
)
->
createMix
(
clipId
,
mixData
);
};
qDebug
()
<<
"========
\n\n\n
DELETED MIX
\n\n
================"
;
...
...
src/timeline2/model/trackmodel.cpp
View file @
761393e4
...
...
@@ -136,6 +136,9 @@ Fun TrackModel::requestClipInsertion_lambda(int clipId, int position, bool updat
if
(
auto
ptr
=
m_parent
.
lock
())
{
Q_ASSERT
(
ptr
->
getClipPtr
(
clipId
)
->
getCurrentTrackId
()
==
-
1
);
target_playlist
=
ptr
->
getClipPtr
(
clipId
)
->
getSubPlaylistIndex
();
if
(
target_playlist
==
1
&&
ptr
->
getClipPtr
(
clipId
)
->
getMixDuration
()
==
0
)
{
target_playlist
=
0
;
}
qDebug
()
<<
"==== GOT TRARGET PLAYLIST: "
<<
target_playlist
;
}
else
{
qDebug
()
<<
"impossible to get parent timeline"
;
...
...
@@ -1371,6 +1374,7 @@ bool TrackModel::requestClipMix(int clipId, int position, bool updateView, bool
std
::
shared_ptr
<
ClipModel
>
movedClip
(
ptr
->
getClipPtr
(
clipId
));
source_track
=
movedClip
->
getSubPlaylistIndex
();
clipInitialPos
=
movedClip
->
getPosition
();
movedClip
->
setMixDuration
(
mixInfo
.
mixDuration
);
mixInfo
.
mixDuration
=
clipInitialPos
-
position
;
mixInfo
.
mixPosition
=
position
;
}
else
{
...
...
Write
Preview
Markdown
is supported
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