From a63178f48fe23b0de779ea1988e72e4b128fcb1a Mon Sep 17 00:00:00 2001 From: Alexey Andreyev Date: Sat, 25 Mar 2023 19:29:03 +0300 Subject: Improve Qt 6 support Add missing mediaplayer widget logic Contributes to: https://github.com/MasterQ32/kristall/pull/266 --- src/widgets/mediaplayer.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/widgets/mediaplayer.cpp b/src/widgets/mediaplayer.cpp index 41aa105..74551ca 100644 --- a/src/widgets/mediaplayer.cpp +++ b/src/widgets/mediaplayer.cpp @@ -10,6 +10,7 @@ #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #include #else +#include #include #endif @@ -90,7 +91,11 @@ void MediaPlayer::on_playpause_button_clicked() this->player.pause(); } #else - // aa13q + if(this->player.playbackState() != QMediaPlayer::PlayingState) { + this->player.play(); + } else { + this->player.pause(); + } #endif } @@ -99,7 +104,7 @@ void MediaPlayer::on_mute_button_clicked(bool checked) #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) this->player.setMuted(checked); #else - // aa13q + this->player.audioOutput()->setMuted(checked); #endif } -- cgit v1.2.3