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", "Rear",
"Pan", "Pan",
"Output", "Output",
"-",
NULL NULL
}; };
static char *names2[] = { static char *names2[] = {
"Switch", "Switch",
"Volume", "Volume",
"Bypass", "Bypass",
"Depth",
"Wide",
"Space",
"Level",
"Center",
NULL NULL
}; };
int res, res1; int res, res1;

View file

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