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
ef8d2637
Commit
ef8d2637
authored
Feb 27, 2022
by
Jean-Baptiste Mardelle
Browse files
Fix audio thumbs for clips with speed effect
parent
67eaa581
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/timeline2/view/qml/ClipAudioThumbs.qml
View file @
ef8d2637
...
...
@@ -85,6 +85,7 @@ Row {
scaleFactor
:
timeline
.
scaleFactor
format
:
timeline
.
audioThumbFormat
normalize
:
timeline
.
audioThumbNormalize
speed
:
clipRoot
.
speed
waveInPoint
:
clipRoot
.
speed
<
0
?
(
Math
.
round
((
clipRoot
.
maxDuration
-
1
-
clipRoot
.
inPoint
)
*
Math
.
abs
(
clipRoot
.
speed
)
-
((
index
+
waveform
.
offset
)
*
waveform
.
maxWidth
/
timeline
.
scaleFactor
)
*
Math
.
abs
(
clipRoot
.
speed
))
*
clipRoot
.
audioChannels
)
:
(
Math
.
round
((
clipRoot
.
inPoint
+
((
index
+
waveform
.
offset
)
*
waveform
.
maxWidth
/
timeline
.
scaleFactor
))
*
clipRoot
.
speed
)
*
clipRoot
.
audioChannels
)
waveOutPoint
:
clipRoot
.
speed
<
0
?
(
waveInPoint
-
Math
.
ceil
(
width
/
timeline
.
scaleFactor
*
Math
.
abs
(
clipRoot
.
speed
))
*
clipRoot
.
audioChannels
)
:
(
waveInPoint
+
Math
.
round
(
width
/
timeline
.
scaleFactor
*
clipRoot
.
speed
)
*
clipRoot
.
audioChannels
)
fillColor0
:
clipRoot
.
color
...
...
src/timeline2/view/qml/timelineitems.cpp
View file @
ef8d2637
...
...
@@ -77,6 +77,7 @@ class TimelineWaveform : public QQuickPaintedItem
Q_PROPERTY
(
int
waveOutPointWithUpdate
MEMBER
m_outPoint
NOTIFY
propertyChanged
)
Q_PROPERTY
(
int
audioStream
MEMBER
m_stream
)
Q_PROPERTY
(
double
scaleFactor
MEMBER
m_scale
)
Q_PROPERTY
(
double
speed
MEMBER
m_speed
)
Q_PROPERTY
(
bool
format
MEMBER
m_format
NOTIFY
propertyChanged
)
Q_PROPERTY
(
bool
normalize
MEMBER
m_normalize
NOTIFY
normalizeChanged
)
Q_PROPERTY
(
bool
isFirstChunk
MEMBER
m_firstChunk
)
...
...
@@ -133,7 +134,7 @@ public:
}
QPen
pen
(
painter
->
pen
());
double
increment
=
qMax
(
1.
,
m_scale
/
m_channels
);
//qMax(1., 1. / qAbs(indicesPrPixel));
qreal
indicesPrPixel
=
m_channels
/
m_scale
;
//qreal(m_outPoint - m_inPoint) / width() * m_precisionFactor;
qreal
indicesPrPixel
=
m_channels
/
m_scale
*
qAbs
(
m_speed
)
;
//qreal(m_outPoint - m_inPoint) / width() * m_precisionFactor;
int
h
=
int
(
height
());
double
offset
=
0
;
bool
pathDraw
=
increment
>
1.2
;
...
...
@@ -270,6 +271,7 @@ private:
int
m_precisionFactor
;
int
m_stream
;
double
m_scale
;
double
m_speed
;
double
m_audioMax
;
bool
m_firstChunk
;
bool
m_opaquePaint
;
...
...
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