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
2bc61984
Commit
2bc61984
authored
Oct 12, 2021
by
Jean-Baptiste Mardelle
Browse files
add some debug info for clip move errors
parent
27903764
Pipeline
#88124
passed with stage
in 8 minutes and 31 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/model/timelinemodel.cpp
View file @
2bc61984
...
...
@@ -612,18 +612,22 @@ bool TimelineModel::requestClipMove(int clipId, int trackId, int position, bool
{
Q_UNUSED
(
moveMirrorTracks
)
if
(
trackId
==
-
1
)
{
qWarning
()
<<
"clip is not on a track"
;
return
false
;
}
Q_ASSERT
(
isClip
(
clipId
));
if
(
m_allClips
[
clipId
]
->
clipState
()
==
PlaylistState
::
Disabled
)
{
if
(
getTrackById_const
(
trackId
)
->
trackType
()
==
PlaylistState
::
AudioOnly
&&
!
m_allClips
[
clipId
]
->
canBeAudio
())
{
qWarning
()
<<
"clip type mismatch 1"
;
return
false
;
}
if
(
getTrackById_const
(
trackId
)
->
trackType
()
==
PlaylistState
::
VideoOnly
&&
!
m_allClips
[
clipId
]
->
canBeVideo
())
{
qWarning
()
<<
"clip type mismatch 2"
;
return
false
;
}
}
else
if
(
getTrackById_const
(
trackId
)
->
trackType
()
!=
m_allClips
[
clipId
]
->
clipState
())
{
// Move not allowed (audio / video mismatch)
qWarning
()
<<
"clip type mismatch 3"
;
return
false
;
}
std
::
function
<
bool
(
void
)
>
local_undo
=
[]()
{
return
true
;
};
...
...
@@ -677,7 +681,6 @@ bool TimelineModel::requestClipMove(int clipId, int trackId, int position, bool
bool
hadMix
=
mixData
.
first
.
firstClipId
>
-
1
||
mixData
.
second
.
secondClipId
>
-
1
;
if
(
old_trackId
==
-
1
&&
isTrack
(
previous_track
)
&&
hadMix
&&
previous_track
!=
trackId
)
{
// Clip is moved to another track
bool
mixGroupMove
=
false
;
if
(
mixData
.
first
.
firstClipId
>
0
)
{
allowedClipMixes
<<
mixData
.
first
.
firstClipId
;
...
...
@@ -800,6 +803,7 @@ bool TimelineModel::requestClipMove(int clipId, int trackId, int position, bool
if
(
!
ok
)
{
bool
undone
=
local_undo
();
Q_ASSERT
(
undone
);
qWarning
()
<<
"clip deletion failed"
;
return
false
;
}
}
...
...
src/timeline2/model/trackmodel.cpp
View file @
2bc61984
...
...
@@ -196,12 +196,14 @@ Fun TrackModel::requestClipInsertion_lambda(int clipId, int position, bool updat
if
(
allowedClipMixes
.
isEmpty
())
{
if
(
!
m_playlists
[
0
].
is_blank_at
(
position
)
||
!
m_playlists
[
1
].
is_blank_at
(
position
))
{
// Track is not empty
qWarning
()
<<
"clip insert failed - non blank 1"
;
return
[]()
{
return
false
;
};
}
}
else
{
// This is a group move with a mix, some clips are allowed
if
(
!
m_playlists
[
target_playlist
].
is_blank_at
(
position
))
{
// Track is not empty
qWarning
()
<<
"clip insert failed - non blank 2"
;
return
[]()
{
return
false
;
};
}
// Check if there are clips on the other playlist, and if they are in the allowed list
...
...
@@ -210,6 +212,7 @@ Fun TrackModel::requestClipInsertion_lambda(int clipId, int position, bool updat
for
(
int
c
:
collisions
)
{
if
(
!
allowedClipMixes
.
contains
(
c
))
{
// Track is not empty
qWarning
()
<<
"clip insert failed - non blank 3"
;
return
[]()
{
return
false
;
};
}
}
...
...
@@ -218,7 +221,10 @@ Fun TrackModel::requestClipInsertion_lambda(int clipId, int position, bool updat
if
(
target_clip
>=
count
&&
m_playlists
[
target_playlist
].
is_blank_at
(
position
))
{
// In that case, we append after, in the first playlist
return
[
this
,
position
,
clipId
,
end_function
,
finalMove
,
groupMove
,
target_playlist
]()
{
if
(
isLocked
())
return
false
;
if
(
isLocked
())
{
qWarning
()
<<
"clip insert failed - locked track"
;
return
false
;
}
if
(
auto
ptr
=
m_parent
.
lock
())
{
// Lock MLT playlist so that we don't end up with an invalid frame being displayed
m_playlists
[
target_playlist
].
lock
();
...
...
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