[vlc-commits] strings: Adding a 'Z' flag to insert 'Now playing' or 'Title - Artist' if there is no now playing tag.

Hugo Beauzée-Luyssen git at videolan.org
Fri Apr 22 15:12:35 CEST 2011


vlc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Tue Apr 19 15:15:42 2011 +0200| [697d7cd50c411ba3efc74091fb87aa922cde45f9] | committer: Jean-Baptiste Kempf

strings: Adding a 'Z' flag to insert 'Now playing' or 'Title - Artist' if there is no now playing tag.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=697d7cd50c411ba3efc74091fb87aa922cde45f9
---

 src/text/strings.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/text/strings.c b/src/text/strings.c
index 3765077..829a142 100644
--- a/src/text/strings.c
+++ b/src/text/strings.c
@@ -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;



More information about the vlc-commits mailing list