[vlc-devel] [PATCH] Changed get_title to access metadata and added get_artist and get_album to get additional metadata

Frank von Zeppelin fvzeppelin at gmail.com
Thu Apr 20 00:48:21 CEST 2017


---
 modules/control/rc.c | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/modules/control/rc.c b/modules/control/rc.c
index c8d6611..1963542 100644
--- a/modules/control/rc.c
+++ b/modules/control/rc.c
@@ -713,7 +713,29 @@ static void *Run( void *data )
             }
             else
             {
-                msg_rc( "%s", input_GetItem(p_sys->p_input)->psz_name );
+                msg_rc( "%s", input_item_GetMeta(input_GetItem(p_sys->p_input),vlc_meta_Title));
+            }
+        }
+        else if( !strcmp( psz_cmd, "get_artist" ) )
+        {
+            if( p_sys->p_input == NULL )
+            {
+                msg_rc("%s", "");
+            }
+            else
+            {
+                msg_rc( "%s", input_item_GetMeta(input_GetItem(p_sys->p_input),vlc_meta_Artist));
+            }
+        }
+        else if( !strcmp( psz_cmd, "get_album" ) )
+        {
+            if( p_sys->p_input == NULL )
+            {
+                msg_rc("%s", "");
+            }
+            else
+            {
+                msg_rc( "%s", input_item_GetMeta(input_GetItem(p_sys->p_input),vlc_meta_Album));
             }
         }
         else if( !strcmp( psz_cmd, "longhelp" ) || !strncmp( psz_cmd, "h", 1 )
@@ -815,6 +837,8 @@ static void Help( intf_thread_t *p_intf)
     msg_rc("%s", _("| get_time . . seconds elapsed since stream's beginning"));
     msg_rc("%s", _("| is_playing . . . .  1 if a stream plays, 0 otherwise"));
     msg_rc("%s", _("| get_title . . . . .  the title of the current stream"));
+    msg_rc("%s", _("| get_artist . . . .  the artist of the current stream"));
+    msg_rc("%s", _("| get_album . . . . .  the album of the current stream"));
     msg_rc("%s", _("| get_length . . . .  the length of the current stream"));
     msg_rc(  "| ");
     msg_rc("%s", _("| volume [X] . . . . . . . . . .  set/get audio volume"));
-- 
2.1.4



More information about the vlc-devel mailing list