use of org.kde.kdeconnect.NetworkPacket in project kdeconnect-android by KDE.
the class MprisPlugin method requestPlayerList.
private void requestPlayerList() {
NetworkPacket np = new NetworkPacket(PACKET_TYPE_MPRIS_REQUEST);
np.set("requestPlayerList", true);
device.sendPacket(np);
}
use of org.kde.kdeconnect.NetworkPacket in project kdeconnect-android by KDE.
the class MprisPlugin method sendCommand.
private void sendCommand(String player, String method, int value) {
NetworkPacket np = new NetworkPacket(PACKET_TYPE_MPRIS_REQUEST);
np.set("player", player);
np.set(method, value);
device.sendPacket(np);
}
use of org.kde.kdeconnect.NetworkPacket in project kdeconnect-android by KDE.
the class MprisPlugin method askTransferAlbumArt.
public boolean askTransferAlbumArt(String url, String playerName) {
// First check if the remote supports transferring album art
if (!supportAlbumArtPayload)
return false;
if (url.isEmpty())
return false;
MprisPlayer player = getPlayerStatus(playerName);
if (player == null)
return false;
if (player.albumArtUrl.equals(url)) {
NetworkPacket np = new NetworkPacket(PACKET_TYPE_MPRIS_REQUEST);
np.set("player", player.getPlayer());
np.set("albumArtUrl", url);
device.sendPacket(np);
return true;
}
return false;
}
use of org.kde.kdeconnect.NetworkPacket in project kdeconnect-android by KDE.
the class MprisPlugin method sendCommand.
private void sendCommand(String player, String method, String value) {
NetworkPacket np = new NetworkPacket(PACKET_TYPE_MPRIS_REQUEST);
np.set("player", player);
np.set(method, value);
device.sendPacket(np);
}
use of org.kde.kdeconnect.NetworkPacket in project kdeconnect-android by KDE.
the class MprisReceiverPlugin method sendMetadata.
void sendMetadata(MprisReceiverPlayer player) {
NetworkPacket np = new NetworkPacket(MprisReceiverPlugin.PACKET_TYPE_MPRIS);
np.set("player", player.getName());
if (player.getArtist().isEmpty()) {
np.set("nowPlaying", player.getTitle());
} else {
np.set("nowPlaying", player.getArtist() + " - " + player.getTitle());
}
np.set("title", player.getTitle());
np.set("artist", player.getArtist());
np.set("album", player.getAlbum());
np.set("isPlaying", player.isPlaying());
np.set("pos", player.getPosition());
np.set("length", player.getLength());
np.set("canPlay", player.canPlay());
np.set("canPause", player.canPause());
np.set("canGoPrevious", player.canGoPrevious());
np.set("canGoNext", player.canGoNext());
np.set("canSeek", player.canSeek());
np.set("volume", player.getVolume());
device.sendPacket(np);
}
Aggregations