[PATCH 7/7] grl-inspect: Show supported keys



---
 tools/grilo-inspect/grl-inspect.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/tools/grilo-inspect/grl-inspect.c b/tools/grilo-inspect/grl-inspect.c
index ab24f1b..6aa049c 100644
--- a/tools/grilo-inspect/grl-inspect.c
+++ b/tools/grilo-inspect/grl-inspect.c
@@ -53,6 +53,18 @@ list_all_sources ()
 }
 
 static void
+print_keys (const GList *keys)
+{
+  while (keys) {
+    g_print ("%s", GRL_METADATA_KEY_GET_NAME (keys->data));
+    keys = g_list_next (keys);
+    if (keys) {
+      g_print (", ");
+    }
+  }
+}
+
+static void
 introspect_plugin (const gchar *plugin_id)
 {
   GrlMediaPlugin *plugin;
@@ -123,6 +135,16 @@ introspect_plugin (const gchar *plugin_id)
       g_print ("  grl_media_source_remove():\t\tRemove Media\n");
     }
     g_print ("\n");
+
+    /* Print supported keys */
+    g_print ("Supported keys:\n");
+    g_print ("  Readable Keys:\t\t");
+    print_keys (grl_metadata_source_supported_keys (GRL_METADATA_SOURCE (plugin)));
+    g_print ("\n");
+    g_print ("  Writable Keys:\t\t");
+    print_keys (grl_metadata_source_writable_keys (GRL_METADATA_SOURCE (plugin)));
+    g_print ("\n");
+    g_print ("\n");
   } else {
     g_printerr ("Plugin Not Found: %s\n\n", plugin_id);
   }
-- 
1.7.0.4



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]