]> git.sesse.net Git - vlc/commitdiff
strings: Adding a 'Z' flag to insert 'Now playing' or 'Title - Artist' if there is...
authorHugo Beauzée-Luyssen <beauze.h@gmail.com>
Tue, 19 Apr 2011 13:15:42 +0000 (15:15 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Fri, 22 Apr 2011 13:11:41 +0000 (15:11 +0200)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
src/text/strings.c

index 3765077b4aa9f1de386f441445980b5e333dba00..829a142653a38c6de476998e08f2167d97c76d32 100644 (file)
@@ -891,6 +891,20 @@ char *str_format_meta( vlc_object_t *p_object, const char *string )
                     *(dst+d) = '\n';
                     d++;
                     break;
+                case 'Z':
+                    if( p_item )
+                    {
+                        char *now_playing = input_item_GetNowPlaying( p_item );
+                        if ( now_playing == NULL )
+                        {
+                            INSERT_STRING( input_item_GetTitle( p_item ) );
+                            INSERT_STRING_NO_FREE( " - " );
+                            INSERT_STRING( input_item_GetArtist( p_item ) );
+                        }
+                        else
+                            INSERT_STRING( now_playing );
+                    }
+                    break;
 
                 case ' ':
                     b_empty_if_na = true;