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

Fix timeremap widget not enabled in some cases

parent dd3ca408
Pipeline #72460 skipped
...@@ -815,10 +815,14 @@ std::shared_ptr<Mlt::Producer> ProjectClip::getTimelineProducer(int trackId, int ...@@ -815,10 +815,14 @@ std::shared_ptr<Mlt::Producer> ProjectClip::getTimelineProducer(int trackId, int
if (m_timewarpProducers.count(clipId) > 0) { if (m_timewarpProducers.count(clipId) > 0) {
// remove in all cases, we add it unconditionally anyways // remove in all cases, we add it unconditionally anyways
m_effectStack->removeService(m_timewarpProducers[clipId]); m_effectStack->removeService(m_timewarpProducers[clipId]);
if (qFuzzyCompare(m_timewarpProducers[clipId]->get_double("warp_speed"), speed) || timeremap) { if (qFuzzyCompare(m_timewarpProducers[clipId]->get_double("warp_speed"), speed)) {
// the producer we have is good, use it ! // the producer we have is good, use it !
warpProducer = m_timewarpProducers[clipId]; warpProducer = m_timewarpProducers[clipId];
qDebug() << "Reusing producer!"; qDebug() << "Reusing timewarp producer!";
} else if (timeremap && qFuzzyIsNull(m_timewarpProducers[clipId]->get_double("warp_speed"))) {
// the producer we have is good, use it !
qDebug() << "Reusing time remap producer!";
warpProducer = m_timewarpProducers[clipId];
} else { } else {
m_timewarpProducers.erase(clipId); m_timewarpProducers.erase(clipId);
} }
......
...@@ -1633,7 +1633,6 @@ void TimeRemap::selectedClip(int cid) ...@@ -1633,7 +1633,6 @@ void TimeRemap::selectedClip(int cid)
QObject::disconnect( m_seekConnection3 ); QObject::disconnect( m_seekConnection3 );
connect(pCore->getMonitor(Kdenlive::ClipMonitor), &Monitor::seekRemap, m_view, &RemapView::slotSetPosition, Qt::UniqueConnection); connect(pCore->getMonitor(Kdenlive::ClipMonitor), &Monitor::seekRemap, m_view, &RemapView::slotSetPosition, Qt::UniqueConnection);
m_cid = cid; m_cid = cid;
qDebug()<<"======\n\n!!!!!!!!!! SELECTED CLIP: "<<m_cid<<"\n\n==========";
std::shared_ptr<TimelineItemModel> model = pCore->window()->getCurrentTimeline()->controller()->getModel(); std::shared_ptr<TimelineItemModel> model = pCore->window()->getCurrentTimeline()->controller()->getModel();
disconnect(model.get(), &TimelineItemModel::dataChanged, this, &TimeRemap::checkClipUpdate); disconnect(model.get(), &TimelineItemModel::dataChanged, this, &TimeRemap::checkClipUpdate);
if (cid == -1) { if (cid == -1) {
...@@ -1695,6 +1694,8 @@ void TimeRemap::selectedClip(int cid) ...@@ -1695,6 +1694,8 @@ void TimeRemap::selectedClip(int cid)
} }
} }
} }
} else {
qDebug()<<"/// PRODUCER IS NOT A CHAIN!!!!";
} }
if (!m_binId.isEmpty() && pCore->getMonitor(Kdenlive::ClipMonitor)->activeClipId() == m_binId) { if (!m_binId.isEmpty() && pCore->getMonitor(Kdenlive::ClipMonitor)->activeClipId() == m_binId) {
connect(pCore->getMonitor(Kdenlive::ClipMonitor), &Monitor::seekPosition, pCore->getMonitor(Kdenlive::ClipMonitor), &Monitor::seekRemap, Qt::UniqueConnection); connect(pCore->getMonitor(Kdenlive::ClipMonitor), &Monitor::seekPosition, pCore->getMonitor(Kdenlive::ClipMonitor), &Monitor::seekRemap, Qt::UniqueConnection);
......
...@@ -2205,7 +2205,7 @@ void TimelineController::remapItemTime(int clipId) ...@@ -2205,7 +2205,7 @@ void TimelineController::remapItemTime(int clipId)
clipId = getMainSelectedClip(); clipId = getMainSelectedClip();
} }
// Don't allow remaping a clip with speed effect // Don't allow remaping a clip with speed effect
if (clipId == -1 || !m_model->isClip(clipId) || qFuzzyCompare(1., m_model->m_allClips[clipId]->getSpeed())) { if (clipId == -1 || !m_model->isClip(clipId) || !qFuzzyCompare(1., m_model->m_allClips[clipId]->getSpeed())) {
pCore->displayMessage(i18n("No item to edit"), ErrorMessage, 500); pCore->displayMessage(i18n("No item to edit"), ErrorMessage, 500);
return; return;
} }
......
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