summaryrefslogtreecommitdiffstats
path: root/app/mixer.cpp
diff options
context:
space:
mode:
authorLi Xiaoming <lixm.fnst@cn.fujitsu.com>2019-08-05 09:07:42 +0800
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2019-08-06 12:30:44 +0000
commit775de9c9628622b749fdc5ea3632b8dd14977e5e (patch)
tree51fc0b88d9abba1722631688564aa8ea206d9ac7 /app/mixer.cpp
parent698123549128a1a1741e703f3513abd206b70643 (diff)
Fix implicit conversions warning
Bug-AGL: SPEC-2422 Change-Id: I75df069462720be45886554baeded4009ca2b39e Signed-off-by: Li Xiaoming <lixm.fnst@cn.fujitsu.com>
Diffstat (limited to 'app/mixer.cpp')
-rw-r--r--app/mixer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/mixer.cpp b/app/mixer.cpp
index e37e741..082ca12 100644
--- a/app/mixer.cpp
+++ b/app/mixer.cpp
@@ -63,7 +63,7 @@ void Mixer::parseControls(const QJsonValue & v)
for (const QJsonValue & av : v.toArray()) {
QString name = av.toObject()["control"].toString();
- int value = av.toObject()["volume"].toDouble() * 100;
+ int value = static_cast<int>(av.toObject()["volume"].toDouble() * 100);
value = qBound(0, value, 100);
AudioRole *ar = new AudioRole(name, value);
@@ -117,7 +117,7 @@ void Mixer::onClientEventReceived(QString eventName, const QJsonValue& data)
}
else if (eventName == "audiomixer/volume_changed") {
QString name = data.toObject()["control"].toString();
- int value = data.toObject()["value"].toDouble() * 100;
+ int value = static_cast<int>(data.toObject()["value"].toDouble() * 100);
value = qBound(0, value, 100);
for (QObject *o : m_roles) {