USB audio: Fix function of Selector Unit control
* restore function of Selector Unit that was previously disabled; * fix Selector Unit input pin names "Unknwon" case.
This commit is contained in:
@@ -472,7 +472,7 @@ FeatureUnit::Name()
|
|||||||
{
|
{
|
||||||
// first check if source of this FU is an input terminal
|
// first check if source of this FU is an input terminal
|
||||||
_AudioControl* control = fInterface->Find(fSourceID);
|
_AudioControl* control = fInterface->Find(fSourceID);
|
||||||
while (control != 0) {
|
while (control != NULL) {
|
||||||
if (control->SubType() != USB_AUDIO_AC_INPUT_TERMINAL)
|
if (control->SubType() != USB_AUDIO_AC_INPUT_TERMINAL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -486,7 +486,7 @@ FeatureUnit::Name()
|
|||||||
|
|
||||||
// check if output of this FU is connected to output terminal
|
// check if output of this FU is connected to output terminal
|
||||||
control = fInterface->FindOutputTerminal(fID);
|
control = fInterface->FindOutputTerminal(fID);
|
||||||
while (control != 0) {
|
while (control != NULL) {
|
||||||
if (control->SubType() != USB_AUDIO_AC_OUTPUT_TERMINAL)
|
if (control->SubType() != USB_AUDIO_AC_OUTPUT_TERMINAL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -498,6 +498,13 @@ FeatureUnit::Name()
|
|||||||
return control->Name();
|
return control->Name();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// otherwise get the generic name of this FU's source
|
||||||
|
control = fInterface->Find(fSourceID);
|
||||||
|
if (control != NULL && control->Name() != NULL
|
||||||
|
&& strlen(control->Name()) > 0)
|
||||||
|
return control->Name();
|
||||||
|
|
||||||
|
// I have no more ideas, have you one?
|
||||||
return "Unknown";
|
return "Unknown";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1103,7 +1110,7 @@ AudioControlInterface::_HarvestRecordFeatureUnits(_AudioControl* rootControl,
|
|||||||
|
|
||||||
switch(rootControl->SubType()) {
|
switch(rootControl->SubType()) {
|
||||||
case USB_AUDIO_AC_OUTPUT_TERMINAL:
|
case USB_AUDIO_AC_OUTPUT_TERMINAL:
|
||||||
// _HarvestRecordFeatureUnits(Find(rootControl->SourceID()), Map);
|
_HarvestRecordFeatureUnits(Find(rootControl->SourceID()), Map);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case USB_AUDIO_AC_SELECTOR_UNIT:
|
case USB_AUDIO_AC_SELECTOR_UNIT:
|
||||||
@@ -1517,7 +1524,7 @@ AudioControlInterface::GetMix(multi_mix_value_info* Info)
|
|||||||
Info->values[i].enable);
|
Info->values[i].enable);
|
||||||
break;
|
break;
|
||||||
case 0: // Selector Unit
|
case 0: // Selector Unit
|
||||||
Info->values[i].mux = data;
|
Info->values[i].mux = data - 1;
|
||||||
TRACE(MIX, "Selector control %d; is %d.\n",
|
TRACE(MIX, "Selector control %d; is %d.\n",
|
||||||
ID_FROM_CTLID(Info->values[i].id),
|
ID_FROM_CTLID(Info->values[i].id),
|
||||||
Info->values[i].mux);
|
Info->values[i].mux);
|
||||||
@@ -1564,7 +1571,7 @@ AudioControlInterface::SetMix(multi_mix_value_info* Info)
|
|||||||
Info->values[i].enable);
|
Info->values[i].enable);
|
||||||
break;
|
break;
|
||||||
case 0: // Selector Unit
|
case 0: // Selector Unit
|
||||||
data = Info->values[i].mux;
|
data = Info->values[i].mux + 1;
|
||||||
length = 1;
|
length = 1;
|
||||||
TRACE(MIX, "Selector Control %d about to set to %d.\n",
|
TRACE(MIX, "Selector Control %d about to set to %d.\n",
|
||||||
ID_FROM_CTLID(Info->values[i].id),
|
ID_FROM_CTLID(Info->values[i].id),
|
||||||
|
|||||||
@@ -122,6 +122,8 @@ public:
|
|||||||
MixerUnit(AudioControlInterface* interface,
|
MixerUnit(AudioControlInterface* interface,
|
||||||
usb_audiocontrol_header_descriptor* Header);
|
usb_audiocontrol_header_descriptor* Header);
|
||||||
virtual ~MixerUnit();
|
virtual ~MixerUnit();
|
||||||
|
|
||||||
|
virtual const char* Name() { return "Mixer"; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Vector<uint8> fInputPins;
|
Vector<uint8> fInputPins;
|
||||||
@@ -138,6 +140,7 @@ public:
|
|||||||
|
|
||||||
virtual AudioChannelCluster*
|
virtual AudioChannelCluster*
|
||||||
OutCluster();
|
OutCluster();
|
||||||
|
virtual const char* Name() { return "Selector"; }
|
||||||
|
|
||||||
// protected:
|
// protected:
|
||||||
Vector<uint8> fInputPins;
|
Vector<uint8> fInputPins;
|
||||||
@@ -167,6 +170,7 @@ public:
|
|||||||
usb_audiocontrol_header_descriptor* Header);
|
usb_audiocontrol_header_descriptor* Header);
|
||||||
virtual ~EffectUnit();
|
virtual ~EffectUnit();
|
||||||
|
|
||||||
|
virtual const char* Name() { return "Effect"; }
|
||||||
protected:
|
protected:
|
||||||
/* uint16 fProcessType;
|
/* uint16 fProcessType;
|
||||||
Vector<uint8> fInputPins;
|
Vector<uint8> fInputPins;
|
||||||
@@ -181,6 +185,8 @@ public:
|
|||||||
usb_audiocontrol_header_descriptor* Header);
|
usb_audiocontrol_header_descriptor* Header);
|
||||||
virtual ~ProcessingUnit();
|
virtual ~ProcessingUnit();
|
||||||
|
|
||||||
|
virtual const char* Name() { return "Processing"; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
uint16 fProcessType;
|
uint16 fProcessType;
|
||||||
Vector<uint8> fInputPins;
|
Vector<uint8> fInputPins;
|
||||||
@@ -195,6 +201,8 @@ public:
|
|||||||
usb_audiocontrol_header_descriptor* Header);
|
usb_audiocontrol_header_descriptor* Header);
|
||||||
virtual ~ExtensionUnit();
|
virtual ~ExtensionUnit();
|
||||||
|
|
||||||
|
virtual const char* Name() { return "Extension"; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
uint16 fExtensionCode;
|
uint16 fExtensionCode;
|
||||||
Vector<uint8> fInputPins;
|
Vector<uint8> fInputPins;
|
||||||
|
|||||||
Reference in New Issue
Block a user