[vlc-devel] commit: Fix #1530 : with thr rc interface you can now draw the playlist. ( Rémi Duraffort )

git version control git at videolan.org
Mon Apr 7 22:40:36 CEST 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Mon Apr  7 22:08:47 2008 +0200| [ca2549646561205b9e3a08e890fdbf459507a365]

Fix #1530 : with thr rc interface you can now draw the playlist.

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

 modules/control/rc.c |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/modules/control/rc.c b/modules/control/rc.c
index 3dcca75..8efa0bd 100644
--- a/modules/control/rc.c
+++ b/modules/control/rc.c
@@ -1268,6 +1268,18 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd,
     return VLC_EGENERIC;
 }
 
+static void print_playlist( intf_thread_t *p_intf, playlist_item_t *p_item, int i_level )
+{
+    int i;
+    for( i = 0; i< p_item->i_children; i++ )
+    {
+        msg_rc( "%*s%s", 2 * i_level, "", p_item->pp_children[i]->p_input->psz_name );
+
+        if( p_item->pp_children[i]->i_children >= 0 )
+            print_playlist( p_intf, p_item->pp_children[i], i_level + 1 );
+    }
+}
+
 static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
                      vlc_value_t oldval, vlc_value_t newval, void *p_data )
 {
@@ -1433,12 +1445,8 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
         }
     }
     else if( !strcmp( psz_cmd, "playlist" ) )
-    {
-        msg_Dbg( p_playlist, "Dumping category" );
-        playlist_NodeDump( p_playlist, p_playlist->p_root_category, 0 );
-        msg_Dbg( p_playlist, "Dumping Onelevel" );
-        playlist_NodeDump( p_playlist, p_playlist->p_root_onelevel, 0 );
-    }
+        print_playlist( p_intf, p_playlist->p_root_category, 0 );
+
     else if( !strcmp( psz_cmd, "sort" ))
     {
         playlist_RecursiveNodeSort( p_playlist, p_playlist->p_root_onelevel,




More information about the vlc-devel mailing list