2013-07-29 17:43:13 +01:00
|
|
|
/**
|
|
|
|
* Copyright 2013 Albert Vaca <albertvaka@gmail.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of
|
|
|
|
* the License or (at your option) version 3 or any later version
|
|
|
|
* accepted by the membership of KDE e.V. (or its successor approved
|
|
|
|
* by the membership of KDE e.V.), which shall act as a proxy
|
|
|
|
* defined in Section 14 of version 3 of the license.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2013-08-13 05:35:58 +01:00
|
|
|
#include "mpriscontrolplugin.h"
|
2013-07-29 17:43:13 +01:00
|
|
|
|
2013-09-03 01:14:27 +01:00
|
|
|
#include <QDBusArgument>
|
2013-07-29 17:43:13 +01:00
|
|
|
#include <QDBusConnection>
|
|
|
|
#include <QDBusInterface>
|
|
|
|
#include <qdbusconnectioninterface.h>
|
|
|
|
#include <QDBusReply>
|
|
|
|
#include <QDBusMessage>
|
2015-05-05 00:40:04 +01:00
|
|
|
#include <QDBusServiceWatcher>
|
2013-07-29 17:43:13 +01:00
|
|
|
|
2014-09-22 01:37:10 +01:00
|
|
|
#include <KPluginFactory>
|
|
|
|
|
2014-06-14 15:34:00 +01:00
|
|
|
#include <core/device.h>
|
2013-11-06 21:16:55 +00:00
|
|
|
#include "mprisdbusinterface.h"
|
|
|
|
#include "propertiesdbusinterface.h"
|
|
|
|
|
2015-03-19 15:36:53 +00:00
|
|
|
K_PLUGIN_FACTORY_WITH_JSON( KdeConnectPluginFactory, "kdeconnect_mpriscontrol.json", registerPlugin< MprisControlPlugin >(); )
|
2013-08-13 05:35:58 +01:00
|
|
|
|
2014-09-21 23:44:47 +01:00
|
|
|
Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_MPRIS, "kdeconnect.plugin.mpris")
|
|
|
|
|
2013-08-13 05:35:58 +01:00
|
|
|
MprisControlPlugin::MprisControlPlugin(QObject* parent, const QVariantList& args)
|
|
|
|
: KdeConnectPlugin(parent, args)
|
2015-05-05 00:40:04 +01:00
|
|
|
, prevVolume(-1)
|
2013-07-29 17:43:13 +01:00
|
|
|
{
|
2015-09-11 10:27:18 +01:00
|
|
|
m_watcher = new QDBusServiceWatcher(QString(), QDBusConnection::sessionBus(), QDBusServiceWatcher::WatchForOwnerChange, this);
|
2013-07-30 19:21:06 +01:00
|
|
|
|
2016-04-08 00:12:10 +01:00
|
|
|
// TODO: QDBusConnectionInterface::serviceOwnerChanged is deprecated, maybe query org.freedesktop.DBus directly?
|
|
|
|
connect(QDBusConnection::sessionBus().interface(), &QDBusConnectionInterface::serviceOwnerChanged, this, &MprisControlPlugin::serviceOwnerChanged);
|
2013-07-30 19:21:06 +01:00
|
|
|
|
|
|
|
//Add existing interfaces
|
2017-07-20 15:14:07 +01:00
|
|
|
const QStringList services = QDBusConnection::sessionBus().interface()->registeredServiceNames().value();
|
|
|
|
for (const QString& service : services) {
|
2016-04-08 00:12:10 +01:00
|
|
|
// The string doesn't matter, it just needs to be empty/non-empty
|
2016-11-26 14:38:08 +00:00
|
|
|
serviceOwnerChanged(service, QLatin1String(""), QStringLiteral("1"));
|
2013-07-30 19:21:06 +01:00
|
|
|
}
|
2015-09-11 10:27:18 +01:00
|
|
|
}
|
|
|
|
|
2016-04-08 00:12:10 +01:00
|
|
|
// Copied from the mpris2 dataengine in the plasma-workspace repository
|
|
|
|
void MprisControlPlugin::serviceOwnerChanged(const QString& serviceName, const QString& oldOwner, const QString& newOwner)
|
2015-09-11 10:27:18 +01:00
|
|
|
{
|
2016-04-08 00:12:10 +01:00
|
|
|
if (!serviceName.startsWith(QLatin1String("org.mpris.MediaPlayer2.")))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (!oldOwner.isEmpty()) {
|
|
|
|
qCDebug(KDECONNECT_PLUGIN_MPRIS) << "MPRIS service" << serviceName << "just went offline";
|
|
|
|
removePlayer(serviceName);
|
2015-09-11 10:27:18 +01:00
|
|
|
}
|
2013-07-30 19:21:06 +01:00
|
|
|
|
2016-04-08 00:12:10 +01:00
|
|
|
if (!newOwner.isEmpty()) {
|
|
|
|
qCDebug(KDECONNECT_PLUGIN_MPRIS) << "MPRIS service" << serviceName << "just came online";
|
|
|
|
addPlayer(serviceName);
|
2015-09-11 10:27:18 +01:00
|
|
|
}
|
2013-07-30 19:21:06 +01:00
|
|
|
}
|
|
|
|
|
2015-09-11 10:27:18 +01:00
|
|
|
|
2013-08-13 05:35:58 +01:00
|
|
|
void MprisControlPlugin::addPlayer(const QString& service)
|
2013-07-30 19:21:06 +01:00
|
|
|
{
|
2016-11-26 14:38:08 +00:00
|
|
|
QDBusInterface mprisInterface(service, QStringLiteral("/org/mpris/MediaPlayer2"), QStringLiteral("org.mpris.MediaPlayer2"));
|
2013-09-03 01:35:08 +01:00
|
|
|
//FIXME: This call hangs and returns an empty string if KDED is still starting!
|
2015-11-11 19:00:59 +00:00
|
|
|
QString identity = mprisInterface.property("Identity").toString();
|
|
|
|
if (identity.isEmpty()) {
|
|
|
|
identity = service.mid(sizeof("org.mpris.MediaPlayer2"));
|
|
|
|
}
|
2013-08-10 04:21:55 +01:00
|
|
|
playerList[identity] = service;
|
2014-09-21 23:44:47 +01:00
|
|
|
qCDebug(KDECONNECT_PLUGIN_MPRIS) << "Mpris addPlayer" << service << "->" << identity;
|
2013-07-30 19:21:06 +01:00
|
|
|
sendPlayerList();
|
2013-08-10 04:21:55 +01:00
|
|
|
|
2016-11-26 14:38:08 +00:00
|
|
|
OrgFreedesktopDBusPropertiesInterface* freedesktopInterface = new OrgFreedesktopDBusPropertiesInterface(service, QStringLiteral("/org/mpris/MediaPlayer2"), QDBusConnection::sessionBus(), this);
|
2016-11-26 14:12:38 +00:00
|
|
|
connect(freedesktopInterface, &OrgFreedesktopDBusPropertiesInterface::PropertiesChanged, this, &MprisControlPlugin::propertiesChanged);
|
2013-08-10 04:21:55 +01:00
|
|
|
|
2016-11-26 14:38:08 +00:00
|
|
|
OrgMprisMediaPlayer2PlayerInterface* mprisInterface0 = new OrgMprisMediaPlayer2PlayerInterface(service, QStringLiteral("/org/mpris/MediaPlayer2"), QDBusConnection::sessionBus());
|
2016-11-26 14:12:38 +00:00
|
|
|
connect(mprisInterface0, &OrgMprisMediaPlayer2PlayerInterface::Seeked, this, &MprisControlPlugin::seeked);
|
2014-12-13 22:41:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void MprisControlPlugin::seeked(qlonglong position){
|
2015-04-22 08:16:14 +01:00
|
|
|
//qCDebug(KDECONNECT_PLUGIN_MPRIS) << "Seeked in player";
|
2014-12-13 22:41:53 +00:00
|
|
|
OrgFreedesktopDBusPropertiesInterface* interface = (OrgFreedesktopDBusPropertiesInterface*)sender();
|
|
|
|
const QString& service = interface->service();
|
|
|
|
const QString& player = playerList.key(service);
|
2016-06-21 19:07:12 +01:00
|
|
|
|
|
|
|
NetworkPackage np(PACKAGE_TYPE_MPRIS, {
|
|
|
|
{"pos", position/1000}, //Send milis instead of nanos
|
|
|
|
{"player", player}
|
|
|
|
});
|
2014-12-13 22:41:53 +00:00
|
|
|
sendPackage(np);
|
2013-07-30 19:21:06 +01:00
|
|
|
}
|
|
|
|
|
2013-08-13 05:35:58 +01:00
|
|
|
void MprisControlPlugin::propertiesChanged(const QString& propertyInterface, const QVariantMap& properties)
|
2013-07-30 19:21:06 +01:00
|
|
|
{
|
2013-08-13 22:26:42 +01:00
|
|
|
Q_UNUSED(propertyInterface);
|
2014-07-01 22:59:38 +01:00
|
|
|
|
2013-08-10 04:21:55 +01:00
|
|
|
NetworkPackage np(PACKAGE_TYPE_MPRIS);
|
|
|
|
bool somethingToSend = false;
|
2016-11-26 14:38:08 +00:00
|
|
|
if (properties.contains(QStringLiteral("Volume"))) {
|
|
|
|
int volume = (int) (properties[QStringLiteral("Volume")].toDouble()*100);
|
2013-08-10 04:21:55 +01:00
|
|
|
if (volume != prevVolume) {
|
2016-11-26 14:38:08 +00:00
|
|
|
np.set(QStringLiteral("volume"),volume);
|
2013-08-10 04:21:55 +01:00
|
|
|
prevVolume = volume;
|
|
|
|
somethingToSend = true;
|
|
|
|
}
|
|
|
|
}
|
2016-11-26 14:38:08 +00:00
|
|
|
if (properties.contains(QStringLiteral("Metadata"))) {
|
|
|
|
QDBusArgument bullshit = qvariant_cast<QDBusArgument>(properties[QStringLiteral("Metadata")]);
|
2013-08-10 04:21:55 +01:00
|
|
|
QVariantMap nowPlayingMap;
|
|
|
|
bullshit >> nowPlayingMap;
|
2016-11-26 14:38:08 +00:00
|
|
|
if (nowPlayingMap.contains(QStringLiteral("xesam:title"))) {
|
|
|
|
QString nowPlaying = nowPlayingMap[QStringLiteral("xesam:title")].toString();
|
|
|
|
if (nowPlayingMap.contains(QStringLiteral("xesam:artist"))) {
|
|
|
|
nowPlaying = nowPlayingMap[QStringLiteral("xesam:artist")].toString() + " - " + nowPlaying;
|
2013-08-10 04:21:55 +01:00
|
|
|
}
|
2016-11-26 14:38:08 +00:00
|
|
|
np.set(QStringLiteral("nowPlaying"),nowPlaying);
|
2013-08-10 04:21:55 +01:00
|
|
|
somethingToSend = true;
|
|
|
|
}
|
2016-11-26 14:38:08 +00:00
|
|
|
if (nowPlayingMap.contains(QStringLiteral("mpris:length"))) {
|
|
|
|
if (nowPlayingMap.contains(QStringLiteral("mpris:length"))) {
|
|
|
|
long long length = nowPlayingMap[QStringLiteral("mpris:length")].toLongLong();
|
|
|
|
np.set(QStringLiteral("length"),length/1000); //milis to nanos
|
2014-12-13 22:41:53 +00:00
|
|
|
}
|
|
|
|
somethingToSend = true;
|
|
|
|
}
|
2013-08-10 04:21:55 +01:00
|
|
|
|
|
|
|
}
|
2016-11-26 14:38:08 +00:00
|
|
|
if (properties.contains(QStringLiteral("PlaybackStatus"))) {
|
|
|
|
bool playing = (properties[QStringLiteral("PlaybackStatus")].toString() == QLatin1String("Playing"));
|
|
|
|
np.set(QStringLiteral("isPlaying"), playing);
|
2013-08-10 04:21:55 +01:00
|
|
|
somethingToSend = true;
|
|
|
|
}
|
2016-11-26 14:38:08 +00:00
|
|
|
if (properties.contains(QStringLiteral("CanPause"))) {
|
|
|
|
np.set(QStringLiteral("canPause"), properties[QStringLiteral("CanPause")].toBool());
|
2016-08-26 10:10:36 +01:00
|
|
|
somethingToSend = true;
|
|
|
|
}
|
2016-11-26 14:38:08 +00:00
|
|
|
if (properties.contains(QStringLiteral("CanPlay"))) {
|
|
|
|
np.set(QStringLiteral("canPlay"), properties[QStringLiteral("CanPlay")].toBool());
|
2016-08-26 10:10:36 +01:00
|
|
|
somethingToSend = true;
|
|
|
|
}
|
2016-11-26 14:38:08 +00:00
|
|
|
if (properties.contains(QStringLiteral("CanGoNext"))) {
|
|
|
|
np.set(QStringLiteral("canGoNext"), properties[QStringLiteral("CanGoNext")].toBool());
|
2016-08-26 10:10:36 +01:00
|
|
|
somethingToSend = true;
|
|
|
|
}
|
2016-11-26 14:38:08 +00:00
|
|
|
if (properties.contains(QStringLiteral("CanGoPrevious"))) {
|
|
|
|
np.set(QStringLiteral("canGoPrevious"), properties[QStringLiteral("CanGoPrevious")].toBool());
|
2016-08-26 10:10:36 +01:00
|
|
|
somethingToSend = true;
|
|
|
|
}
|
2016-11-26 14:38:08 +00:00
|
|
|
if (properties.contains(QStringLiteral("CanSeek"))) {
|
|
|
|
np.set(QStringLiteral("canSeek"), properties[QStringLiteral("CanSeek")].toBool());
|
2016-08-26 10:10:36 +01:00
|
|
|
somethingToSend = true;
|
|
|
|
}
|
2013-08-10 04:21:55 +01:00
|
|
|
|
|
|
|
if (somethingToSend) {
|
|
|
|
OrgFreedesktopDBusPropertiesInterface* interface = (OrgFreedesktopDBusPropertiesInterface*)sender();
|
|
|
|
const QString& service = interface->service();
|
|
|
|
const QString& player = playerList.key(service);
|
2016-11-26 14:38:08 +00:00
|
|
|
np.set(QStringLiteral("player"), player);
|
2014-12-13 22:41:53 +00:00
|
|
|
// Always also update the position
|
2016-11-26 14:38:08 +00:00
|
|
|
OrgMprisMediaPlayer2PlayerInterface mprisInterface(service, QStringLiteral("/org/mpris/MediaPlayer2"), QDBusConnection::sessionBus());
|
2014-12-14 02:44:20 +00:00
|
|
|
if (mprisInterface.canSeek()) {
|
|
|
|
long long pos = mprisInterface.position();
|
2016-11-26 14:38:08 +00:00
|
|
|
np.set(QStringLiteral("pos"), pos/1000); //Send milis instead of nanos
|
2014-12-14 02:44:20 +00:00
|
|
|
}
|
2014-06-14 19:35:00 +01:00
|
|
|
sendPackage(np);
|
2013-08-10 04:21:55 +01:00
|
|
|
}
|
2013-07-30 19:21:06 +01:00
|
|
|
}
|
|
|
|
|
2013-08-13 05:35:58 +01:00
|
|
|
void MprisControlPlugin::removePlayer(const QString& ifaceName)
|
2013-07-30 19:21:06 +01:00
|
|
|
{
|
2014-02-28 17:50:06 +00:00
|
|
|
const QString identity = playerList.key(ifaceName);
|
2014-09-21 23:44:47 +01:00
|
|
|
qCDebug(KDECONNECT_PLUGIN_MPRIS) << "Mpris removePlayer" << ifaceName << "->" << identity;
|
2013-09-03 01:35:08 +01:00
|
|
|
playerList.remove(identity);
|
2013-08-10 04:21:55 +01:00
|
|
|
sendPlayerList();
|
2013-07-29 17:43:13 +01:00
|
|
|
}
|
|
|
|
|
2013-08-13 05:35:58 +01:00
|
|
|
bool MprisControlPlugin::receivePackage (const NetworkPackage& np)
|
2013-07-29 17:43:13 +01:00
|
|
|
{
|
2016-11-26 14:38:08 +00:00
|
|
|
if (np.has(QStringLiteral("playerList"))) {
|
2013-09-03 01:06:56 +01:00
|
|
|
return false; //Whoever sent this is an mpris client and not an mpris control!
|
|
|
|
}
|
2013-07-29 17:43:13 +01:00
|
|
|
|
2013-08-10 04:21:55 +01:00
|
|
|
//Send the player list
|
2016-11-26 14:38:08 +00:00
|
|
|
const QString player = np.get<QString>(QStringLiteral("player"));
|
2013-08-10 04:21:55 +01:00
|
|
|
bool valid_player = playerList.contains(player);
|
2016-11-26 14:38:08 +00:00
|
|
|
if (!valid_player || np.get<bool>(QStringLiteral("requestPlayerList"))) {
|
2013-08-13 05:35:58 +01:00
|
|
|
sendPlayerList();
|
2013-08-10 04:21:55 +01:00
|
|
|
if (!valid_player) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
2013-07-29 17:43:13 +01:00
|
|
|
|
2013-08-10 04:21:55 +01:00
|
|
|
//Do something to the mpris interface
|
2016-11-26 14:38:08 +00:00
|
|
|
OrgMprisMediaPlayer2PlayerInterface mprisInterface(playerList[player], QStringLiteral("/org/mpris/MediaPlayer2"), QDBusConnection::sessionBus());
|
2015-11-11 19:02:08 +00:00
|
|
|
mprisInterface.setTimeout(500);
|
2016-11-26 14:38:08 +00:00
|
|
|
if (np.has(QStringLiteral("action"))) {
|
|
|
|
const QString& action = np.get<QString>(QStringLiteral("action"));
|
2015-04-22 08:16:14 +01:00
|
|
|
//qCDebug(KDECONNECT_PLUGIN_MPRIS) << "Calling action" << action << "in" << playerList[player];
|
2014-10-10 19:47:35 +01:00
|
|
|
//TODO: Check for valid actions, currently we trust anything the other end sends us
|
2013-08-10 04:21:55 +01:00
|
|
|
mprisInterface.call(action);
|
2013-07-30 19:21:06 +01:00
|
|
|
}
|
2016-11-26 14:38:08 +00:00
|
|
|
if (np.has(QStringLiteral("setVolume"))) {
|
|
|
|
double volume = np.get<int>(QStringLiteral("setVolume"))/100.f;
|
2014-09-21 23:44:47 +01:00
|
|
|
qCDebug(KDECONNECT_PLUGIN_MPRIS) << "Setting volume" << volume << "to" << playerList[player];
|
2013-08-10 04:21:55 +01:00
|
|
|
mprisInterface.setVolume(volume);
|
|
|
|
}
|
2016-11-26 14:38:08 +00:00
|
|
|
if (np.has(QStringLiteral("Seek"))) {
|
|
|
|
int offset = np.get<int>(QStringLiteral("Seek"));
|
2015-04-22 08:16:14 +01:00
|
|
|
//qCDebug(KDECONNECT_PLUGIN_MPRIS) << "Seeking" << offset << "to" << playerList[player];
|
2013-10-29 19:17:42 +00:00
|
|
|
mprisInterface.Seek(offset);
|
|
|
|
}
|
2013-08-10 04:21:55 +01:00
|
|
|
|
2016-11-26 14:38:08 +00:00
|
|
|
if (np.has(QStringLiteral("SetPosition"))){
|
|
|
|
qlonglong position = np.get<qlonglong>(QStringLiteral("SetPosition"),0)*1000;
|
2014-12-14 02:44:20 +00:00
|
|
|
qlonglong seek = position - mprisInterface.position();
|
2015-04-22 08:16:14 +01:00
|
|
|
//qCDebug(KDECONNECT_PLUGIN_MPRIS) << "Setting position by seeking" << seek << "to" << playerList[player];
|
2014-12-14 02:44:20 +00:00
|
|
|
mprisInterface.Seek(seek);
|
2014-12-13 22:41:53 +00:00
|
|
|
}
|
|
|
|
|
2013-08-10 04:21:55 +01:00
|
|
|
//Send something read from the mpris interface
|
|
|
|
NetworkPackage answer(PACKAGE_TYPE_MPRIS);
|
|
|
|
bool somethingToSend = false;
|
2016-11-26 14:38:08 +00:00
|
|
|
if (np.get<bool>(QStringLiteral("requestNowPlaying"))) {
|
2013-08-10 04:21:55 +01:00
|
|
|
|
|
|
|
QVariantMap nowPlayingMap = mprisInterface.metadata();
|
2016-11-26 14:38:08 +00:00
|
|
|
QString nowPlaying = nowPlayingMap[QStringLiteral("xesam:title")].toString();
|
|
|
|
if (nowPlayingMap.contains(QStringLiteral("xesam:artist"))) {
|
|
|
|
nowPlaying = nowPlayingMap[QStringLiteral("xesam:artist")].toString() + " - " + nowPlaying;
|
2015-11-11 19:03:00 +00:00
|
|
|
}
|
2016-11-26 14:38:08 +00:00
|
|
|
answer.set(QStringLiteral("nowPlaying"),nowPlaying);
|
2015-11-11 19:03:00 +00:00
|
|
|
|
2016-11-26 14:38:08 +00:00
|
|
|
if (nowPlayingMap.contains(QStringLiteral("mpris:length"))) {
|
|
|
|
qlonglong length = nowPlayingMap[QStringLiteral("mpris:length")].toLongLong();
|
|
|
|
answer.set(QStringLiteral("length"),length/1000);
|
2013-08-10 04:21:55 +01:00
|
|
|
}
|
2014-12-14 02:44:20 +00:00
|
|
|
qlonglong pos = mprisInterface.position();
|
2016-11-26 14:38:08 +00:00
|
|
|
answer.set(QStringLiteral("pos"), pos/1000);
|
2013-08-10 04:21:55 +01:00
|
|
|
|
|
|
|
bool playing = (mprisInterface.playbackStatus() == QLatin1String("Playing"));
|
2016-11-26 14:38:08 +00:00
|
|
|
answer.set(QStringLiteral("isPlaying"), playing);
|
2013-08-10 04:21:55 +01:00
|
|
|
|
2016-11-26 14:38:08 +00:00
|
|
|
answer.set(QStringLiteral("canPause"), mprisInterface.canPause());
|
|
|
|
answer.set(QStringLiteral("canPlay"), mprisInterface.canPlay());
|
|
|
|
answer.set(QStringLiteral("canGoNext"), mprisInterface.canGoNext());
|
|
|
|
answer.set(QStringLiteral("canGoPrevious"), mprisInterface.canGoPrevious());
|
|
|
|
answer.set(QStringLiteral("canSeek"), mprisInterface.canSeek());
|
2016-08-26 10:10:36 +01:00
|
|
|
|
2013-08-10 04:21:55 +01:00
|
|
|
somethingToSend = true;
|
2013-07-30 19:21:06 +01:00
|
|
|
}
|
2016-11-26 14:38:08 +00:00
|
|
|
if (np.get<bool>(QStringLiteral("requestVolume"))) {
|
2013-08-10 04:21:55 +01:00
|
|
|
int volume = (int)(mprisInterface.volume() * 100);
|
2016-11-26 14:38:08 +00:00
|
|
|
answer.set(QStringLiteral("volume"),volume);
|
2013-08-10 04:21:55 +01:00
|
|
|
somethingToSend = true;
|
|
|
|
}
|
|
|
|
if (somethingToSend) {
|
2016-11-26 14:38:08 +00:00
|
|
|
answer.set(QStringLiteral("player"), player);
|
2014-06-14 19:35:00 +01:00
|
|
|
sendPackage(answer);
|
2013-07-29 17:43:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
2013-07-30 19:21:06 +01:00
|
|
|
|
2013-08-13 05:35:58 +01:00
|
|
|
void MprisControlPlugin::sendPlayerList()
|
2013-07-30 19:21:06 +01:00
|
|
|
{
|
2016-06-26 16:11:08 +01:00
|
|
|
NetworkPackage np(PACKAGE_TYPE_MPRIS);
|
2016-11-26 14:38:08 +00:00
|
|
|
np.set(QStringLiteral("playerList"),playerList.keys());
|
2014-06-14 19:35:00 +01:00
|
|
|
sendPackage(np);
|
2013-07-30 19:21:06 +01:00
|
|
|
}
|
2014-06-16 19:02:07 +01:00
|
|
|
|
|
|
|
#include "mpriscontrolplugin.moc"
|