Improve Qt 6 support

Add missing mediaplayer widget logic

Contributes to:
https://github.com/MasterQ32/kristall/pull/266
This commit is contained in:
Alexey Andreyev 2023-03-25 19:29:03 +03:00 committed by Felix Queißner
parent b833a5d261
commit a63178f48f
1 changed files with 7 additions and 2 deletions

View File

@ -10,6 +10,7 @@
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QMediaContent>
#else
#include <QAudioOutput>
#include <QUrl>
#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
}