/*****************************************************************************
* 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>
/* 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
{
if( p_sys->pp_plist[p_sys->i_box_plidx]->p_item->i_children
== -1 )
{
- playlist_Control( p_sys->p_playlist, PLAYLIST_ITEMPLAY,
+ playlist_Control( p_sys->p_playlist, PLAYLIST_VIEWPLAY,
+ VLC_TRUE, NULL,
p_sys->pp_plist[p_sys->i_box_plidx]->p_item );
}
else
{
playlist_Control( p_sys->p_playlist, PLAYLIST_VIEWPLAY,
- p_sys->i_current_view,
+ 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;
+ p_intf->p_libvlc->b_die = VLC_TRUE;
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 == OPENING_S )
+ {
+ mvnprintw( y++, 0, COLS, " State : Openning/Connecting" );
+ }
+ else if( val.i_int == BUFFERING_S )
+ {
+ mvnprintw( y++, 0, COLS, " State : Buffering" );
+ }
else if( val.i_int == PAUSE_S )
{
mvnprintw( y++, 0, COLS, " State : Paused" );
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
{
( 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 );
}