2019-07-02 13:37:01 +01:00
|
|
|
/**
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-FileCopyrightText: 2019 Weixuan XIAO <veyx.shaw@gmail.com>
|
2019-07-02 13:37:01 +01: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
|
2019-07-02 13:37:01 +01:00
|
|
|
*/
|
|
|
|
|
2023-07-21 19:22:59 +01:00
|
|
|
#pragma once
|
2019-07-02 13:37:01 +01:00
|
|
|
|
|
|
|
#include <QMap>
|
2022-09-10 22:23:52 +01:00
|
|
|
#include <QObject>
|
2019-07-02 13:37:01 +01:00
|
|
|
|
|
|
|
#include <core/kdeconnectplugin.h>
|
|
|
|
|
|
|
|
#import <CoreAudio/CoreAudio.h>
|
|
|
|
|
|
|
|
#define PACKET_TYPE_SYSTEMVOLUME QStringLiteral("kdeconnect.systemvolume")
|
|
|
|
#define PACKET_TYPE_SYSTEMVOLUME_REQUEST QStringLiteral("kdeconnect.systemvolume.request")
|
|
|
|
|
|
|
|
class MacOSCoreAudioDevice;
|
|
|
|
|
2023-07-22 10:37:35 +01:00
|
|
|
class SystemvolumePlugin : public KdeConnectPlugin
|
2019-07-02 13:37:01 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit SystemvolumePlugin(QObject *parent, const QVariantList &args);
|
2020-12-07 07:55:01 +00:00
|
|
|
~SystemvolumePlugin();
|
|
|
|
|
2022-09-10 22:23:52 +01:00
|
|
|
bool receivePacket(const NetworkPacket &np) override;
|
2019-07-02 13:37:01 +01:00
|
|
|
void connected() override;
|
|
|
|
void sendSinkList();
|
|
|
|
|
|
|
|
void updateDeviceVolume(AudioDeviceID deviceId);
|
|
|
|
void updateDeviceMuted(AudioDeviceID deviceId);
|
2022-09-10 22:23:52 +01:00
|
|
|
|
2019-07-02 13:37:01 +01:00
|
|
|
private:
|
2022-09-10 22:23:52 +01:00
|
|
|
QMap<QString, MacOSCoreAudioDevice *> m_sinksMap;
|
2019-07-02 13:37:01 +01:00
|
|
|
};
|