[vlc-devel] [PATCH 12/14] qt: propose restoring playback only once per media
Pierre Lamot
pierre at videolabs.io
Thu Oct 22 15:14:24 CEST 2020
---
modules/gui/qt/player/player_controller.cpp | 9 +++++++++
modules/gui/qt/player/player_controller.hpp | 1 +
modules/gui/qt/player/qml/ResumeDialog.qml | 1 +
3 files changed, 11 insertions(+)
diff --git a/modules/gui/qt/player/player_controller.cpp b/modules/gui/qt/player/player_controller.cpp
index 597ff1cdf3..c03ad71144 100644
--- a/modules/gui/qt/player/player_controller.cpp
+++ b/modules/gui/qt/player/player_controller.cpp
@@ -1583,6 +1583,15 @@ void PlayerController::restorePlaybackPos()
vlc_player_RestorePlaybackPos( d->m_player );
}
+void PlayerController::acknowledgeRestoreCallback()
+{
+ Q_D(PlayerController);
+ if (d->m_canRestorePlayback) {
+ d->m_canRestorePlayback = false;
+ emit playbackRestoreQueried();
+ }
+}
+
//MISC
void PlayerController::setABloopState(ABLoopState state)
diff --git a/modules/gui/qt/player/player_controller.hpp b/modules/gui/qt/player/player_controller.hpp
index 99c0f0f296..2842b89a3e 100644
--- a/modules/gui/qt/player/player_controller.hpp
+++ b/modules/gui/qt/player/player_controller.hpp
@@ -277,6 +277,7 @@ public slots:
void updateTimeFromTimer();
bool canRestorePlayback() const;
void restorePlaybackPos();
+ void acknowledgeRestoreCallback();
//tracks
TrackListModel* getVideoTracks();
diff --git a/modules/gui/qt/player/qml/ResumeDialog.qml b/modules/gui/qt/player/qml/ResumeDialog.qml
index 058c39d7a3..cdd5cc3c20 100644
--- a/modules/gui/qt/player/qml/ResumeDialog.qml
+++ b/modules/gui/qt/player/qml/ResumeDialog.qml
@@ -44,6 +44,7 @@ Widgets.NavigableFocusScope {
function hideResumePanel() {
resumeTimeout.stop()
resumePanel.visible = false
+ player.acknowledgeRestoreCallback()
hidden()
}
--
2.25.1
More information about the vlc-devel
mailing list