mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-30 05:37:43 +00:00
Receive MPRIS title, artist and album information
Summary: Receives the title, artist and album information from MPRIS, instead of a single "artist - title". The desktop counterpart is in D8957. Test Plan: Works for me, both with and without D8957. Reviewers: #kde_connect, nicolasfella Reviewed By: #kde_connect, nicolasfella Subscribers: nicolasfella Differential Revision: https://phabricator.kde.org/D9083
This commit is contained in:
parent
c6746e38a0
commit
8538121ed2
@ -43,6 +43,9 @@ public class MprisPlugin extends Plugin {
|
||||
private String player = "";
|
||||
private boolean playing = false;
|
||||
private String currentSong = "";
|
||||
private String title = "";
|
||||
private String artist = "";
|
||||
private String album = "";
|
||||
private int volume = 50;
|
||||
private long length = -1;
|
||||
private long lastPosition = 0;
|
||||
@ -61,6 +64,18 @@ public class MprisPlugin extends Plugin {
|
||||
return currentSong;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public String getArtist() {
|
||||
return artist;
|
||||
}
|
||||
|
||||
public String getAlbum() {
|
||||
return album;
|
||||
}
|
||||
|
||||
public String getPlayer() {
|
||||
return player;
|
||||
}
|
||||
@ -230,6 +245,10 @@ public class MprisPlugin extends Plugin {
|
||||
MprisPlayer playerStatus = players.get(np.getString("player"));
|
||||
if (playerStatus != null) {
|
||||
playerStatus.currentSong = np.getString("nowPlaying", playerStatus.currentSong);
|
||||
//Note: title, artist and album will not be available for all desktop clients
|
||||
playerStatus.title = np.getString("title", playerStatus.title);
|
||||
playerStatus.artist = np.getString("artist", playerStatus.artist);
|
||||
playerStatus.album = np.getString("album", playerStatus.album);
|
||||
playerStatus.volume = np.getInt("volume", playerStatus.volume);
|
||||
playerStatus.length = np.getLong("length", playerStatus.length);
|
||||
if(np.has("pos")){
|
||||
|
Loading…
x
Reference in New Issue
Block a user