[vlc-devel] [PATCH] modules/control/rc.c: Changed get_title to access metadata. Added commands get_artist and get_album to access metadata.

Frank von Zeppelin fvzeppelin at gmail.com
Wed Apr 19 20:48:21 CEST 2017


From: "fvzeppelin at gmail.com" <fvzeppelin at gmail.com>

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

diff --git a/modules/control/rc.c b/modules/control/rc.c
index c8d6611..691a666 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 )
-- 
2.1.4



More information about the vlc-devel mailing list