diff --git a/src/mpris2/mediaplayer2player.cpp b/src/mpris2/mediaplayer2player.cpp index fce8467b..3ec7d513 100644 --- a/src/mpris2/mediaplayer2player.cpp +++ b/src/mpris2/mediaplayer2player.cpp @@ -89,6 +89,22 @@ QString MediaPlayer2Player::PlaybackStatus() const result = QStringLiteral("Paused"); } + if (mShowProgressOnTaskBar) { + QVariantMap parameters; + + if (m_audioPlayer->playbackState() == QMediaPlayer::StoppedState || m_audioPlayer->duration() == 0) { + parameters.insert(QStringLiteral("progress-visible"), false); + parameters.insert(QStringLiteral("progress"), 0); + } else { + parameters.insert(QStringLiteral("progress-visible"), true); + parameters.insert(QStringLiteral("progress"), qRound(static_cast(m_position / m_audioPlayer->duration())) / 1000.0); + } + + mProgressIndicatorSignal.setArguments({QStringLiteral("application://org.kde.alligator.desktop"), parameters}); + + QDBusConnection::sessionBus().send(mProgressIndicatorSignal); + } + return result; }