mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-24 13:13:17 -05:00
Add bitrate keyword to smart playlists
This commit is contained in:
parent
84d1ee1cca
commit
a96622cbe7
@ -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); }
|
||||
|
@ -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; }
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user