summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
df59414)
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
#include <QTimer>
#include <QtDebug>
#include <QTimer>
#include <QtDebug>
+#define MASTER_CONTROL "Master Playback"
+
MasterVolume::MasterVolume(QObject* parent)
: QObject(parent)
, m_volume{50}
MasterVolume::MasterVolume(QObject* parent)
: QObject(parent)
, m_volume{50}
{
m_volume = volume;
QJsonObject arg;
{
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);
double v = (double) volume / 100.0;
arg.insert("value", v);
m_client.call("audiomixer", "volume", arg);
void MasterVolume::onClientConnected()
{
QJsonObject arg;
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;
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;
{
QString ctlName = data.toObject()["control"].toString();
{
QString ctlName = data.toObject()["control"].toString();
- if (ctlName != "Master")
+ if (ctlName != MASTER_CONTROL)
return;
int volume = data.toObject()["value"].toDouble() * 100;
return;
int volume = data.toObject()["value"].toDouble() * 100;