Add bpm keyword to smart playlists

This commit is contained in:
Ron Pedde 2004-09-08 03:58:33 +00:00
parent 5748b6502d
commit 84d1ee1cca
4 changed files with 10 additions and 0 deletions

View File

@ -21,6 +21,7 @@
# Conductor (string)
# Grouping (string) -- I don't even know what this is...
# Year (int)
# BPM (int)
#
# Valid operators include:
# is, includes (string)

View File

@ -52,6 +52,7 @@ conductor { yylval.ival=CONDUCTOR; return(CONDUCTOR); }
grouping { yylval.ival=GROUPING; return(GROUPING); }
year { yylval.ival=YEAR; return(YEAR); }
bpm { yylval.ival=BPM; return(BPM); }
is { yylval.ival=IS; return(IS); }
includes { yylval.ival=INCLUDES; return(INCLUDES); }

View File

@ -78,6 +78,7 @@ int pl_number=2;
%token <ival> NUM
%token <ival> YEAR
%token <ival> BPM
%type <plval> expression
%type <plval> predicate
@ -107,6 +108,7 @@ predicate: strtag strbool ID { $$=pl_newcharpredicate($1, $2, $3); }
;
inttag: YEAR
| BPM
;
intbool: EQUALS { $$ = $1; }

View File

@ -116,6 +116,9 @@ void pl_dump_node(PL_NODE *pnode, int indent) {
case YEAR:
printf("YEAR ");
break;
case BPM:
printf("BPM ");
break;
default:
printf ("<unknown tag> ");
break;
@ -287,6 +290,9 @@ int pl_eval_node(MP3FILE *pmp3, PL_NODE *pnode) {
case YEAR:
ival=pmp3->year;
break;
case BPM:
ival=pmp3->bpm;
break;
}
boolarg=(pnode->op) & 0x7FFFFFFF;