X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=app%2Fmixer.cpp;h=082ca123eb7b5d733217f88fde4182ff1a1c5533;hb=refs%2Ftags%2Fhalibut_8.0.3;hp=fae2e6a595e5c058e17d19d9a30ed80ea9f74ac2;hpb=38598f4a2a84b6727bcbaefbe79da0ba740d32d2;p=apps%2Fmixer.git diff --git a/app/mixer.cpp b/app/mixer.cpp index fae2e6a..082ca12 100644 --- a/app/mixer.cpp +++ b/app/mixer.cpp @@ -49,7 +49,7 @@ void Mixer::setRoleVolume(AudioRole* role) QJsonObject arg; arg.insert("control", role->Name().toLocal8Bit().data()); - arg.insert("value", QJsonValue(role->Value())); + arg.insert("value", QJsonValue(role->Value() / 100.0)); m_client.call("audiomixer", "volume", arg); } @@ -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(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(data.toObject()["value"].toDouble() * 100); value = qBound(0, value, 100); for (QObject *o : m_roles) {