Commit ebd7e534 authored by Art Pinch's avatar Art Pinch Committed by Simon Redman
Browse files

[SystemVolumePlugin][PulseAudio] Send data about default audio device

parent 69898ca5
......@@ -80,12 +80,20 @@ void SystemvolumePlugin::sendSinkList() {
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 {
{QStringLiteral("name"), sink->name()},
{QStringLiteral("muted"), sink->isMuted()},
{QStringLiteral("description"), sink->description()},
{QStringLiteral("volume"), sink->volume()},
{QStringLiteral("maxVolume"), PulseAudioQt::normalVolume()}
{QStringLiteral("maxVolume"), PulseAudioQt::normalVolume()},
{QStringLiteral("enabled"), sink->isDefault()}
};
array.append(sinkObject);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment