Always create audio thumbs from original source file, not proxy because proxy...

Always create audio thumbs from original source file, not proxy because proxy clip can have a different audio layout.
Force rebuild audio thumbs on clip reload
Fix zooming with ctrl+wheel over timeline ruler
parent fcbfdb00
Pipeline #3037 passed with stage
in 13 minutes and 32 seconds
......@@ -1024,7 +1024,7 @@ void Bin::slotReloadClip()
}
}
}
currentItem->reloadProducer(false);
currentItem->reloadProducer(false, true);
}
}
}
......
......@@ -120,7 +120,13 @@ bool AudioThumbJob::computeWithFFMPEG()
channelTmpfile->close();
channelFiles.emplace_back(std::move(channelTmpfile));
}
args << QStringLiteral("-i") << QUrl::fromLocalFile(m_prod->get("resource")).toLocalFile();
// Always create audio thumbs from the original source file, because proxy
// can have a different audio config (channels / mono/ stereo)
QString filePath = m_prod->get("kdenlive:originalurl");
if (filePath.isEmpty()) {
filePath = m_prod->get("resource");
}
args << QStringLiteral("-i") << QUrl::fromLocalFile(filePath).toLocalFile();
// Output progress info
args << QStringLiteral("-progress");
#ifdef Q_OS_WIN
......
......@@ -208,7 +208,6 @@ QHash<int, QByteArray> TimelineItemModel::roleNames() const
roles[GroupedRole] = "grouped";
roles[IsDisabledRole] = "disabled";
roles[IsAudioRole] = "audio";
roles[AudioLevelsRole] = "audioLevels";
roles[AudioChannelsRole] = "audioChannels";
roles[IsCompositeRole] = "composite";
roles[IsLockedRole] = "locked";
......@@ -291,9 +290,6 @@ QVariant TimelineItemModel::data(const QModelIndex &index, int role) const
case ServiceRole:
return clip->getProperty("mlt_service");
break;
case AudioLevelsRole:
// Dumb property to trigger audio thumbs reload
return true;
case AudioChannelsRole:
return clip->audioChannels();
case HasAudio:
......
......@@ -41,7 +41,6 @@ Rectangle {
property bool showKeyframes: false
property bool isGrabbed: false
property bool grouped: false
property var audioLevels
property var markers
property var keyframeModel
property int clipStatus: 0
......@@ -228,12 +227,6 @@ Rectangle {
drag.acceptProposedAction
}
}
onAudioLevelsChanged: {
if (parentTrack && parentTrack.isAudio && thumbsLoader.item) {
thumbsLoader.item.reload()
}
}
MouseArea {
id: mouseArea
enabled: root.activeTool === 0
......
......@@ -32,7 +32,7 @@ Row {
function processReload() {
// This is needed to make the model have the correct count.
// Model as a property expression is not working in all cases.
if (!waveform.visible || !timeline.showAudioThumbnails || (waveform.scrollMin > clipRoot.modelStart + clipRoot.clipDuration) || (clipRoot.modelStart > waveform.scrollMax) || clipRoot.audioLevels == '') {
if (!waveform.visible || !timeline.showAudioThumbnails || (waveform.scrollMin > clipRoot.modelStart + clipRoot.clipDuration) || (clipRoot.modelStart > waveform.scrollMax)) {
return;
}
var chunks = Math.ceil(waveform.width / waveform.maxWidth)
......
......@@ -128,12 +128,6 @@ Column{
value: model.fadeOut
when: loader.status == Loader.Ready && isClip(model.clipType)
}
Binding {
target: loader.item
property: "audioLevels"
value: model.audioLevels
when: loader.status == Loader.Ready && isClip(model.clipType)
}
Binding {
target: loader.item
property: "showKeyframes"
......
......@@ -1037,6 +1037,12 @@ Rectangle {
anchors.bottom: parent.bottom
x: timeline.position * timeline.scaleFactor - (width / 2)
}
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton
onWheel: zoomByWheel(wheel)
cursorShape: dragProxyArea.drag.active ? Qt.ClosedHandCursor : tracksArea.cursorShape
}
}
}
OLD.ScrollView {
......
......@@ -109,9 +109,15 @@ public:
void paint(QPainter *painter) override
{
if (!m_showItem || m_audioLevels.isEmpty()) {
if (!m_showItem || m_binId.isEmpty()) {
return;
}
if (m_audioLevels.isEmpty()) {
m_audioLevels = pCore->projectItemModel()->getAudioLevelsByBinID(m_binId);
if (m_audioLevels.isEmpty()) {
return;
}
}
qreal indicesPrPixel = qreal(m_outPoint - m_inPoint) / width();
QPen pen = painter->pen();
pen.setColor(m_color);
......
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