Fix a wrong display in the last patch

Fixed a wrong item display in the last patch.
This commit is contained in:
Takashi Iwai 2005-06-15 12:53:30 +00:00
parent 11f789c4f9
commit 74dca8fd02

View file

@ -957,6 +957,7 @@ mixer_update_cbar (int elem_index)
/* update the focused full bar name /* update the focused full bar name
*/ */
if (elem_index == mixer_focus_elem) { if (elem_index == mixer_focus_elem) {
char tmp[50];
/* control muted? */ /* control muted? */
swl = swr = 1; swl = swr = 1;
extra_info = ""; extra_info = "";
@ -968,20 +969,20 @@ mixer_update_cbar (int elem_index)
extra_info = !swl && !swr ? " [Off]" : ""; extra_info = !swl && !swr ? " [Off]" : "";
} }
if (type == MIXER_ELEM_ENUM) { if (type == MIXER_ELEM_ENUM) {
/* FIXME: should show the item names of secondary and later channels... */
unsigned int eidx, length; unsigned int eidx, length;
char tmp[50];
tmp[0]=' '; tmp[0]=' ';
tmp[1]='['; tmp[1]='[';
if (! snd_mixer_selem_get_enum_item(elem, 0, &eidx) && if (! snd_mixer_selem_get_enum_item(elem, 0, &eidx) &&
! snd_mixer_selem_get_enum_item_name(elem, eidx, sizeof(tmp) - 3, tmp+2)) { ! snd_mixer_selem_get_enum_item_name(elem, eidx, sizeof(tmp) - 3, tmp+2)) {
tmp[48] = 0; tmp[sizeof(tmp)-2] = 0;
length=strlen(tmp); length=strlen(tmp);
tmp[length]=']'; tmp[length]=']';
tmp[length+1]=0; tmp[length+1]=0;
display_item_info(elem_index, sid, tmp); extra_info = tmp;
} else }
display_item_info(elem_index, sid, extra_info);
} }
display_item_info(elem_index, sid, extra_info);
} }
/* get channel bar position /* get channel bar position