Add bitrate keyword to smart playlists

This commit is contained in:
Ron Pedde 2004-09-08 04:07:53 +00:00
parent 84d1ee1cca
commit a96622cbe7
3 changed files with 9 additions and 0 deletions

View File

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

View File

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

View File

@ -119,6 +119,9 @@ void pl_dump_node(PL_NODE *pnode, int indent) {
case BPM:
printf("BPM ");
break;
case BITRATE:
printf("BITRATE ");
break;
default:
printf ("<unknown tag> ");
break;
@ -293,6 +296,9 @@ int pl_eval_node(MP3FILE *pmp3, PL_NODE *pnode) {
case BPM:
ival=pmp3->bpm;
break;
case BITRATE:
ival=pmp3->bitrate / 1024; // bitrate in Kbps
break;
}
boolarg=(pnode->op) & 0x7FFFFFFF;