diff --git a/NEWS b/NEWS index 2a37567f..5fe9bae0 100644 --- a/NEWS +++ b/NEWS @@ -31,6 +31,8 @@ -- Fix --continue output to print track_count+1 as continue position after hitting the end of playlist. Makes scripts/conplay go to back to the beginning again (regression in 1.24.0, bug 250). +-- Remote control API version 9 with @I { .. @I } wrapping of ID3 and + playlist display. -- Added --list-devices. - Updated debugging/warning/error message macros to include the function name. diff --git a/doc/README.remote b/doc/README.remote index 4da8c702..0b0e74f3 100644 --- a/doc/README.remote +++ b/doc/README.remote @@ -121,6 +121,14 @@ Note: mpg123 returns errors on stderr, so your frontend should @I ID3v2.title: After loading a track with ID3v2 info, such lines occur for every line of the "title" data field and likewise for other fields (author, album, etc). +Since version 9, ID3 info is wrapped in + +@I { +... +@I } + +to guide parsers. + @I Status message after loading a song (no ID3 song info) a = filename without path and extension @@ -128,6 +136,14 @@ Note: mpg123 returns errors on stderr, so your frontend should @I LISTENTRY : printout of playlists loaded with LOADLIST +Since version 9, list printout is wrapped in + +@I { +... +@I } + +to help parsers decide if they got the whole list. + @S ... Stream info at beginning of playback, meaning S diff --git a/src/control_generic.c b/src/control_generic.c index e358eb59..364b294c 100644 --- a/src/control_generic.c +++ b/src/control_generic.c @@ -218,6 +218,7 @@ static void generic_sendinfoid3(mpg123_handle *mh) error1("Cannot get ID3 data: %s", mpg123_strerror(mh)); return; } + generic_sendmsg("I {"); if(v1 != NULL) { generic_sendv1(v1, "I"); @@ -231,6 +232,7 @@ static void generic_sendinfoid3(mpg123_handle *mh) generic_send_lines(1, "I ID3v2.comment:%s", v2->comment); generic_send_lines(1, "I ID3v2.genre:%s", v2->genre); } + generic_sendmsg("I }"); } void generic_sendalltag(mpg123_handle *mh) @@ -345,6 +347,8 @@ static void generic_loadlist(mpg123_handle *fr, char *arg) return; } + generic_sendmsg("I {"); + /* Now got the plain playlist path in arg. On to evil manupulation of mpg123's playlist code. */ param.listname = arg; param.listentry = 0; /* The playlist shall not filter. */ @@ -363,6 +367,8 @@ static void generic_loadlist(mpg123_handle *fr, char *arg) } if(!i) generic_sendmsg("I LIST EMPTY"); + generic_sendmsg("I }"); + /* If we have something to play, play it. */ if(thefile) generic_load(fr, thefile, MODE_PLAYING); @@ -402,7 +408,7 @@ int control_generic (mpg123_handle *fr) #endif /* the command behaviour is different, so is the ID */ /* now also with version for command availability */ - fprintf(outstream, "@R MPG123 (ThOr) v8\n"); + fprintf(outstream, "@R MPG123 (ThOr) v9\n"); #ifdef FIFO if(param.fifo) {