Key L should allow playing at normal speed

parent 2b23bde4
......@@ -88,7 +88,7 @@ public slots:
virtual void start() = 0;
virtual void slotPlay() = 0;
virtual void slotRewind(double speed = 0) = 0;
virtual void slotForward(double speed = 0) = 0;
virtual void slotForward(double speed = 0, bool allowNormalPlay = false) = 0;
virtual void refreshMonitorIfActive(bool directUpdate = false) = 0;
virtual void slotMouseSeek(int eventDelta, uint modifiers) = 0;
bool slotActivateMonitor();
......
......@@ -321,7 +321,9 @@ Monitor::Monitor(Kdenlive::MonitorId id, MonitorManager *manager, QWidget *paren
// Per monitor forward action
QAction *forward = new QAction(QIcon::fromTheme(QStringLiteral("media-seek-forward")), i18n("Forward"), this);
m_toolbar->addAction(forward);
connect(forward, &QAction::triggered, this, &Monitor::slotForward);
connect(forward, &QAction::triggered, [this]() {
Monitor::slotForward();
});
playButton->setDefaultAction(m_playAction);
m_configMenu = new QMenu(i18n("Misc..."), this);
......@@ -1205,13 +1207,21 @@ void Monitor::slotRewind(double speed)
m_glMonitor->switchPlay(true, speed);
}
void Monitor::slotForward(double speed)
void Monitor::slotForward(double speed, bool allowNormalPlay)
{
slotActivateMonitor();
if (qFuzzyIsNull(speed)) {
double currentspeed = m_glMonitor->playSpeed();
if (currentspeed < 1) {
m_speedIndex = 0;
if (allowNormalPlay) {
m_glMonitor->purgeCache();
resetSpeedInfo();
m_playAction->setActive(true);
m_glMonitor->switchPlay(true, 1);
return;
} else {
m_speedIndex = 0;
}
} else {
m_speedIndex++;
}
......
......@@ -290,7 +290,7 @@ public slots:
void slotLoopZone();
/** @brief Loops the selected item (clip or transition). */
void slotLoopClip();
void slotForward(double speed = 0) override;
void slotForward(double speed = 0, bool allowNormalPlay = false) override;
void slotRewind(double speed = 0) override;
void slotRewindOneFrame(int diff = 1);
void slotForwardOneFrame(int diff = 1);
......
......@@ -240,7 +240,7 @@ void MonitorManager::slotRewind(double speed)
void MonitorManager::slotForward(double speed)
{
if (m_activeMonitor) {
m_activeMonitor->slotForward(speed);
m_activeMonitor->slotForward(speed, true);
}
}
......
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