diff --git a/plugins/mpriscontrol/mpriscontrolplugin.cpp b/plugins/mpriscontrol/mpriscontrolplugin.cpp --- a/plugins/mpriscontrol/mpriscontrolplugin.cpp +++ b/plugins/mpriscontrol/mpriscontrolplugin.cpp @@ -96,6 +96,19 @@ OrgMprisMediaPlayer2PlayerInterface* mprisInterface0 = new OrgMprisMediaPlayer2PlayerInterface(service, QStringLiteral("/org/mpris/MediaPlayer2"), QDBusConnection::sessionBus()); connect(mprisInterface0, &OrgMprisMediaPlayer2PlayerInterface::Seeked, this, &MprisControlPlugin::seeked); + + // init with current status + QVariantMap properties { + { QStringLiteral("Volume"), mprisInterface0->volume() }, + { QStringLiteral("Metadata"), mprisInterface0->metadata() }, + { QStringLiteral("PlaybackStatus"), mprisInterface0->playbackStatus() }, + { QStringLiteral("CanPause"), mprisInterface0->canPause() }, + { QStringLiteral("CanPlay"), mprisInterface0->canPlay() }, + { QStringLiteral("CanGoNext"), mprisInterface0->canGoNext() }, + { QStringLiteral("CanGoPrevious"), mprisInterface0->canGoPrevious() }, + { QStringLiteral("CanSeek"), mprisInterface0->canSeek() }, + }; + Q_EMIT freedesktopInterface->PropertiesChanged(QString()/*ignored*/, properties, QStringList()/*ignored*/); } void MprisControlPlugin::seeked(qlonglong position){ @@ -115,6 +128,9 @@ { Q_UNUSED(propertyInterface); +// temporary for finding which information is sent to remote +qDebug() << "KDECONNECT MPRIS UPDATE" << properties; + NetworkPacket np(PACKET_TYPE_MPRIS); bool somethingToSend = false; if (properties.contains(QStringLiteral("Volume"))) {