|
1 | 1 | /*
|
2 |
| - * Copyright (c) 2012-2024 Meltytech, LLC |
| 2 | + * Copyright (c) 2012-2025 Meltytech, LLC |
3 | 3 | *
|
4 | 4 | * This program is free software: you can redistribute it and/or modify
|
5 | 5 | * it under the terms of the GNU General Public License as published by
|
@@ -628,23 +628,13 @@ void Player::setupActions()
|
628 | 628 | action = new QAction(tr("Next Frame"), this);
|
629 | 629 | action->setProperty(Actions.hardKeyProperty, "K+L");
|
630 | 630 | action->setShortcut(QKeySequence(Qt::Key_Right));
|
631 |
| - connect(action, &QAction::triggered, this, [&]() { |
632 |
| - if (MLT.producer()) { |
633 |
| - pause(position() + 1); |
634 |
| - seek(position() + 1); |
635 |
| - } |
636 |
| - }); |
| 631 | + connect(action, &QAction::triggered, this, &Player::nextFrame); |
637 | 632 | Actions.add("playerNextFrameAction", action);
|
638 | 633 |
|
639 | 634 | action = new QAction(tr("Previous Frame"), this);
|
640 | 635 | action->setProperty(Actions.hardKeyProperty, "K+J");
|
641 | 636 | action->setShortcut(QKeySequence(Qt::Key_Left));
|
642 |
| - connect(action, &QAction::triggered, this, [&]() { |
643 |
| - if (MLT.producer()) { |
644 |
| - pause(position() - 1); |
645 |
| - seek(position() - 1); |
646 |
| - } |
647 |
| - }); |
| 637 | + connect(action, &QAction::triggered, this, &Player::previousFrame); |
648 | 638 | Actions.add("playerPreviousFrameAction", action);
|
649 | 639 |
|
650 | 640 | action = new QAction(tr("Forward One Second"), this);
|
@@ -1442,6 +1432,24 @@ void Player::onMuteButtonToggled(bool checked)
|
1442 | 1432 | m_volumePopup->hide();
|
1443 | 1433 | }
|
1444 | 1434 |
|
| 1435 | +void Player::nextFrame() |
| 1436 | +{ |
| 1437 | + if (MLT.producer() && m_requestedPosition != position() + 1) { |
| 1438 | + m_requestedPosition = position() + 1; |
| 1439 | + pause(m_requestedPosition); |
| 1440 | + seek(m_requestedPosition); |
| 1441 | + } |
| 1442 | +} |
| 1443 | + |
| 1444 | +void Player::previousFrame() |
| 1445 | +{ |
| 1446 | + if (MLT.producer() && m_requestedPosition != position() - 1) { |
| 1447 | + m_requestedPosition = position() - 1; |
| 1448 | + pause(m_requestedPosition); |
| 1449 | + seek(m_requestedPosition); |
| 1450 | + } |
| 1451 | +} |
| 1452 | + |
1445 | 1453 | void Player::setZoom(float factor, const QIcon &icon)
|
1446 | 1454 | {
|
1447 | 1455 | emit zoomChanged(factor);
|
|
0 commit comments