2018-11-07 19:54:00 +00:00
|
|
|
/**
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-FileCopyrightText: 2018 Nicolas Fella <nicolas.fella@gmx.de>
|
2018-11-07 19:54:00 +00:00
|
|
|
*
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
2018-11-07 19:54:00 +00:00
|
|
|
*/
|
|
|
|
|
2023-07-21 19:22:59 +01:00
|
|
|
#pragma once
|
2018-11-07 19:54:00 +00:00
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
#include <core/kdeconnectplugin.h>
|
|
|
|
|
|
|
|
#define PACKET_TYPE_SYSTEMVOLUME QStringLiteral("kdeconnect.systemvolume")
|
|
|
|
#define PACKET_TYPE_SYSTEMVOLUME_REQUEST QStringLiteral("kdeconnect.systemvolume.request")
|
|
|
|
|
2023-07-22 10:37:35 +01:00
|
|
|
class RemoteSystemVolumePlugin : public KdeConnectPlugin
|
2018-11-07 19:54:00 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_CLASSINFO("D-Bus Interface", "org.kde.kdeconnect.device.remotesystemvolume")
|
|
|
|
Q_PROPERTY(QByteArray sinks READ sinks NOTIFY sinksChanged)
|
|
|
|
Q_PROPERTY(QString deviceId READ deviceId CONSTANT)
|
|
|
|
|
|
|
|
public:
|
2023-07-28 09:36:48 +01:00
|
|
|
using KdeConnectPlugin::KdeConnectPlugin;
|
2018-11-07 19:54:00 +00:00
|
|
|
|
2023-07-31 08:25:45 +01:00
|
|
|
void receivePacket(const NetworkPacket &np) override;
|
2018-11-07 19:54:00 +00:00
|
|
|
void connected() override;
|
|
|
|
QString dbusPath() const override;
|
|
|
|
|
2022-09-10 22:23:52 +01:00
|
|
|
QString deviceId() const
|
|
|
|
{
|
|
|
|
return device()->id();
|
|
|
|
}
|
2018-11-07 19:54:00 +00:00
|
|
|
QByteArray sinks();
|
|
|
|
|
2022-09-10 22:23:52 +01:00
|
|
|
Q_SCRIPTABLE void sendVolume(const QString &name, int volume);
|
|
|
|
Q_SCRIPTABLE void sendMuted(const QString &name, bool muted);
|
2018-11-07 19:54:00 +00:00
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
Q_SCRIPTABLE void sinksChanged();
|
2022-09-10 22:23:52 +01:00
|
|
|
Q_SCRIPTABLE void volumeChanged(const QString &name, int volume);
|
|
|
|
Q_SCRIPTABLE void mutedChanged(const QString &name, bool muted);
|
2018-11-07 19:54:00 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
QByteArray m_sinks;
|
|
|
|
};
|