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
02e8c3ed
Commit
02e8c3ed
authored
Sep 25, 2020
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix moving clip groups with a mix
parent
d7c68402
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
3 deletions
+30
-3
src/timeline2/model/timelinemodel.cpp
src/timeline2/model/timelinemodel.cpp
+30
-3
No files found.
src/timeline2/model/timelinemodel.cpp
View file @
02e8c3ed
...
...
@@ -2005,6 +2005,7 @@ bool TimelineModel::requestGroupMove(int itemId, int groupId, int delta_track, i
QVector
<
int
>
tracksWithMix
;
// Separate clips from compositions to sort and check source tracks
QMap
<
std
::
pair
<
int
,
int
>
,
int
>
mixesToDelete
;
for
(
int
affectedItemId
:
all_items
)
{
if
(
delta_track
!=
0
)
{
// Check if an upper / lower move is possible
...
...
@@ -2020,9 +2021,22 @@ bool TimelineModel::requestGroupMove(int itemId, int groupId, int delta_track, i
sorted_clips
.
push_back
({
affectedItemId
,
m_allClips
[
affectedItemId
]
->
getPosition
()});
sorted_clips_ids
.
push_back
(
affectedItemId
);
int
current_track_id
=
getClipTrackId
(
affectedItemId
);
if
(
!
tracksWithMix
.
contains
(
current_track_id
)
&&
getTrackById_const
(
current_track_id
)
->
hasMix
(
affectedItemId
))
{
// There is a mix, prepare for update
tracksWithMix
<<
current_track_id
;
// Check if we have a mix in the group
if
(
getTrackById_const
(
current_track_id
)
->
hasMix
(
affectedItemId
))
{
if
(
delta_track
!=
0
)
{
std
::
pair
<
MixInfo
,
MixInfo
>
mixData
=
getTrackById_const
(
current_track_id
)
->
getMixInfo
(
affectedItemId
);
if
(
mixData
.
first
.
firstClipId
>
-
1
&&
all_items
.
find
(
mixData
.
first
.
firstClipId
)
==
all_items
.
end
())
{
// First part of the mix is not moving, delete start mix
mixesToDelete
.
insert
({
mixData
.
first
.
firstClipId
,
affectedItemId
},
current_track_id
);
}
if
(
mixData
.
second
.
firstClipId
>
-
1
&&
all_items
.
find
(
mixData
.
second
.
secondClipId
)
==
all_items
.
end
())
{
// First part of the mix is not moving, delete start mix
mixesToDelete
.
insert
({
affectedItemId
,
mixData
.
second
.
secondClipId
},
current_track_id
);
}
}
else
if
(
!
tracksWithMix
.
contains
(
current_track_id
))
{
// There is a mix, prepare for update
tracksWithMix
<<
current_track_id
;
}
}
}
else
{
sorted_compositions
.
push_back
({
affectedItemId
,
{
m_allCompositions
[
affectedItemId
]
->
getPosition
(),
getTrackMltIndex
(
m_allCompositions
[
affectedItemId
]
->
getCurrentTrackId
())}});
...
...
@@ -2133,6 +2147,16 @@ bool TimelineModel::requestGroupMove(int itemId, int groupId, int delta_track, i
// Keep track of old track for mixes
oldTrackIds
.
insert
(
item
.
first
,
getClipTrackId
(
item
.
first
));
}
// First delete mixes that have to
if
(
finalMove
&&
!
mixesToDelete
.
isEmpty
())
{
QMapIterator
<
std
::
pair
<
int
,
int
>
,
int
>
i
(
mixesToDelete
);
while
(
i
.
hasNext
())
{
i
.
next
();
// Delete mix
bool
res
=
getTrackById
(
i
.
value
())
->
requestRemoveMix
(
i
.
key
(),
local_undo
,
local_redo
);
}
}
// First, remove clips
if
(
delta_track
!=
0
)
{
// We delete our clips only if changing track
...
...
@@ -2167,6 +2191,9 @@ bool TimelineModel::requestGroupMove(int itemId, int groupId, int delta_track, i
}
Fun
sync_mix
=
[
this
,
tracksWithMix
,
finalMove
]()
{
if
(
!
finalMove
)
{
return
true
;
}
for
(
int
tid
:
tracksWithMix
)
{
getTrackById_const
(
tid
)
->
syncronizeMixes
(
finalMove
);
}
...
...
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