- // Subscribe to 4a events
- m_client.call("ahl-4a", "subscribe", QJsonValue(), [this](bool r, const QJsonValue& val) {
- if (r) qDebug() << "Mixer::onClientConnected - subscribed to 4a events!";
- else qCritical () << "Mixer::onClientConnected - Failed to subscribe to 4a events!";
- });
-
- // Call HAL to populate list
- m_client.call("ahl-4a", "get_roles", QJsonValue(), [this](bool r, const QJsonValue& val) {
- if (r)
- {
- for(QObject* role : m_roles) delete role;
- m_roles.clear();
-
- QJsonArray cards = val.toObject()["response"].toArray();
- foreach (const QJsonValue& card, cards)
- {
- AudioRole* ar = new AudioRole(card.toString(), 0);
- getRoleVolume(reinterpret_cast<AudioRole*>(ar));
- connect(ar, SIGNAL(ValueChanged()), this, SLOT(onRoleValueChanged()));
- m_roles.append(ar);
- qDebug() << "Mixer::onClientConnected - added this HAL: " << card.toString();
- }
- emit rolesChanged();
+ m_client.call("audiomixer", "list_controls", QJsonObject(), [this](bool r, const QJsonValue& v) {
+ if (r && v.isObject()) {
+ parseControls(v.toObject()["response"]);