From 7176d060a28552d861bd89d4feae696423bf1a48 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Wed, 22 Dec 2004 05:05:47 +0000 Subject: [PATCH] Add COMMENT keyword to smart playlists --- contrib/mt-daapd.playlist | 1 + src/lexer.l | 1 + src/parser.y | 2 ++ src/playlist.c | 6 ++++++ 4 files changed, 10 insertions(+) diff --git a/contrib/mt-daapd.playlist b/contrib/mt-daapd.playlist index ab38ead1..a95030fe 100644 --- a/contrib/mt-daapd.playlist +++ b/contrib/mt-daapd.playlist @@ -21,6 +21,7 @@ # Conductor (string) # Grouping (string) -- I don't even know what this is... # Comment (string) +# Type (string) -- "mp3 audio file", "m4a audio file", etc. # Year (int) # BPM (int) # Bitrate (int) diff --git a/src/lexer.l b/src/lexer.l index f75635d0..fda3f9a3 100644 --- a/src/lexer.l +++ b/src/lexer.l @@ -55,6 +55,7 @@ orchestra { yylval.ival=ORCHESTRA; return(ORCHESTRA); } conductor { yylval.ival=CONDUCTOR; return(CONDUCTOR); } grouping { yylval.ival=GROUPING; return(GROUPING); } type { yylval.ival=TYPE; return(TYPE); } +comment { yylval.ival=COMMENT; return(COMMENT); } year { yylval.ival=YEAR; return(YEAR); } bpm { yylval.ival=BPM; return(BPM); } diff --git a/src/parser.y b/src/parser.y index 63918722..92211f37 100644 --- a/src/parser.y +++ b/src/parser.y @@ -63,6 +63,7 @@ int pl_number=2; %token CONDUCTOR %token GROUPING %token TYPE +%token COMMENT %token EQUALS %token LESS @@ -162,6 +163,7 @@ strtag: ARTIST | CONDUCTOR | GROUPING | TYPE +| COMMENT ; strbool: IS { $$=$1; } diff --git a/src/playlist.c b/src/playlist.c index 93068611..15f86efb 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -119,6 +119,9 @@ void pl_dump_node(PL_NODE *pnode, int indent) { case TYPE: printf("TYPE "); break; + case COMMENT: + printf("COMMENT "); + break; case YEAR: printf("YEAR "); break; @@ -313,6 +316,9 @@ int pl_eval_node(MP3FILE *pmp3, PL_NODE *pnode) { case TYPE: cval=pmp3->description; break; + case COMMENT: + cval=pmp3->comment; + break; case YEAR: ival=pmp3->year; break;