From ca2549646561205b9e3a08e890fdbf459507a365 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Duraffort?= Date: Mon, 7 Apr 2008 22:08:47 +0200 Subject: [PATCH] Fix #1530 : with thr rc interface you can now draw the playlist. --- modules/control/rc.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/modules/control/rc.c b/modules/control/rc.c index 3dcca7549a..8efa0bd7d3 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, -- 2.39.2