fulup-bzh/AlsaJsonGateway

key named "value" for mixer controls is type of Array

Closed this issue · 2 comments

An example control from my mixer looks like

{
  "numid": 9,
  "name": "Line 03 (Headphones 1 L) Playback Volume",
  "iface": "MIXER",
  "actif": true,
  "value": [
    127
  ],
  "ctrl": {
    "type": "INTEGER",
    "count": 1,
    "min": 0,
    "max": 127,
    "step": 1
  },
  "acl": {
    "read": true,
    "write": true,
    "inact": false,
    "volat": false,
    "lock": false
  },
  "tlv": {
    "dbminmax": {
      "min": "-127.00dB",
      "max": "0.00dB"
    }
  }
}

It seems odd that the numerical value of the control is an Array rather than an Integer. Are there single mixer controls that have more than one value?

The value is an integer because you may get multiple values. In you sample CTRL the count is '1', would count be '2' for a right/left control then you would have two values in your array.

This being said when you set a control, you may provide an array or an integer. In this case the integer value is duplicated of 'count' value as if you had provided an array with equal values.

Thanks, that makes sense. I don't think the Scarlett model I have exposes controls with many values but I'd imagine there are some out there.