usb_audio:fix parameters web compilation logic

* parameters web compilation improved - harvest the feature units
  assigned to non-streaming output terminals in the same way as ones
  assigned to streaming output terminals.

Fixes #9950
This commit is contained in:
Siarzhuk Zharski 2013-09-07 21:16:05 +02:00
parent 2520ac68a8
commit c68e172312
2 changed files with 35 additions and 8 deletions

View File

@ -1194,10 +1194,6 @@ AudioControlInterface::_HarvestRecordFeatureUnits(_AudioControl* rootControl,
}
switch(rootControl->SubType()) {
case USB_AUDIO_AC_OUTPUT_TERMINAL:
_HarvestRecordFeatureUnits(Find(rootControl->SourceID()), Map);
break;
case USB_AUDIO_AC_SELECTOR_UNIT:
{
SelectorUnit* unit = static_cast<SelectorUnit*>(rootControl);
@ -1214,6 +1210,32 @@ AudioControlInterface::_HarvestRecordFeatureUnits(_AudioControl* rootControl,
}
void
AudioControlInterface::_HarvestOutputFeatureUnits(_AudioControl* rootControl,
AudioControlsMap& Map)
{
if (rootControl == 0) {
TRACE(ERR, "Not processing due NULL root control.\n");
return;
}
switch(rootControl->SubType()) {
case USB_AUDIO_AC_MIXER_UNIT:
{
MixerUnit* unit = static_cast<MixerUnit*>(rootControl);
for (int i = 0; i < unit->fInputPins.Count(); i++)
_HarvestOutputFeatureUnits(Find(unit->fInputPins[i]), Map);
Map.Put(rootControl->ID(), rootControl);
}
break;
case USB_AUDIO_AC_FEATURE_UNIT:
Map.Put(rootControl->ID(), rootControl);
break;
}
}
bool
AudioControlInterface::_InitGainLimits(multi_mix_control& Control)
{
@ -1797,20 +1819,22 @@ AudioControlInterface::_ListMixControlsPage(int32& index,
status_t
AudioControlInterface::ListMixControls(multi_mix_control_info* Info)
{
// first harvest feature units that assigned to output USB I/O terminal(s)
// first harvest feature units that assigned to output terminal(s)
AudioControlsMap RecordControlsMap;
AudioControlsMap OutputControlsMap;
for (AudioControlsIterator I = fOutputTerminals.Begin();
I != fOutputTerminals.End(); I++) {
_Terminal* terminal = static_cast<_Terminal*>(I->Value());
if (terminal->IsUSBIO())
_HarvestRecordFeatureUnits(terminal, RecordControlsMap);
else
_HarvestOutputFeatureUnits(terminal, OutputControlsMap);
}
// separate input and output Feature units
// and collect mixer units that can be controlled
AudioControlsMap InputControlsMap;
AudioControlsMap OutputControlsMap;
AudioControlsMap MixerControlsMap;
for (AudioControlsIterator I = fAudioControls.Begin();
@ -1828,8 +1852,9 @@ AudioControlInterface::ListMixControls(multi_mix_control_info* Info)
if (control->SubType() != USB_AUDIO_AC_FEATURE_UNIT)
continue;
// ignore controls that are already in the record controls map
if (RecordControlsMap.Find(control->ID()) != RecordControlsMap.End())
// ignore controls that are already in the output controls maps
if (RecordControlsMap.Find(control->ID()) != RecordControlsMap.End()
|| OutputControlsMap.Find(control->ID()) != OutputControlsMap.End())
continue;
_AudioControl* sourceControl = Find(control->SourceID());

View File

@ -303,6 +303,8 @@ protected:
void _HarvestRecordFeatureUnits(_AudioControl* rootControl,
AudioControlsMap& Map);
void _HarvestOutputFeatureUnits(_AudioControl* rootControl,
AudioControlsMap& Map);
void _ListMixControlsPage(int32& index,
multi_mix_control_info* Info,
AudioControlsMap& Map, const char* Name);