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 14:48:02 +01:00
|
|
|
#ifndef MPRISCONTROLPLUGIN_H
|
|
|
|
#define MPRISCONTROLPLUGIN_H
|
2013-07-29 17:43:13 +01:00
|
|
|
|
|
|
|
#include <QString>
|
2013-07-30 19:21:06 +01:00
|
|
|
#include <QHash>
|
2013-07-29 17:43:13 +01:00
|
|
|
|
2014-06-14 15:34:00 +01:00
|
|
|
#include <core/kdeconnectplugin.h>
|
2013-08-13 05:35:58 +01:00
|
|
|
|
2013-10-11 14:19:23 +01:00
|
|
|
#define PACKAGE_TYPE_MPRIS QLatin1String("kdeconnect.mpris")
|
|
|
|
|
2013-08-13 05:35:58 +01:00
|
|
|
class MprisControlPlugin
|
|
|
|
: public KdeConnectPlugin
|
2013-07-29 17:43:13 +01:00
|
|
|
{
|
2013-07-30 19:21:06 +01:00
|
|
|
Q_OBJECT
|
|
|
|
|
2013-07-29 17:43:13 +01:00
|
|
|
public:
|
2013-08-13 05:35:58 +01:00
|
|
|
explicit MprisControlPlugin(QObject *parent, const QVariantList &args);
|
|
|
|
|
|
|
|
public Q_SLOTS:
|
|
|
|
virtual bool receivePackage(const NetworkPackage& np);
|
2013-08-22 02:21:08 +01:00
|
|
|
virtual void connected() { }
|
2013-07-29 17:43:13 +01:00
|
|
|
|
2013-08-10 04:21:55 +01:00
|
|
|
private Q_SLOTS:
|
2013-07-30 19:21:06 +01:00
|
|
|
void serviceOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner);
|
2013-11-18 01:34:34 +00:00
|
|
|
void propertiesChanged(const QString& propertyInterface, const QVariantMap& properties);
|
2014-12-13 22:41:53 +00:00
|
|
|
void seeked(qlonglong);
|
2013-07-30 19:21:06 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
void addPlayer(const QString& ifaceName);
|
|
|
|
void removePlayer(const QString& ifaceName);
|
2013-08-13 05:35:58 +01:00
|
|
|
void sendPlayerList();
|
2013-08-13 14:48:02 +01:00
|
|
|
|
|
|
|
QHash<QString, QString> playerList;
|
2013-08-10 04:21:55 +01:00
|
|
|
int prevVolume;
|
2013-07-30 19:21:06 +01:00
|
|
|
|
2013-07-29 17:43:13 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|