- QJsonObject arg;
- arg.insert("control", MASTER_CONTROL);
- m_client.call("audiomixer", "volume", arg, [this](bool r, const QJsonValue& v) {
- if (r && v.isObject()) {
- int volume = v.toObject()["response"].toObject()["volume"].toDouble() * 100;
- volume = qBound(0, volume, 100);
- if (m_volume != volume)
- {
- m_volume = volume;
- emit VolumeChanged();
- }
- }
-
- QJsonObject arg;
- arg.insert("event", "volume_changed");
- m_client.call("audiomixer", "subscribe", arg);
- });