]> git.sesse.net Git - vlc/blobdiff - modules/gui/ncurses.c
Qt4 - Pref: start to track functionnalities missing. Directory still segfaults..
[vlc] / modules / gui / ncurses.c
index 05088b952c2dc52f895ceadfa2fb370788bb1ec9..857db4fb6e082454bb273ec40e09d6a56d18d6b5 100644 (file)
 #include <curses.h>
 
 #include <vlc/vlc.h>
-#include <vlc/intf.h>
-#include <vlc/vout.h>
-#include <vlc/aout.h>
-#include "charset.h"
+#include <vlc_interface.h>
+#include <vlc_vout.h>
+#include <vlc_aout.h>
+#include <vlc_charset.h>
+#include <vlc_input.h>
+#include <vlc_playlist.h>
 
 #ifdef HAVE_SYS_STAT_H
 #   include <sys/stat.h>
@@ -523,7 +525,7 @@ static int HandleKey( intf_thread_t *p_intf, int i_key )
                 p_sys->i_box_plidx = 0;
                 break;
             case KEY_END:
-                p_sys->i_box_plidx = p_sys->p_playlist->i_size - 1;
+                p_sys->i_box_plidx = p_sys->p_playlist->items.i_size - 1;
                 break;
             case KEY_UP:
                 p_sys->i_box_plidx--;
@@ -548,7 +550,8 @@ static int HandleKey( intf_thread_t *p_intf, int i_key )
                 p_item = p_sys->pp_plist[p_sys->i_box_plidx]->p_item;
                 if( p_item->i_children == -1 )
                 {
-                    playlist_DeleteFromItemId( p_playlist, p_item->i_id );
+                    playlist_DeleteFromInput( p_playlist,
+                                              p_item->p_input->i_id, VLC_TRUE );
                 }
                 else
                 {
@@ -567,12 +570,13 @@ static int HandleKey( intf_thread_t *p_intf, int i_key )
                         == -1 )
                 {
                     playlist_Control( p_sys->p_playlist, PLAYLIST_VIEWPLAY,
-                        NULL,
+                                      VLC_TRUE, NULL,
                         p_sys->pp_plist[p_sys->i_box_plidx]->p_item );
                 }
                 else
                 {
                     playlist_Control( p_sys->p_playlist, PLAYLIST_VIEWPLAY,
+                        VLC_TRUE,
                         p_sys->pp_plist[p_sys->i_box_plidx]->p_item,
                         NULL );
                 }
@@ -1206,7 +1210,7 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
 
         /* Source */
         mvnprintw( y++, 0, COLS, " Source   : %s",
-                   p_input->input.p_item->psz_uri );
+                   input_GetItem(p_input)->psz_uri );
 
         /* State */
         var_Get( p_input, "state", &val );
@@ -1375,10 +1379,10 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
         if( p_input )
         {
             int i,j;
-            vlc_mutex_lock( &p_input->input.p_item->lock );
-            for( i = 0; i < p_input->input.p_item->i_categories; i++ )
+            vlc_mutex_lock( &input_GetItem(p_input)->lock );
+            for( i = 0; i < input_GetItem(p_input)->i_categories; i++ )
             {
-                info_category_t *p_category = p_input->input.p_item->pp_categories[i];
+                info_category_t *p_category = input_GetItem(p_input)->pp_categories[i];
                 if( y >= y_end ) break;
                 MainBoxWrite( p_intf, l++, 1, "  [%s]", p_category->psz_name );
                 for( j = 0; j < p_category->i_infos; j++ )
@@ -1388,7 +1392,7 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
                     MainBoxWrite( p_intf, l++, 1, "      %s: %s", p_info->psz_name, p_info->psz_value );
                 }
             }
-            vlc_mutex_unlock( &p_input->input.p_item->lock );
+            vlc_mutex_unlock( &input_GetItem(p_input)->lock );
         }
         else
         {
@@ -1945,7 +1949,7 @@ static void ReadDir( intf_thread_t *p_intf )
                 ( strlen( psz_entry ) && psz_entry[0] == '.' ) &&
                 strcmp( psz_entry, ".." ) )
             {
-                LocaleFree( psz_entry );
+                free( psz_entry );
                 psz_entry = utf8_readdir( p_current_dir );
                 continue;
             }
@@ -1982,7 +1986,7 @@ static void ReadDir( intf_thread_t *p_intf )
             }
 
             free( psz_uri );
-            LocaleFree( psz_entry );
+            free( psz_entry );
             /* Read next entry */
             psz_entry = utf8_readdir( p_current_dir );
         }