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

Monitor config: add option to disable progressive playback

parent d6cf51f6
Pipeline #82457 passed with stage
in 8 minutes and 35 seconds
......@@ -417,6 +417,7 @@ void Core::updateMonitorProfile()
m_monitorProfile.set_sample_aspect(m_projectProfile->sample_aspect_num(), m_projectProfile->sample_aspect_den());
m_monitorProfile.set_display_aspect(m_projectProfile->display_aspect_num(), m_projectProfile->display_aspect_den());
m_monitorProfile.set_explicit(true);
emit monitorProfileUpdated();
}
const QString &Core::getCurrentProfilePath() const
......
......@@ -349,7 +349,8 @@ signals:
void disconnectEffectStack();
/** @brief Add a time remap effect to clip and show keyframes dialog */
void remapClip(int cid);
/** @brief A monitor property changed, check if we need to reset */
void monitorProfileUpdated();
};
#endif
......@@ -456,6 +456,11 @@
<label>Background color for clip monitor (only visible with transparent clips).</label>
<default>black</default>
</entry>
<entry name="monitor_progressive" type="Bool">
<label>Should we deinterlace monitor preview.</label>
<default>true</default>
</entry>
<entry name="volume" type="Int">
<label>Volume used for SDL output.</label>
......
......@@ -235,6 +235,7 @@
</Menu>
<Menu name="monitor_config" ><text>Monitor config</text>
<Action name="mlt_interlace" />
<Action name="mlt_progressive" />
<Action name="mlt_interpolation" />
<Action name="mlt_gamma" />
<Action name="mlt_realtime" />
......
......@@ -1189,8 +1189,9 @@ int GLWidget::reconfigure()
m_consumer->set("audio_driver", audioDriver.toUtf8().constData());
}
}
/*if (!pCore->getCurrentProfile()->progressive())
m_consumer->set("progressive", property("progressive").toBool());*/
if (!pCore->getProjectProfile()->progressive()) {
m_consumer->set("progressive", KdenliveSettings::monitor_progressive());
}
m_consumer->set("volume", volume / 100.0);
// m_consumer->set("progressive", 1);
m_consumer->set("rescale", KdenliveSettings::mltinterpolation().toUtf8().constData());
......
......@@ -33,6 +33,13 @@ MonitorManager::MonitorManager(QObject *parent)
refreshTimer.setSingleShot(true);
refreshTimer.setInterval(200);
connect(&refreshTimer, &QTimer::timeout, this, &MonitorManager::forceProjectMonitorRefresh);
connect(pCore.get(), &Core::monitorProfileUpdated, this, [&]() {
QAction *prog = pCore->window()->actionCollection()->action(QStringLiteral("mlt_progressive"));
if (prog) {
prog->setEnabled(!pCore->getProjectProfile()->progressive());
slotProgressivePlay(prog->isChecked());
}
});
}
QAction *MonitorManager::getAction(const QString &name)
......@@ -382,7 +389,7 @@ void MonitorManager::resetProfiles()
}
if (m_projectMonitor) {
m_projectMonitor->resetProfile();
}
}
}
void MonitorManager::resetConsumers(bool fullReset)
......@@ -560,6 +567,12 @@ void MonitorManager::setupActions()
#endif
pCore->window()->addAction(QStringLiteral("mlt_interpolation"), interpol);
pCore->window()->actionCollection()->setShortcutsConfigurable(interpol, false);
QAction *progressive = new QAction(QIcon::fromTheme(QString()), i18n("Progressive playback"), this);
connect(progressive, &QAction::triggered, this, &MonitorManager::slotProgressivePlay);
pCore->window()->addAction(QStringLiteral("mlt_progressive"), progressive);
progressive->setCheckable(true);
progressive->setChecked(KdenliveSettings::monitor_progressive());
QAction *zoneStart = new QAction(QIcon::fromTheme(QStringLiteral("media-seek-backward")), i18n("Go to Zone Start"), this);
connect(zoneStart, &QAction::triggered, this, &MonitorManager::slotZoneStart);
......@@ -644,6 +657,23 @@ void MonitorManager::slotMuteCurrentMonitor(bool active)
m_activeMonitor->mute(active);
}
void MonitorManager::slotProgressivePlay(bool active)
{
if (pCore->getProjectProfile()->progressive()) {
// nothing to do
return;
}
KdenliveSettings::setMonitor_progressive(active);
if (m_clipMonitor) {
m_clipMonitor->resetConsumer(true);
m_clipMonitor->refreshMonitor(true);
}
if (m_projectMonitor) {
m_projectMonitor->resetConsumer(true);
m_projectMonitor->refreshMonitor(true);
}
}
Monitor *MonitorManager::clipMonitor()
{
return m_clipMonitor;
......
......@@ -123,6 +123,8 @@ private slots:
void slotSetInterpolation(int ix);
/** @brief Switch muting on/off */
void slotMuteCurrentMonitor(bool active);
/** @brief Toggle progressive play on/off */
void slotProgressivePlay(bool active);
/** @brief Zoom in active monitor */
void slotZoomIn();
/** @brief Zoom out active monitor */
......
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