[SystemVolumePlugin][PulseAudio] Send data about default audio device
This commit is contained in:
parent
69898ca553
commit
ebd7e53440
1 changed files with 9 additions and 1 deletions
|
@ -80,12 +80,20 @@ void SystemvolumePlugin::sendSinkList() {
|
||||||
sendPacket(np);
|
sendPacket(np);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
connect(sink, &PulseAudioQt::Sink::defaultChanged, this, [this, sink] {
|
||||||
|
NetworkPacket np(PACKET_TYPE_SYSTEMVOLUME);
|
||||||
|
np.set<bool>(QStringLiteral("enabled"), sink->isDefault());
|
||||||
|
np.set<QString>(QStringLiteral("name"), sink->name());
|
||||||
|
sendPacket(np);
|
||||||
|
});
|
||||||
|
|
||||||
QJsonObject sinkObject {
|
QJsonObject sinkObject {
|
||||||
{QStringLiteral("name"), sink->name()},
|
{QStringLiteral("name"), sink->name()},
|
||||||
{QStringLiteral("muted"), sink->isMuted()},
|
{QStringLiteral("muted"), sink->isMuted()},
|
||||||
{QStringLiteral("description"), sink->description()},
|
{QStringLiteral("description"), sink->description()},
|
||||||
{QStringLiteral("volume"), sink->volume()},
|
{QStringLiteral("volume"), sink->volume()},
|
||||||
{QStringLiteral("maxVolume"), PulseAudioQt::normalVolume()}
|
{QStringLiteral("maxVolume"), PulseAudioQt::normalVolume()},
|
||||||
|
{QStringLiteral("enabled"), sink->isDefault()}
|
||||||
};
|
};
|
||||||
|
|
||||||
array.append(sinkObject);
|
array.append(sinkObject);
|
||||||
|
|
Loading…
Reference in a new issue