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

Key L should allow playing at normal speed

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