mirror of
https://github.com/owntone/owntone-server.git
synced 2025-03-30 17:23:44 -04:00
Add bpm keyword to smart playlists
This commit is contained in:
parent
5748b6502d
commit
84d1ee1cca
@ -21,6 +21,7 @@
|
|||||||
# Conductor (string)
|
# Conductor (string)
|
||||||
# Grouping (string) -- I don't even know what this is...
|
# Grouping (string) -- I don't even know what this is...
|
||||||
# Year (int)
|
# Year (int)
|
||||||
|
# BPM (int)
|
||||||
#
|
#
|
||||||
# Valid operators include:
|
# Valid operators include:
|
||||||
# is, includes (string)
|
# is, includes (string)
|
||||||
|
@ -52,6 +52,7 @@ conductor { yylval.ival=CONDUCTOR; return(CONDUCTOR); }
|
|||||||
grouping { yylval.ival=GROUPING; return(GROUPING); }
|
grouping { yylval.ival=GROUPING; return(GROUPING); }
|
||||||
|
|
||||||
year { yylval.ival=YEAR; return(YEAR); }
|
year { yylval.ival=YEAR; return(YEAR); }
|
||||||
|
bpm { yylval.ival=BPM; return(BPM); }
|
||||||
|
|
||||||
is { yylval.ival=IS; return(IS); }
|
is { yylval.ival=IS; return(IS); }
|
||||||
includes { yylval.ival=INCLUDES; return(INCLUDES); }
|
includes { yylval.ival=INCLUDES; return(INCLUDES); }
|
||||||
|
@ -78,6 +78,7 @@ int pl_number=2;
|
|||||||
%token <ival> NUM
|
%token <ival> NUM
|
||||||
|
|
||||||
%token <ival> YEAR
|
%token <ival> YEAR
|
||||||
|
%token <ival> BPM
|
||||||
|
|
||||||
%type <plval> expression
|
%type <plval> expression
|
||||||
%type <plval> predicate
|
%type <plval> predicate
|
||||||
@ -107,6 +108,7 @@ predicate: strtag strbool ID { $$=pl_newcharpredicate($1, $2, $3); }
|
|||||||
;
|
;
|
||||||
|
|
||||||
inttag: YEAR
|
inttag: YEAR
|
||||||
|
| BPM
|
||||||
;
|
;
|
||||||
|
|
||||||
intbool: EQUALS { $$ = $1; }
|
intbool: EQUALS { $$ = $1; }
|
||||||
|
@ -116,6 +116,9 @@ void pl_dump_node(PL_NODE *pnode, int indent) {
|
|||||||
case YEAR:
|
case YEAR:
|
||||||
printf("YEAR ");
|
printf("YEAR ");
|
||||||
break;
|
break;
|
||||||
|
case BPM:
|
||||||
|
printf("BPM ");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
printf ("<unknown tag> ");
|
printf ("<unknown tag> ");
|
||||||
break;
|
break;
|
||||||
@ -287,6 +290,9 @@ int pl_eval_node(MP3FILE *pmp3, PL_NODE *pnode) {
|
|||||||
case YEAR:
|
case YEAR:
|
||||||
ival=pmp3->year;
|
ival=pmp3->year;
|
||||||
break;
|
break;
|
||||||
|
case BPM:
|
||||||
|
ival=pmp3->bpm;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolarg=(pnode->op) & 0x7FFFFFFF;
|
boolarg=(pnode->op) & 0x7FFFFFFF;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user