Skip to content
GitLab
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
e655a2af
Commit
e655a2af
authored
Jan 16, 2020
by
Jean-Baptiste Mardelle
Browse files
Don't display timeline offset on non AV clips
parent
55338156
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/model/timelinemodel.cpp
View file @
e655a2af
...
...
@@ -3641,20 +3641,23 @@ bool TimelineModel::requestSetSelection(const std::unordered_set<int> &ids)
}
if
(
pairIds
.
size
()
==
2
&&
getClipBinId
(
pairIds
.
at
(
0
))
==
getClipBinId
(
pairIds
.
at
(
1
)))
{
// Check if they have same bin id
// Both clips have same bin ID, display offset
int
pos1
=
getClipPosition
(
pairIds
.
at
(
0
));
int
pos2
=
getClipPosition
(
pairIds
.
at
(
1
));
if
(
pos2
>
pos1
)
{
int
offset
=
pos2
-
getClipIn
(
pairIds
.
at
(
1
))
-
(
pos1
-
getClipIn
(
pairIds
.
at
(
0
)));
if
(
offset
!=
0
)
{
m_allClips
[
pairIds
.
at
(
1
)]
->
setOffset
(
offset
);
m_allClips
[
pairIds
.
at
(
0
)]
->
setOffset
(
-
offset
);
}
}
else
{
int
offset
=
pos1
-
getClipIn
(
pairIds
.
at
(
0
))
-
(
pos2
-
getClipIn
(
pairIds
.
at
(
1
)));
if
(
offset
!=
0
)
{
m_allClips
[
pairIds
.
at
(
0
)]
->
setOffset
(
offset
);
m_allClips
[
pairIds
.
at
(
1
)]
->
setOffset
(
-
offset
);
ClipType
::
ProducerType
type
=
m_allClips
[
pairIds
.
at
(
0
)]
->
clipType
();
if
(
type
==
ClipType
::
AV
||
type
==
ClipType
::
Audio
||
type
==
ClipType
::
Video
)
{
// Both clips have same bin ID, display offset
int
pos1
=
getClipPosition
(
pairIds
.
at
(
0
));
int
pos2
=
getClipPosition
(
pairIds
.
at
(
1
));
if
(
pos2
>
pos1
)
{
int
offset
=
pos2
-
getClipIn
(
pairIds
.
at
(
1
))
-
(
pos1
-
getClipIn
(
pairIds
.
at
(
0
)));
if
(
offset
!=
0
)
{
m_allClips
[
pairIds
.
at
(
1
)]
->
setOffset
(
offset
);
m_allClips
[
pairIds
.
at
(
0
)]
->
setOffset
(
-
offset
);
}
}
else
{
int
offset
=
pos1
-
getClipIn
(
pairIds
.
at
(
0
))
-
(
pos2
-
getClipIn
(
pairIds
.
at
(
1
)));
if
(
offset
!=
0
)
{
m_allClips
[
pairIds
.
at
(
0
)]
->
setOffset
(
offset
);
m_allClips
[
pairIds
.
at
(
1
)]
->
setOffset
(
-
offset
);
}
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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