diff options
author | George Kiagiadakis <george.kiagiadakis@collabora.com> | 2021-05-10 12:18:21 +0300 |
---|---|---|
committer | George Kiagiadakis <george.kiagiadakis@collabora.com> | 2021-05-25 15:55:34 +0300 |
commit | 9d9376910ff252c9d1116ee1fe30464db9ce1931 (patch) | |
tree | ca34bd799a00a2aae1e7476872a38dade2226fbc | |
parent | df594140c5940dbc518b8c68aad80511fdd8080e (diff) |
homescreen: fix master volume control namekoi_11.0.5koi_11.0.4koi_11.0.3koi_11.0.2koi/11.0.5koi/11.0.4koi/11.0.3koi/11.0.211.0.511.0.411.0.311.0.2koi
Fixes the master volume control on the homescreen, which broke after
I renamed the control in agl-service-audiomixer to "Master Playback"
Bug-AGL: SPEC-3844
Signed-off-by: George Kiagiadakis <george.kiagiadakis@collabora.com>
Change-Id: Iadc859b29d823a703865a301877a75575a78a650
-rw-r--r-- | homescreen/src/mastervolume.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/homescreen/src/mastervolume.cpp b/homescreen/src/mastervolume.cpp index 98b884d..43beaef 100644 --- a/homescreen/src/mastervolume.cpp +++ b/homescreen/src/mastervolume.cpp @@ -19,6 +19,8 @@ #include <QTimer> #include <QtDebug> +#define MASTER_CONTROL "Master Playback" + MasterVolume::MasterVolume(QObject* parent) : QObject(parent) , m_volume{50} @@ -46,7 +48,7 @@ void MasterVolume::setVolume(qint32 volume) { m_volume = volume; QJsonObject arg; - arg.insert("control", "Master"); + arg.insert("control", MASTER_CONTROL); double v = (double) volume / 100.0; arg.insert("value", v); m_client.call("audiomixer", "volume", arg); @@ -56,7 +58,7 @@ void MasterVolume::setVolume(qint32 volume) void MasterVolume::onClientConnected() { QJsonObject arg; - arg.insert("control", "Master"); + 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; @@ -92,7 +94,7 @@ void MasterVolume::onClientEventReceived(QString name, const QJsonValue& data) { QString ctlName = data.toObject()["control"].toString(); - if (ctlName != "Master") + if (ctlName != MASTER_CONTROL) return; int volume = data.toObject()["value"].toDouble() * 100; |