static vlc_bool_t ReadCommand( intf_thread_t *, char *, int * );
-static playlist_item_t *parse_MRL( intf_thread_t *, char * );
+static input_item_t *parse_MRL( intf_thread_t *, char * );
static int Input ( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
else if( !strcmp( psz_cmd, "add" ) &&
newval.psz_string && *newval.psz_string )
{
- playlist_item_t *p_item = parse_MRL( p_intf, newval.psz_string );
+ input_item_t *p_item = parse_MRL( p_intf, newval.psz_string );
if( p_item )
{
msg_rc( "Trying to add %s to playlist.", newval.psz_string );
-// playlist_AddItem( p_playlist, p_item,
-// PLAYLIST_GO|PLAYLIST_APPEND, PLAYLIST_END );
+ playlist_PlaylistAddInput( p_playlist, p_item,
+ PLAYLIST_GO|PLAYLIST_APPEND, PLAYLIST_END );
}
}
else if( !strcmp( psz_cmd, "playlist" ) )
}
/*****************************************************************************
- * parse_MRL: build a playlist item from a full mrl
+ * parse_MRL: build a input item from a full mrl
*****************************************************************************
* MRL format: "simplified-mrl [:option-name[=option-value]]"
* We don't check for '"' or '\'', we just assume that a ':' that follows a
* space is a new option. Should be good enough for our purpose.
*****************************************************************************/
-static playlist_item_t *parse_MRL( intf_thread_t *p_intf, char *psz_mrl )
+static input_item_t *parse_MRL( intf_thread_t *p_intf, char *psz_mrl )
{
#define SKIPSPACE( p ) { while( *p && ( *p == ' ' || *p == '\t' ) ) p++; }
#define SKIPTRAILINGSPACE( p, d ) \
{ char *e=d; while( e > p && (*(e-1)==' ' || *(e-1)=='\t') ){e--;*e=0;} }
- playlist_item_t *p_item = NULL;
+ input_item_t *p_item = NULL;
char *psz_item = NULL, *psz_item_mrl = NULL, *psz_orig;
char **ppsz_options = NULL;
int i, i_options = 0;
/* Now create a playlist item */
if( psz_item_mrl )
{
- p_item = playlist_ItemNew( p_intf, psz_item_mrl, psz_item_mrl );
+ p_item = input_ItemNew( p_intf, psz_item_mrl, psz_item_mrl );
for( i = 0; i < i_options; i++ )
{
- playlist_ItemAddOption( p_item, ppsz_options[i] );
+ vlc_input_item_AddOption( p_item, ppsz_options[i] );
}
}
p_playlist->p_ml_onelevel = playlist_NodeCreate( p_playlist,
_( "Media Library" ), p_playlist->p_root_onelevel );
+ p_playlist->p_local_category->i_flags |= PLAYLIST_RO_FLAG;
+ p_playlist->p_ml_category->i_flags |= PLAYLIST_RO_FLAG;
+ p_playlist->p_local_onelevel->i_flags |= PLAYLIST_RO_FLAG;
+ p_playlist->p_ml_onelevel->i_flags |= PLAYLIST_RO_FLAG;
+
/* This is a hack to find it later. Quite ugly, but I haven't found a
* better way */
p_playlist->p_local_onelevel->p_input->i_id =
var_Destroy( p_playlist, "loop" );
var_Destroy( p_playlist, "activity" );
- playlist_LockClear( p_playlist );
+ PL_LOCK;
+ playlist_NodeDelete( p_playlist, p_playlist->p_root_category, VLC_TRUE,
+ VLC_TRUE );
+ playlist_NodeDelete( p_playlist, p_playlist->p_root_onelevel, VLC_TRUE,
+ VLC_TRUE );
+ PL_UNLOCK;
if( p_playlist->p_stats )
free( p_playlist->p_stats );