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

Time remap: only seek clip monitor if visible

parent 8e6feecc
Pipeline #141373 passed with stage
in 7 minutes and 30 seconds
......@@ -1791,7 +1791,7 @@ void TimeRemap::selectedClip(int cid)
int max = min + lastLength;
pCore->selectBinClip(m_binId, true, min, {min,max});
}
pCore->getMonitor(Kdenlive::ClipMonitor)->requestSeek(topPos);
pCore->getMonitor(Kdenlive::ClipMonitor)->requestSeekIfVisible(topPos);
}
if (bottomPos > -1) {
pCore->getMonitor(Kdenlive::ProjectMonitor)->requestSeek(bottomPos + m_view->m_startPos);
......
......@@ -1560,7 +1560,7 @@ void Monitor::refreshMonitor(bool directUpdate)
} else {
m_glMonitor->requestRefresh();
}
} else if (m_glWidget->isFullScreen() || !m_glWidget->visibleRegion().isEmpty()) {
} else if (monitorVisible()) {
slotActivateMonitor();
if (isActive()) {
m_glMonitor->refresh();
......@@ -1574,6 +1574,11 @@ void Monitor::refreshMonitor(bool directUpdate)
}
}
bool Monitor::monitorVisible() const
{
return m_glWidget->isFullScreen() || !m_glWidget->visibleRegion().isEmpty();
}
void Monitor::refreshMonitorIfActive(bool directUpdate)
{
if (!m_glMonitor->isReady() || !isActive()) {
......@@ -1821,7 +1826,7 @@ void Monitor::slotOpenClip(const std::shared_ptr<ProjectClip> &controller, int i
m_glMonitor->getControllerProxy()->setAudioThumb(streamIndexes, m_controller->activeStreamChannels());
}
}
if (m_glWidget->isFullScreen() || !m_glWidget->visibleRegion().isEmpty()) {
if (monitorVisible()) {
slotActivateMonitor();
}
buildBackgroundedProducer(in);
......@@ -1837,7 +1842,7 @@ void Monitor::slotOpenClip(const std::shared_ptr<ProjectClip> &controller, int i
m_glMonitor->getControllerProxy()->setClipProperties(-1, ClipType::Unknown, false, QString());
//m_audioChannels->menuAction()->setVisible(false);
m_streamAction->setVisible(false);
if (m_glWidget->isFullScreen() || !m_glWidget->visibleRegion().isEmpty()) {
if (monitorVisible()) {
slotActivateMonitor();
}
}
......@@ -2559,6 +2564,13 @@ void Monitor::requestSeek(int pos)
m_glMonitor->getControllerProxy()->setPosition(pos);
}
void Monitor::requestSeekIfVisible(int pos)
{
if (monitorVisible()) {
requestSeek(pos);
}
}
void Monitor::setProducer(std::shared_ptr<Mlt::Producer> producer, int pos)
{
m_audioMeterWidget->audioChannels = pCore->audioChannels();
......
......@@ -158,7 +158,6 @@ public:
void focusTimecode();
/** @brief Ensure the video widget has focus to make keyboard shortcuts work */
void fixFocus();
protected:
void mousePressEvent(QMouseEvent *event) override;
......@@ -242,6 +241,8 @@ private:
void updateQmlDisplay(int currentOverlay);
/** @brief Create temporary Mlt::Tractor holding a clip and it's effectless clone */
void buildSplitEffect(Mlt::Producer *original);
/** @brief Returns true if monitor is currently visible (not in a tab or hidden)*/
bool monitorVisible() const;
private slots:
void slotSetThumbFrame();
......@@ -346,6 +347,8 @@ public slots:
void slotSwitchAudioMonitor();
/** @brief Request seeking */
void requestSeek(int pos);
/** @brief Request seeking only if monitor is visible*/
void requestSeekIfVisible(int pos);
/** @brief Check current position to show relevant infos in qml view (markers, zone in/out, etc). */
void checkOverlay(int pos = -1);
void refreshMonitorIfActive(bool directUpdate = false) override;
......
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