- Make usage (of lack of) of CS when setting/getting mixer weights more clear in the implementation

- Fix typo in IN_VOLUME_IN_MIXER define
This commit is contained in:
Ross Owen
2023-02-08 11:59:13 +00:00
parent 6c2e7e3042
commit f80d7647e0
3 changed files with 38 additions and 41 deletions

View File

@@ -250,9 +250,9 @@ static int get_num_mixer_units(const unsigned char *data, int length) {
static double dev_get_mixer_value(unsigned int mixer, unsigned int nodeId)
{
// MU_MIXER_CONTROL 0x01
short data;
usb_audio_class_get(CUR, ((unsigned char) (0x01<<8)), nodeId, usb_mixers->usb_mixer[mixer].id, 2,(unsigned char *) &data);
unsigned char cs = 0; /* Device doesnt use CS for getting/setting mixer weights */
usb_audio_class_get(CUR, cs, nodeId, usb_mixers->usb_mixer[mixer].id, 2,(unsigned char *) &data);
return ((double) data / 256);
}
@@ -868,8 +868,10 @@ int usb_mixer_set_value(unsigned int mixer, unsigned int nodeId, double val)
/* write to device */
short value = (short) (val * 256);
usb_audio_class_set(CUR, 1, 1<<8 | nodeId & 0xff, usb_mixers->usb_mixer[mixer].id, 2, (unsigned char *)&value);
unsigned char cs = 0; /* Device doesnt use CS for setting/getting mixer nodes */
unsigned char cn = nodeId & 0xff;
usb_audio_class_set(CUR, cs, cn, usb_mixers->usb_mixer[mixer].id, 2, (unsigned char *)&value);
}
return 0;