/*****************************************************************************
* Preamble
*****************************************************************************/
+#define _GNU_SOURCE
#include <stdlib.h> /* malloc(), free() */
#include <string.h>
#include <errno.h> /* ENOMEM */
#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>
static playlist_item_t *PlaylistGetRoot( intf_thread_t * );
static void PlaylistRebuild( intf_thread_t * );
-static void PlaylistAddNode( intf_thread_t *, playlist_item_t *, int, char *);
+static void PlaylistAddNode( intf_thread_t *, playlist_item_t *, int, const char *);
static void PlaylistDestroy( intf_thread_t * );
static int PlaylistChanged( vlc_object_t *, const char *, vlc_value_t,
vlc_value_t, void * );
/* Set quiet mode */
val.i_int = -1;
- var_Set( p_intf->p_vlc, "verbose", val );
+ var_Set( p_intf->p_libvlc, "verbose", val );
/* Set defaul playlist view */
p_sys->i_current_view = VIEW_CATEGORY;
}
else
{
- p_sys->psz_current_dir = strdup( p_intf->p_vlc->psz_homedir );
+ p_sys->psz_current_dir = strdup( p_intf->p_libvlc->psz_homedir );
}
p_sys->i_dir_entries = 0;
*/
t_last_refresh = ( time( 0 ) - 1);
- while( !p_intf->b_die )
+ while( !intf_ShouldDie( p_intf ) )
{
msleep( INTF_IDLE_SLEEP );
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--;
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
{
== -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 );
}
case 'q':
case 'Q':
case 0x1b: /* Esc */
- p_intf->p_vlc->b_die = VLC_TRUE;
+ vlc_object_kill( p_intf->p_libvlc );
return 0;
/* Box switching */
/* 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 );
{
mvnprintw( y++, 0, COLS, " State : Playing" );
}
- else if( val.i_int == OPENNING_S )
+ else if( val.i_int == OPENING_S )
{
mvnprintw( y++, 0, COLS, " State : Openning/Connecting" );
}
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++ )
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
{
}
static void PlaylistAddNode( intf_thread_t *p_intf, playlist_item_t *p_node,
- int i, char *c )
+ int i, const char *c )
{
intf_sys_t *p_sys = p_intf->p_sys;
playlist_item_t *p_child;
if( p_sys->psz_current_dir && *p_sys->psz_current_dir )
{
- const char *psz_entry;
+ char *psz_entry;
/* Open the dir */
p_current_dir = utf8_opendir( p_sys->psz_current_dir );
( strlen( psz_entry ) && psz_entry[0] == '.' ) &&
strcmp( psz_entry, ".." ) )
{
- LocaleFree( psz_entry );
+ free( psz_entry );
psz_entry = utf8_readdir( p_current_dir );
continue;
}
}
free( psz_uri );
- LocaleFree( psz_entry );
+ free( psz_entry );
/* Read next entry */
psz_entry = utf8_readdir( p_current_dir );
}