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
52512aac
Commit
52512aac
authored
Mar 04, 2022
by
Jean-Baptiste Mardelle
Browse files
Fix timeline thumbs when changing speed of clip
parent
6772856a
Pipeline
#145166
passed with stage
in 6 minutes and 49 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/view/qml/Clip.qml
View file @
52512aac
...
...
@@ -375,6 +375,11 @@ Rectangle {
asynchronous
:
true
visible
:
status
==
Loader
.
Ready
source
:
(
clipRoot
.
hideClipViews
||
clipRoot
.
itemType
==
0
||
clipRoot
.
itemType
===
ProducerType
.
Color
)
?
""
:
parentTrack
.
isAudio
?
(
timeline
.
showAudioThumbnails
?
"
ClipAudioThumbs.qml
"
:
""
)
:
timeline
.
showThumbnails
?
"
ClipThumbs.qml
"
:
""
onStatusChanged
:
{
if
(
!
parentTrack
.
isAudio
&&
thumbsLoader
.
item
)
{
thumbsLoader
.
item
.
initialSpeed
=
clipRoot
.
speed
}
}
}
Rectangle
{
...
...
src/timeline2/view/qml/ClipThumbs.qml
View file @
52512aac
...
...
@@ -14,6 +14,7 @@ Row {
anchors.fill
:
parent
visible
:
!
isAudio
clip
:
true
property
real
initialSpeed
:
1
opacity
:
clipState
===
ClipState
.
Disabled
?
0.2
:
1
property
bool
fixedThumbs
:
clipRoot
.
itemType
===
ProducerType
.
Image
||
clipRoot
.
itemType
===
ProducerType
.
Text
||
clipRoot
.
itemType
===
ProducerType
.
TextTemplate
property
int
thumbWidth
:
container
.
height
*
root
.
dar
...
...
@@ -37,12 +38,12 @@ Row {
property
real
imageWidth
:
Math
.
max
(
thumbRow
.
thumbWidth
,
container
.
width
/
thumbRepeater
.
count
)
property
int
thumbStartFrame
:
fixedThumbs
?
0
:
(
clipRoot
.
speed
>=
0
)
?
Math
.
round
(
clipRoot
.
inPoint
*
clipRoot
.
s
peed
)
:
Math
.
round
((
clipRoot
.
maxDuration
-
clipRoot
.
inPoint
)
*
-
clipRoot
.
s
peed
-
1
)
?
Math
.
round
(
clipRoot
.
inPoint
*
thumbRow
.
initialS
peed
)
:
Math
.
round
((
clipRoot
.
maxDuration
-
clipRoot
.
inPoint
)
*
-
thumbRow
.
initialS
peed
-
1
)
property
int
thumbEndFrame
:
fixedThumbs
?
0
:
(
clipRoot
.
speed
>=
0
)
?
Math
.
round
(
clipRoot
.
outPoint
*
clipRoot
.
s
peed
)
:
Math
.
round
((
clipRoot
.
maxDuration
-
clipRoot
.
outPoint
)
*
-
clipRoot
.
s
peed
-
1
)
?
Math
.
round
(
clipRoot
.
outPoint
*
thumbRow
.
initialS
peed
)
:
Math
.
round
((
clipRoot
.
maxDuration
-
clipRoot
.
outPoint
)
*
-
thumbRow
.
initialS
peed
-
1
)
Image
{
width
:
thumbRepeater
.
imageWidth
...
...
@@ -52,19 +53,17 @@ Row {
cache
:
enableCache
//sourceSize.width: width
//sourceSize.height: height
property
int
currentFrame
:
fixedThumbs
?
0
:
thumbRepeater
.
count
<
3
?
(
index
==
0
?
thumbRepeater
.
thumbStartFrame
:
thumbRepeater
.
thumbEndFrame
)
:
Math
.
floor
(
clipRoot
.
inPoint
*
clipRoot
.
s
peed
+
Math
.
round
((
index
)
*
width
/
timeline
.
scaleFactor
)
*
clipRoot
.
speed
)
property
int
currentFrame
:
fixedThumbs
?
0
:
thumbRepeater
.
count
<
3
?
(
index
==
0
?
thumbRepeater
.
thumbStartFrame
:
thumbRepeater
.
thumbEndFrame
)
:
Math
.
floor
(
clipRoot
.
inPoint
*
thumbRow
.
initialS
peed
+
Math
.
round
((
index
)
*
width
/
timeline
.
scaleFactor
)
*
clipRoot
.
speed
)
horizontalAlignment
:
thumbRepeater
.
count
<
3
?
(
index
==
0
?
Image
.
AlignLeft
:
Image
.
AlignRight
)
:
Image
.
AlignLeft
source
:
thumbRepeater
.
count
<
3
?
(
clipRoot
.
baseThumbPath
+
currentFrame
)
:
(
index
*
width
<
clipRoot
.
scrollStart
-
width
||
index
*
width
>
clipRoot
.
scrollStart
+
scrollView
.
width
)
?
''
:
clipRoot
.
baseThumbPath
+
currentFrame
onStatusChanged
:
{
if
(
thumbRepeater
.
count
<
3
)
{
if
(
status
===
Image
.
Ready
)
{
thumbPlaceholder
.
source
=
source
}
if
(
status
===
Image
.
Ready
&&
(
index
==
0
||
index
==
thumbRepeater
.
count
-
1
))
{
thumbPlaceholder
.
source
=
source
}
}
Image
{
id
:
thumbPlaceholder
visible
:
parent
.
status
!=
Image
.
Ready
visible
:
parent
.
status
!=
Image
.
Ready
&&
(
index
==
0
||
index
==
thumbRepeater
.
count
-
1
)
anchors.left
:
parent
.
left
anchors.leftMargin
:
index
<
thumbRepeater
.
count
-
1
?
0
:
parent
.
width
-
thumbRow
.
thumbWidth
-
1
width
:
parent
.
width
...
...
src/timeline2/view/qml/Track.qml
View file @
52512aac
...
...
@@ -60,6 +60,12 @@ Item{
z
:
calculateZIndex
()
Loader
{
id
:
loader
Binding
{
target
:
loader
.
item
property
:
"
speed
"
value
:
model
.
speed
when
:
loader
.
status
==
Loader
.
Ready
&&
loader
.
item
&&
clipItem
}
Binding
{
target
:
loader
.
item
property
:
"
timeScale
"
...
...
@@ -278,8 +284,7 @@ Item{
item
.
multiStream
=
model
.
multiStream
item
.
aStreamIndex
=
model
.
audioStreamIndex
console
.
log
(
'
loaded clip with Astream:
'
,
model
.
audioStream
)
// Speed change triggers a new clip insert so no binding necessary
item
.
speed
=
model
.
speed
}
else
if
(
model
.
clipType
==
ProducerType
.
Composition
)
{
console
.
log
(
'
loaded composition:
'
,
model
.
start
,
'
, ID:
'
,
model
.
item
,
'
, index:
'
,
trackRoot
.
DelegateModel
.
itemsIndex
)
//item.aTrack = model.a_track
...
...
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