diff --git a/.gitignore b/.gitignore index b4e77fa32739c69ea56da53e8e768fb63951eab0..e227c36f7b7374bacba2c600686e210979634162 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ build.clang/* # Local configurations .vim/* +.vscode/* diff --git a/src/UI/DocumentViews/MpvContainer.cc b/src/UI/DocumentViews/MpvContainer.cc index 921fa6b69ab3d7eabc5a2a891cf444a0bbb55d4f..27cef58a9c51d2ad033934fe6d02aa911a67c4f3 100644 --- a/src/UI/DocumentViews/MpvContainer.cc +++ b/src/UI/DocumentViews/MpvContainer.cc @@ -131,16 +131,21 @@ MpvContainer::handleMpvEvent(mpv_event *event) noexcept else if (checkProp(prop, "pause"s, MPV_FORMAT_FLAG)) { isPlaybackPaused = *reinterpret_cast<bool *>(prop->data); emit mpvPlaybackToggled(!isPlaybackPaused); + qDebug() << "MPV -> set to" << (isPlaybackPaused ? "pause" : "play"); } break; case MPV_EVENT_PAUSE: isPlaybackPaused = true; + emit mpvPlaybackToggled(!isPlaybackPaused); + qDebug() << "MPV -> set to pause"; break; case MPV_EVENT_UNPAUSE: isPlaybackPaused = false; + emit mpvPlaybackToggled(!isPlaybackPaused); + qDebug() << "MPV -> set to play"; break; case MPV_EVENT_START_FILE: diff --git a/src/UI/DocumentViews/MpvControls.cc b/src/UI/DocumentViews/MpvControls.cc index a661de0fd9af2c20772f60bfe63193ff10bb879b..36971ccb8b589c78a16e0783a4ff3560d9d29aab 100644 --- a/src/UI/DocumentViews/MpvControls.cc +++ b/src/UI/DocumentViews/MpvControls.cc @@ -45,8 +45,10 @@ MpvControls::MpvControls(MpvContainer *passedContainer, QWidget *parent) noexcep connect(togglePlaybackButton, &QAbstractButton::clicked, mpv, &MpvContainer::mpvTogglePlayback); connect(mpv, &MpvContainer::mpvPlaybackToggled, this, [togglePlaybackButton](bool isPlay) noexcept -> void { - togglePlaybackButton->setText(isPlay ? QStringLiteral("Play") - : QStringLiteral("Pause")); + qDebug() << "Got playback update to" + << (isPlay ? QStringLiteral("Play") : QStringLiteral("Pause")); + togglePlaybackButton->setText(isPlay ? QStringLiteral("Pause") + : QStringLiteral("Play")); }); auto *centralLayout = new QHBoxLayout(this);