forked from PAWPAW-Mirror/lib_xua
Fixed issues with setting mix map in mixer host app
This commit is contained in:
@@ -252,7 +252,7 @@ static double dev_get_mixer_value(unsigned int mixer, unsigned int nodeId)
|
|||||||
{
|
{
|
||||||
// MU_MIXER_CONTROL 0x01
|
// MU_MIXER_CONTROL 0x01
|
||||||
short data;
|
short data;
|
||||||
usb_audio_class_get(CUR, 0x01<<8, nodeId, usb_mixers->usb_mixer[mixer].id, 2,(unsigned char *) &data);
|
usb_audio_class_get(CUR, ((unsigned char) (0x01<<8)), nodeId, usb_mixers->usb_mixer[mixer].id, 2,(unsigned char *) &data);
|
||||||
return ((double) data / 256);
|
return ((double) data / 256);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -435,8 +435,17 @@ int addStrings(const unsigned char *data, int length, int mixer_index, int id, i
|
|||||||
/* Returns the source of an mix sel output */
|
/* Returns the source of an mix sel output */
|
||||||
static unsigned char get_mixsel_value(unsigned int mixer, unsigned int channel)
|
static unsigned char get_mixsel_value(unsigned int mixer, unsigned int channel)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
unsigned char bRequest = CUR;
|
||||||
|
//unsigned cs = CS_XU_SEL;
|
||||||
|
unsigned char cs = 1; /* Note, currently the host app configures all mix sel's indentically, so if we get one they all should match */
|
||||||
|
unsigned char cn = channel;
|
||||||
|
unsigned short unitId = usb_mixers->usb_mixSel[mixer].id;
|
||||||
|
unsigned short wLength = 1;
|
||||||
unsigned char data[64];
|
unsigned char data[64];
|
||||||
usb_audio_class_get(CUR, CS_XU_SEL, channel, usb_mixers->usb_mixSel[mixer].id, 1, (unsigned char *)data);
|
|
||||||
|
usb_audio_class_get(CUR, cs, cn, unitId, wLength, (unsigned char *)data);
|
||||||
|
|
||||||
return data[0];
|
return data[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -795,11 +804,13 @@ int usb_mixsel_get_output_count(unsigned int mixer)
|
|||||||
return usb_mixers->usb_mixSel[mixer].numOutputs;
|
return usb_mixers->usb_mixSel[mixer].numOutputs;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *usb_mixer_get_input_name(unsigned int mixer, unsigned int input) {
|
char *usb_mixer_get_input_name(unsigned int mixer, unsigned int input)
|
||||||
|
{
|
||||||
return usb_mixers->usb_mixer[mixer].input_names[input];
|
return usb_mixers->usb_mixer[mixer].input_names[input];
|
||||||
}
|
}
|
||||||
|
|
||||||
char *usb_mixer_get_output_name(unsigned int mixer, unsigned int output) {
|
char *usb_mixer_get_output_name(unsigned int mixer, unsigned int output)
|
||||||
|
{
|
||||||
return usb_mixers->usb_mixer[mixer].output_names[output];
|
return usb_mixers->usb_mixer[mixer].output_names[output];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -810,13 +821,19 @@ unsigned char usb_mixsel_get_state(unsigned int mixer, unsigned int channel)
|
|||||||
|
|
||||||
void usb_mixsel_set_state(unsigned int mixer, unsigned int dst, unsigned int src)
|
void usb_mixsel_set_state(unsigned int mixer, unsigned int dst, unsigned int src)
|
||||||
{
|
{
|
||||||
// write to device
|
// Write to device
|
||||||
usb_audio_class_set(CUR, CS_XU_SEL, dst, usb_mixers->usb_mixSel[mixer].id, 1, (unsigned char *)&src);
|
// Note, we are updating inputs to all mixers here with a hard-coded 0, though the device allows
|
||||||
|
// for separate input mapping per mixer
|
||||||
|
unsigned bRequest = CUR;
|
||||||
|
unsigned cs = 0;
|
||||||
|
unsigned cn = usb_mixers->usb_mixSel[mixer].id;
|
||||||
|
unsigned wLength = 1;
|
||||||
|
usb_audio_class_set(CUR, 0, dst, usb_mixers->usb_mixSel[mixer].id, wLength, (unsigned char *)&src);
|
||||||
|
|
||||||
// update object state
|
// Update object state
|
||||||
usb_mixers->usb_mixSel[mixer].state[dst] = src;
|
usb_mixers->usb_mixSel[mixer].state[dst] = src;
|
||||||
|
|
||||||
// update local object strings
|
// Update local object strings
|
||||||
// TODO we don't really need to store strings since we can look them up...*/
|
// TODO we don't really need to store strings since we can look them up...*/
|
||||||
strcpy(usb_mixers->usb_mixer[mixer].input_names[dst], usb_mixers->usb_mixSel[mixer].inputStrings[src]);
|
strcpy(usb_mixers->usb_mixer[mixer].input_names[dst], usb_mixers->usb_mixSel[mixer].inputStrings[src]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user