Added more sort rules

This commit is contained in:
Jaroslav Kysela 2001-03-16 16:46:05 +00:00
parent 877896069d
commit 0300bbbbb3
2 changed files with 15 additions and 1 deletions

View file

@ -170,12 +170,18 @@ static int get_compare_weight(const char *name)
"Rear",
"Pan",
"Output",
"-",
NULL
};
static char *names2[] = {
"Switch",
"Volume",
"Bypass",
"Depth",
"Wide",
"Space",
"Level",
"Center",
NULL
};
int res, res1;

View file

@ -110,8 +110,15 @@ static int get_compare_weight(const char *name, int index)
"Master",
"Master Mono",
"Master Digital",
"Headphone",
"Bass",
"Treble",
"3D Control - Switch",
"3D Control - Depth",
"3D Control - Wide",
"3D Control - Space",
"3D Control - Level",
"3D Control - Center",
"PCM",
"Surround",
"Synth",
@ -633,7 +640,8 @@ static int base_len(const char *name, selem_ctl_type_t *type)
size_t l;
if (nlen > slen) {
l = nlen - slen;
if (strncmp(name + l, p->suffix, slen) == 0) {
if (strncmp(name + l, p->suffix, slen) == 0 &&
(l < 1 || name[l-1] != '-')) { /* 3D Control - Switch */
*type = p->type;
return l;
}