[vlc-devel] commit: Improve playlist drawing with rc. ( Rémi Duraffort )

git version control git at videolan.org
Tue Apr 8 00:16:10 CEST 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Tue Apr  8 00:14:15 2008 +0200| [395a801ce716198e0a52f020dd8f2cf3f00f82ce]

Improve playlist drawing with rc.

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

 modules/control/rc.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/modules/control/rc.c b/modules/control/rc.c
index 8efa0bd..7f54776 100644
--- a/modules/control/rc.c
+++ b/modules/control/rc.c
@@ -1271,9 +1271,16 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd,
 static void print_playlist( intf_thread_t *p_intf, playlist_item_t *p_item, int i_level )
 {
     int i;
+    char psz_buffer[MSTRTIME_MAX_SIZE];
     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]->p_input->i_duration != -1 )
+        {
+            secstotimestr( psz_buffer, p_item->pp_children[i]->p_input->i_duration / 1000000 );
+            msg_rc( "|%*s- %s (%s)", 2 * i_level, "", p_item->pp_children[i]->p_input->psz_name, psz_buffer );
+        }
+        else
+            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 );
@@ -1445,7 +1452,11 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
         }
     }
     else if( !strcmp( psz_cmd, "playlist" ) )
+    {
+        msg_rc( "+----[ Playlist ]" );
         print_playlist( p_intf, p_playlist->p_root_category, 0 );
+        msg_rc( "+----[ End of playlist ]" );
+    }
 
     else if( !strcmp( psz_cmd, "sort" ))
     {




More information about the vlc-devel mailing list