Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kdenlive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
259
Issues
259
List
Boards
Labels
Service Desk
Milestones
Merge Requests
14
Merge Requests
14
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
Kdenlive
Commits
1432dd62
Commit
1432dd62
authored
Sep 26, 2020
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix mix deletion when deleting first clip of a mix
parent
dbd4ae02
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
23 deletions
+31
-23
src/timeline2/model/timelinemodel.cpp
src/timeline2/model/timelinemodel.cpp
+9
-11
src/timeline2/model/trackmodel.cpp
src/timeline2/model/trackmodel.cpp
+22
-12
No files found.
src/timeline2/model/timelinemodel.cpp
View file @
1432dd62
...
...
@@ -1715,16 +1715,7 @@ bool TimelineModel::requestItemDeletion(int itemId, Fun &undo, Fun &redo, bool l
return
requestGroupDeletion
(
itemId
,
undo
,
redo
);
}
if
(
isClip
(
itemId
))
{
int
tid
=
m_allClips
[
itemId
]
->
getCurrentTrackId
();
bool
syncMix
=
false
;
if
(
tid
>
-
1
)
{
syncMix
=
getTrackById_const
(
tid
)
->
hasMix
(
itemId
);
}
bool
result
=
requestClipDeletion
(
itemId
,
undo
,
redo
);
if
(
syncMix
)
{
getTrackById_const
(
tid
)
->
syncronizeMixes
(
logUndo
);
}
return
result
;
return
requestClipDeletion
(
itemId
,
undo
,
redo
);
}
if
(
isComposition
(
itemId
))
{
return
requestCompositionDeletion
(
itemId
,
undo
,
redo
);
...
...
@@ -1762,7 +1753,14 @@ bool TimelineModel::requestClipDeletion(int clipId, Fun &undo, Fun &redo)
{
int
trackId
=
getClipTrackId
(
clipId
);
if
(
trackId
!=
-
1
)
{
bool
res
=
getTrackById
(
trackId
)
->
requestClipDeletion
(
clipId
,
true
,
true
,
undo
,
redo
,
false
,
true
);
bool
res
=
true
;
if
(
getTrackById_const
(
trackId
)
->
hasEndMix
(
clipId
))
{
MixInfo
mixData
=
getTrackById_const
(
trackId
)
->
getMixInfo
(
clipId
).
second
;
if
(
isClip
(
mixData
.
secondClipId
))
{
res
=
getTrackById
(
trackId
)
->
requestRemoveMix
({
clipId
,
mixData
.
secondClipId
},
undo
,
redo
);
}
}
res
=
res
&&
getTrackById
(
trackId
)
->
requestClipDeletion
(
clipId
,
true
,
true
,
undo
,
redo
,
false
,
true
);
if
(
!
res
)
{
undo
();
return
false
;
...
...
src/timeline2/model/trackmodel.cpp
View file @
1432dd62
...
...
@@ -1825,12 +1825,17 @@ std::pair<MixInfo, MixInfo> TrackModel::getMixInfo(int clipId) const
startMix
.
firstClipId
=
m_mixList
.
key
(
clipId
,
-
1
);
startMix
.
secondClipId
=
clipId
;
if
(
auto
ptr
=
m_parent
.
lock
())
{
std
::
shared_ptr
<
ClipModel
>
clip1
=
ptr
->
getClipPtr
(
startMix
.
firstClipId
);
std
::
shared_ptr
<
ClipModel
>
clip2
=
ptr
->
getClipPtr
(
startMix
.
secondClipId
);
startMix
.
firstClipInOut
.
first
=
clip1
->
getPosition
();
startMix
.
firstClipInOut
.
second
=
startMix
.
firstClipInOut
.
first
+
clip1
->
getPlaytime
();
startMix
.
secondClipInOut
.
first
=
clip2
->
getPosition
();
startMix
.
secondClipInOut
.
second
=
startMix
.
secondClipInOut
.
first
+
clip2
->
getPlaytime
();
if
(
ptr
->
isClip
(
startMix
.
firstClipId
))
{
std
::
shared_ptr
<
ClipModel
>
clip1
=
ptr
->
getClipPtr
(
startMix
.
firstClipId
);
std
::
shared_ptr
<
ClipModel
>
clip2
=
ptr
->
getClipPtr
(
startMix
.
secondClipId
);
startMix
.
firstClipInOut
.
first
=
clip1
->
getPosition
();
startMix
.
firstClipInOut
.
second
=
startMix
.
firstClipInOut
.
first
+
clip1
->
getPlaytime
();
startMix
.
secondClipInOut
.
first
=
clip2
->
getPosition
();
startMix
.
secondClipInOut
.
second
=
startMix
.
secondClipInOut
.
first
+
clip2
->
getPlaytime
();
}
else
{
// Clip was deleted
startMix
.
firstClipId
=
-
1
;
}
}
}
else
{
startMix
.
firstClipId
=
-
1
;
...
...
@@ -1841,12 +1846,17 @@ std::pair<MixInfo, MixInfo> TrackModel::getMixInfo(int clipId) const
endMix
.
firstClipId
=
clipId
;
endMix
.
secondClipId
=
secondClip
;
if
(
auto
ptr
=
m_parent
.
lock
())
{
std
::
shared_ptr
<
ClipModel
>
clip1
=
ptr
->
getClipPtr
(
endMix
.
firstClipId
);
std
::
shared_ptr
<
ClipModel
>
clip2
=
ptr
->
getClipPtr
(
endMix
.
secondClipId
);
endMix
.
firstClipInOut
.
first
=
clip1
->
getPosition
();
endMix
.
firstClipInOut
.
second
=
endMix
.
firstClipInOut
.
first
+
clip1
->
getPlaytime
();
endMix
.
secondClipInOut
.
first
=
clip2
->
getPosition
();
endMix
.
secondClipInOut
.
second
=
endMix
.
secondClipInOut
.
first
+
clip2
->
getPlaytime
();
if
(
ptr
->
isClip
(
secondClip
))
{
std
::
shared_ptr
<
ClipModel
>
clip1
=
ptr
->
getClipPtr
(
endMix
.
firstClipId
);
std
::
shared_ptr
<
ClipModel
>
clip2
=
ptr
->
getClipPtr
(
endMix
.
secondClipId
);
endMix
.
firstClipInOut
.
first
=
clip1
->
getPosition
();
endMix
.
firstClipInOut
.
second
=
endMix
.
firstClipInOut
.
first
+
clip1
->
getPlaytime
();
endMix
.
secondClipInOut
.
first
=
clip2
->
getPosition
();
endMix
.
secondClipInOut
.
second
=
endMix
.
secondClipInOut
.
first
+
clip2
->
getPlaytime
();
}
else
{
// Clip was deleted
endMix
.
firstClipId
=
-
1
;
}
}
}
else
{
endMix
.
firstClipId
=
-
1
;
...
...
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