Commit 34a9b894 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix audio thumbs for clips with speed effect

parent 29d0fa49
Pipeline #142854 passed with stage
in 5 minutes and 29 seconds
......@@ -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
......
......@@ -82,6 +82,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)
......@@ -138,7 +139,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;
......@@ -274,6 +275,7 @@ private:
int m_precisionFactor;
int m_stream;
double m_scale;
double m_speed;
double m_audioMax;
bool m_firstChunk;
bool m_opaquePaint;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment