Support multiple players in MprisRemote
ClosedPublic

Authored by nicolasfella on Apr 26 2018, 8:11 PM.

Details

Summary

Current code only supports one player

Test Plan

Run two media sessions. Dbus inspection works fine, UI has some issues with values not updated, but out of scope for this diff

Diff Detail

Repository
R224 KDE Connect
Branch
titleartistalbum
Lint
No Linters Available
Unit
No Unit Test Coverage
nicolasfella requested review of this revision.Apr 26 2018, 8:11 PM
nicolasfella created this revision.
  • Fix build
  • fix UI not updating
  • Add new properties to interfaces
apol added a subscriber: apol.Apr 27 2018, 10:05 AM

Other than that looks good to me. Thanks!

plugins/mprisremote/mprisremoteplugin.cpp
205 ↗(On Diff #33168)

While this will work, if the map ever gets out of sync we could get a crash.

Maybe it's just safer to do something like:

auto player = m_players.value(m_currentPlayer);
return player ? player->album() : QString();
  • Implement Aleix's suggestion
nicolasfella marked an inline comment as done.Apr 27 2018, 7:21 PM
apol accepted this revision.Apr 27 2018, 10:20 PM
This revision is now accepted and ready to land.Apr 27 2018, 10:20 PM
This revision was automatically updated to reflect the committed changes.