Commit 0900f110 authored by Clément Stenac's avatar Clément Stenac

Finish the playlist API transition (hopefully)

 - Remove a bunch of transition now-useless API.
 - Remove all playlist_Lock* functions. Matching functions now accept a
   b_locked parameter that should be set to VLC_TRUE if the playlist is
   locked when calling the function. The advantages are that it reduces
   the API bloat and that the b_locked flag can be propagated in the
   call stack
 - Remove useless playlist testsuite
 - Remove broken daap plugin (unmaintained wrt VLC API changes, relies on 
   an unmaintained library, probably unable to read content from new itunes, 
   ...). Implementations exist in rhythmbox, xmms2 and 
   daap-sharp, we should see if a proper lib exists or if we could 
   make one
 - Reduce verbosity a bit
 - Documentation
parent a54f7868
......@@ -5064,20 +5064,6 @@ then
fi
fi
dnl
dnl DAAP access plugin and services discovery
dnl
AC_ARG_ENABLE(daap,
[ --enable-daap DAAP shares services discovery support (default enabled)])
if test "$enable_daap" != "no"
then
PKG_CHECK_MODULES(DAAP, opendaap >= 0.3.0,
[ VLC_ADD_PLUGINS([daap])
VLC_ADD_LDFLAGS([daap],[$DAAP_LIBS])
VLC_ADD_CFLAGS([daap],[$DAAP_CFLAGS])]:,
[AC_MSG_WARN(DAAP library not found)])
fi
dnl
dnl Bonjour services discovery
dnl
......
......@@ -37,12 +37,85 @@ TYPEDEF_ARRAY(input_item_t*, input_item_array_t);
* to the playlist in vlc
*
* \defgroup vlc_playlist Playlist
*
* The VLC playlist system has a tree structure. This allows advanced
* categorization, like for SAP streams (which are grouped by "sap groups").
*
* The base structure for all playlist operations is the input_item_t. This
* contains all information needed to play a stream and get info, ie, mostly,
* mrl and metadata. This structure contains a unique i_id field. ids are
* not recycled when an item is destroyed.
*
* Input items are not used directly, but through playlist items.
* The playlist items are themselves in a tree structure. They only contain
* a link to the input item, a unique id and a few flags. the playlist
* item id is NOT the same as the input item id.
* Several playlist items can be attached to a single input item. The input
* item is refcounted and is automatically destroyed when it is not used
* anymore.
*
* In the playlist itself, there are two trees, that should always be kept
* in sync. The "category" tree contains the whole tree structure with
* several levels, while the onelevel tree contains only one level :), ie
* it only contains "real" items, not nodes
* For example, if you open a directory, you will have
*
* Category tree: Onevelel tree:
* Playlist Playlist
* - Dir - item1
* - Subdir - item2
* - item1
* - item2
*
* The top-level items of both tree are the same, and they are reproduced
* in the left-part of the playlist GUIs, they are the "sources" from the
* source selectors. Top-level items include: playlist, media library, SAP,
* Shoutcast, devices, ...
*
* It is envisioned that a third tree will appear: VLM, but it's not done yet
*
* The playlist also stores, for utility purposes, an array of all input
* items, an array of all playlist items and an array of all playlist items
* and nodes (both are represented by the same structure).
*
* So, here is an example:
*
* Inputs array
* - input 1 -> name = foo 1 uri = ...
* - input 2 -> name = foo 2 uri = ...
*
* Category tree Onlevel tree
* - playlist (id 1) - playlist (id 3)
* - category 1 (id 2) - foo 2 (id 8 - input 2)
* - foo 2 (id 6 - input 2) - media library (id 4)
* - media library (id 2) - foo 1 (id6 - input 1)
* - foo 1 (id 5 - input 1)
*
* Sometimes, an item must be transformed to a node. This happens for the
* directory access for example. In that case, the item is removed from
* the onelevel tree, as it is not a real item anymore.
*
* For "standard" item addition, you can use playlist_Add, playlist_AddExt
* (more options) or playlist_AddInput if you already created your input
* item. This will add the item at the root of "Playlist" or of "Media library"
* in each of the two trees.
*
* If you want more control (like, adding the item as the child of a given
* node in the category tree, use playlist_BothAddInput. You'll have to provide
* the node in the category tree. The item will be added as a child of
* this node in the category tree, and as a child of the matching top-level
* node in the onelevel tree. (Nodes are created with playlist_NodeCreate)
*
* Generally speaking, playlist_NodeAddInput should not be used in newer code, it
* will maybe become useful again when we merge VLM;
*
* To delete an item, use playlist_DeleteFromInput( input_id ) which will
* remove all occurences of the input in both trees
*
* @{
*/
/**
* playlist export helper structure
*/
/** Helper structure to export to file part of the playlist */
struct playlist_export_t
{
char *psz_filename;
......@@ -50,10 +123,7 @@ struct playlist_export_t
playlist_item_t *p_root;
};
/**
* playlist item / node
* \see playlist_t
*/
/** playlist item / node */
struct playlist_item_t
{
input_item_t *p_input; /**< input item descriptor */
......@@ -105,19 +175,19 @@ struct playlist_t
playlist_item_array_t current; /**< Items currently being played */
int i_current_index; /**< Index in current array */
/** Reset current item ? */
/** Reset current item array */
vlc_bool_t b_reset_currently_playing;
mtime_t last_rebuild_date;
int i_last_playlist_id; /**< Last id to an item */
int i_last_input_id ; /**< Last id on an input */
services_discovery_t **pp_sds;
int i_sds;
services_discovery_t **pp_sds; /**< Loaded service discovery modules */
int i_sds; /**< Number of service discovery modules */
/* Predefined items */
playlist_item_t * p_root_category;
playlist_item_t * p_root_onelevel;
playlist_item_t * p_root_category; /**< Root of category tree */
playlist_item_t * p_root_onelevel; /**< Root of onelevel tree */
playlist_item_t * p_local_category; /** < "Playlist" in CATEGORY view */
playlist_item_t * p_ml_category; /** < "Library" in CATEGORY view */
playlist_item_t * p_local_onelevel; /** < "Playlist" in ONELEVEL view */
......@@ -166,8 +236,7 @@ struct playlist_t
// Playlist-unrelated fields
interaction_t *p_interaction; /**< Interaction manager */
/** The input thread computing stats */
input_thread_t *p_stats_computer;
input_thread_t *p_stats_computer; /**< Input thread computing stats */
global_stats_t *p_stats; /**< Global statistics */
};
......@@ -216,18 +285,16 @@ static inline playlist_t *__pl_Yield( vlc_object_t *p_this )
#define pl_Release(a) vlc_object_release( a->p_libvlc->p_playlist );
/* Playlist control */
#define playlist_Play(p) playlist_LockControl(p,PLAYLIST_PLAY )
#define playlist_Pause(p) playlist_LockControl(p,PLAYLIST_PAUSE )
#define playlist_Stop(p) playlist_LockControl(p,PLAYLIST_STOP )
#define playlist_Next(p) playlist_LockControl(p,PLAYLIST_SKIP, 1)
#define playlist_Prev(p) playlist_LockControl(p,PLAYLIST_SKIP, -1)
#define playlist_Skip(p,i) playlist_LockControl(p,PLAYLIST_SKIP, i)
#define playlist_Play(p) playlist_Control(p,PLAYLIST_PLAY, VLC_FALSE )
#define playlist_Pause(p) playlist_Control(p,PLAYLIST_PAUSE, VLC_FALSE )
#define playlist_Stop(p) playlist_Control(p,PLAYLIST_STOP, VLC_FALSE )
#define playlist_Next(p) playlist_Control(p,PLAYLIST_SKIP, VLC_FALSE, 1)
#define playlist_Prev(p) playlist_Control(p,PLAYLIST_SKIP, VLC_FALSE, -1)
#define playlist_Skip(p,i) playlist_Control(p,PLAYLIST_SKIP, VLC_FALSE, i)
VLC_EXPORT( int, playlist_Control, ( playlist_t *, int, ... ) );
VLC_EXPORT( int, playlist_LockControl, ( playlist_t *, int, ... ) );
VLC_EXPORT( int, playlist_Control, ( playlist_t *, int, vlc_bool_t, ... ) );
VLC_EXPORT( void, playlist_Clear, ( playlist_t * ) );
VLC_EXPORT( void, playlist_LockClear, ( playlist_t * ) );
VLC_EXPORT( void, playlist_Clear, ( playlist_t *, vlc_bool_t ) );
VLC_EXPORT( int, playlist_PreparseEnqueue, (playlist_t *, input_item_t *) );
VLC_EXPORT( int, playlist_PreparseEnqueueItem, (playlist_t *, playlist_item_t *) );
......@@ -245,7 +312,7 @@ VLC_EXPORT( int, playlist_TreeMove, ( playlist_t *, playlist_item_t *, playlist
VLC_EXPORT( int, playlist_NodeSort, ( playlist_t *, playlist_item_t *,int, int ) );
VLC_EXPORT( int, playlist_RecursiveNodeSort, ( playlist_t *, playlist_item_t *,int, int ) );
/* Load/Save */
/* Save a playlist file */
VLC_EXPORT( int, playlist_Export, ( playlist_t *, const char *, playlist_item_t *, const char * ) );
/********************************************************
......@@ -275,11 +342,7 @@ VLC_EXPORT( playlist_item_t *, __playlist_ItemNewFromInput, ( vlc_object_t *p_ob
/*************************** Item deletion **************************/
VLC_EXPORT( int, playlist_ItemDelete, ( playlist_item_t * ) );
VLC_EXPORT( int, playlist_DeleteAllFromInput, ( playlist_t *, int ) );
VLC_EXPORT( int, playlist_DeleteFromInput, ( playlist_t *, int, playlist_item_t *, vlc_bool_t ) );
VLC_EXPORT( int, playlist_DeleteFromItemId, ( playlist_t *, int ) );
VLC_EXPORT( int, playlist_LockDelete, ( playlist_t *, int ) );
VLC_EXPORT( int, playlist_LockDeleteAllFromInput, ( playlist_t *, int ) );
VLC_EXPORT( int, playlist_DeleteFromInput, ( playlist_t *, int, vlc_bool_t ) );
/*************************** Item fields accessors **************************/
VLC_EXPORT( int, playlist_ItemSetName, (playlist_item_t *, const char * ) );
......@@ -289,40 +352,18 @@ VLC_EXPORT( int, playlist_Add, ( playlist_t *, const char *, const char *, i
VLC_EXPORT( int, playlist_AddExt, ( playlist_t *, const char *, const char *, int, int, mtime_t, const char *const *,int, vlc_bool_t ) );
VLC_EXPORT( int, playlist_AddInput, ( playlist_t *, input_item_t *,int , int, vlc_bool_t ) );
VLC_EXPORT( playlist_item_t *, playlist_NodeAddInput, ( playlist_t *, input_item_t *,playlist_item_t *,int , int ) );
VLC_EXPORT( void, playlist_NodeAddItem, ( playlist_t *, playlist_item_t *, playlist_item_t *,int , int ) );
VLC_EXPORT( int, playlist_BothAddInput, ( playlist_t *, input_item_t *,playlist_item_t *,int , int ) );
VLC_EXPORT( int, playlist_BothAddInput, ( playlist_t *, input_item_t *,playlist_item_t *,int , int, int*, int* ) );
/********************** Misc item operations **********************/
VLC_EXPORT( playlist_item_t*, playlist_ItemToNode, (playlist_t *,playlist_item_t *) );
VLC_EXPORT( playlist_item_t*, playlist_LockItemToNode, (playlist_t *,playlist_item_t *) );
VLC_EXPORT( playlist_item_t*, playlist_ItemToNode, (playlist_t *,playlist_item_t *, vlc_bool_t) );
playlist_item_t *playlist_ItemFindFromInputAndRoot( playlist_t *p_playlist,
int i_input_id, playlist_item_t *p_root,
vlc_bool_t );
/********************************** Item search *************************/
VLC_EXPORT( playlist_item_t *, playlist_ItemGetById, (playlist_t *, int) );
VLC_EXPORT( playlist_item_t *, playlist_ItemGetByInput, (playlist_t *,input_item_t * ) );
static inline playlist_item_t *playlist_LockItemGetById( playlist_t *p_playlist,
int i_id)
{
playlist_item_t *p_ret;
vlc_mutex_lock( &p_playlist->object_lock );
p_ret = playlist_ItemGetById( p_playlist, i_id );
vlc_mutex_unlock( &p_playlist->object_lock );
return p_ret;
}
static inline playlist_item_t *playlist_LockItemGetByInput(
playlist_t *p_playlist, input_item_t *p_item )
{
playlist_item_t *p_ret;
vlc_mutex_lock( &p_playlist->object_lock );
p_ret = playlist_ItemGetByInput( p_playlist, p_item );
vlc_mutex_unlock( &p_playlist->object_lock );
return p_ret;
}
VLC_EXPORT( playlist_item_t *, playlist_ItemGetById, (playlist_t *, int, vlc_bool_t) );
VLC_EXPORT( playlist_item_t *, playlist_ItemGetByInput, (playlist_t *,input_item_t *, vlc_bool_t ) );
VLC_EXPORT( int, playlist_LiveSearchUpdate, (playlist_t *, playlist_item_t *, const char *) );
......@@ -367,7 +408,6 @@ static inline int playlist_Import( playlist_t *p_playlist, const char *psz_file)
/** Tell the number of items in the current playing context */
#define playlist_CurrentSize( obj ) obj->p_libvlc->p_playlist->current.i_size
/** Ask the playlist to do some work */
static inline void playlist_Signal( playlist_t *p_playlist )
{
......@@ -376,8 +416,6 @@ static inline void playlist_Signal( playlist_t *p_playlist )
PL_UNLOCK;
}
/**
* @}
*/
/** @} */
#endif
......@@ -256,10 +256,10 @@ struct module_symbols_t
void (*__vlc_object_release_inner) (vlc_object_t *);
vlc_list_t * (*__vlc_list_find_inner) (vlc_object_t *, int, int);
void (*vlc_list_release_inner) (vlc_list_t *);
int (*playlist_Control_inner) (playlist_t *, int, ...);
int (*playlist_LockControl_inner) (playlist_t *, int, ...);
void (*playlist_Clear_inner) (playlist_t *);
void (*playlist_LockClear_inner) (playlist_t *);
int (*playlist_Control_inner) (playlist_t *, int, vlc_bool_t, ...);
void *playlist_LockControl_deprecated;
void (*playlist_Clear_inner) (playlist_t *, vlc_bool_t);
void *playlist_LockClear_deprecated;
int (*playlist_PreparseEnqueue_inner) (playlist_t *, input_item_t *);
int (*playlist_ServicesDiscoveryAdd_inner) (playlist_t *, const char *);
int (*playlist_ServicesDiscoveryRemove_inner) (playlist_t *, const char *);
......@@ -290,20 +290,20 @@ struct module_symbols_t
int (*playlist_Add_inner) (playlist_t *, const char *, const char *, int, int, vlc_bool_t);
int (*playlist_AddExt_inner) (playlist_t *, const char *, const char *, int, int, mtime_t, const char *const *,int, vlc_bool_t);
void *playlist_ItemAdd_deprecated;
void (*playlist_NodeAddItem_inner) (playlist_t *, playlist_item_t *, playlist_item_t *,int , int);
void *playlist_NodeAddItem_deprecated;
void *playlist_Delete_deprecated;
int (*playlist_LockDelete_inner) (playlist_t *, int);
void *playlist_LockDelete_deprecated;
void *playlist_Disable_deprecated;
void *playlist_Enable_deprecated;
playlist_item_t* (*playlist_ItemToNode_inner) (playlist_t *,playlist_item_t *);
playlist_item_t* (*playlist_LockItemToNode_inner) (playlist_t *,playlist_item_t *);
playlist_item_t* (*playlist_ItemToNode_inner) (playlist_t *,playlist_item_t *, vlc_bool_t);
void *playlist_LockItemToNode_deprecated;
void *playlist_Replace_deprecated;
void *playlist_LockReplace_deprecated;
playlist_item_t * (*playlist_ItemGetById_inner) (playlist_t *, int);
playlist_item_t * (*playlist_ItemGetById_inner) (playlist_t *, int, vlc_bool_t);
void *playlist_LockItemGetById_deprecated;
void *playlist_ItemGetByPos_deprecated;
void *playlist_LockItemGetByPos_deprecated;
playlist_item_t * (*playlist_ItemGetByInput_inner) (playlist_t *,input_item_t *);
playlist_item_t * (*playlist_ItemGetByInput_inner) (playlist_t *,input_item_t *, vlc_bool_t);
void *playlist_LockItemGetByInput_deprecated;
void *playlist_GetPositionById_deprecated;
void *playlist_ItemAddOption_deprecated;
......@@ -498,16 +498,16 @@ struct module_symbols_t
void *playlist_PlaylistAdd_deprecated;
void *playlist_PlaylistAddExt_deprecated;
void *playlist_PlaylistAddInput_deprecated;
int (*playlist_BothAddInput_inner) (playlist_t *, input_item_t *,playlist_item_t *,int , int);
int (*playlist_BothAddInput_inner) (playlist_t *, input_item_t *,playlist_item_t *,int , int, int*, int*);
playlist_item_t * (*__playlist_ItemNewFromInput_inner) (vlc_object_t *p_obj,input_item_t *p_input);
input_item_t * (*input_ItemGetById_inner) (playlist_t *, int);
int (*playlist_LiveSearchUpdate_inner) (playlist_t *, playlist_item_t *, const char *);
void *vlc_input_item_AddOption_deprecated;
int (*playlist_DeleteFromInput_inner) (playlist_t *, int, playlist_item_t *, vlc_bool_t);
int (*playlist_DeleteAllFromInput_inner) (playlist_t *, int);
int (*playlist_LockDeleteAllFromInput_inner) (playlist_t *, int);
int (*playlist_DeleteFromInput_inner) (playlist_t *, int, vlc_bool_t);
void *playlist_DeleteAllFromInput_deprecated;
void *playlist_LockDeleteAllFromInput_deprecated;
void *playlist_AddWhereverNeeded_deprecated;
int (*playlist_DeleteFromItemId_inner) (playlist_t *, int);
void *playlist_DeleteFromItemId_deprecated;
void (*playlist_NodeDump_inner) (playlist_t *p_playlist, playlist_item_t *p_item, int i_level);
void *__intf_UserOkayCancel_deprecated;
int (*__intf_UserStringInput_inner) (vlc_object_t*, const char*, const char*, char **);
......@@ -793,9 +793,7 @@ struct module_symbols_t
# define __vlc_list_find (p_symbols)->__vlc_list_find_inner
# define vlc_list_release (p_symbols)->vlc_list_release_inner
# define playlist_Control (p_symbols)->playlist_Control_inner
# define playlist_LockControl (p_symbols)->playlist_LockControl_inner
# define playlist_Clear (p_symbols)->playlist_Clear_inner
# define playlist_LockClear (p_symbols)->playlist_LockClear_inner
# define playlist_PreparseEnqueue (p_symbols)->playlist_PreparseEnqueue_inner
# define playlist_ServicesDiscoveryAdd (p_symbols)->playlist_ServicesDiscoveryAdd_inner
# define playlist_ServicesDiscoveryRemove (p_symbols)->playlist_ServicesDiscoveryRemove_inner
......@@ -814,10 +812,7 @@ struct module_symbols_t
# define playlist_NodeEmpty (p_symbols)->playlist_NodeEmpty_inner
# define playlist_Add (p_symbols)->playlist_Add_inner
# define playlist_AddExt (p_symbols)->playlist_AddExt_inner
# define playlist_NodeAddItem (p_symbols)->playlist_NodeAddItem_inner
# define playlist_LockDelete (p_symbols)->playlist_LockDelete_inner
# define playlist_ItemToNode (p_symbols)->playlist_ItemToNode_inner
# define playlist_LockItemToNode (p_symbols)->playlist_LockItemToNode_inner
# define playlist_ItemGetById (p_symbols)->playlist_ItemGetById_inner
# define playlist_ItemGetByInput (p_symbols)->playlist_ItemGetByInput_inner
# define playlist_NodeSort (p_symbols)->playlist_NodeSort_inner
......@@ -994,9 +989,6 @@ struct module_symbols_t
# define input_ItemGetById (p_symbols)->input_ItemGetById_inner
# define playlist_LiveSearchUpdate (p_symbols)->playlist_LiveSearchUpdate_inner
# define playlist_DeleteFromInput (p_symbols)->playlist_DeleteFromInput_inner
# define playlist_DeleteAllFromInput (p_symbols)->playlist_DeleteAllFromInput_inner
# define playlist_LockDeleteAllFromInput (p_symbols)->playlist_LockDeleteAllFromInput_inner
# define playlist_DeleteFromItemId (p_symbols)->playlist_DeleteFromItemId_inner
# define playlist_NodeDump (p_symbols)->playlist_NodeDump_inner
# define __intf_UserStringInput (p_symbols)->__intf_UserStringInput_inner
# define input_AddSubtitles (p_symbols)->input_AddSubtitles_inner
......@@ -1273,9 +1265,7 @@ struct module_symbols_t
((p_symbols)->__vlc_list_find_inner) = __vlc_list_find; \
((p_symbols)->vlc_list_release_inner) = vlc_list_release; \
((p_symbols)->playlist_Control_inner) = playlist_Control; \
((p_symbols)->playlist_LockControl_inner) = playlist_LockControl; \
((p_symbols)->playlist_Clear_inner) = playlist_Clear; \
((p_symbols)->playlist_LockClear_inner) = playlist_LockClear; \
((p_symbols)->playlist_PreparseEnqueue_inner) = playlist_PreparseEnqueue; \
((p_symbols)->playlist_ServicesDiscoveryAdd_inner) = playlist_ServicesDiscoveryAdd; \
((p_symbols)->playlist_ServicesDiscoveryRemove_inner) = playlist_ServicesDiscoveryRemove; \
......@@ -1294,10 +1284,7 @@ struct module_symbols_t
((p_symbols)->playlist_NodeEmpty_inner) = playlist_NodeEmpty; \
((p_symbols)->playlist_Add_inner) = playlist_Add; \
((p_symbols)->playlist_AddExt_inner) = playlist_AddExt; \
((p_symbols)->playlist_NodeAddItem_inner) = playlist_NodeAddItem; \
((p_symbols)->playlist_LockDelete_inner) = playlist_LockDelete; \
((p_symbols)->playlist_ItemToNode_inner) = playlist_ItemToNode; \
((p_symbols)->playlist_LockItemToNode_inner) = playlist_LockItemToNode; \
((p_symbols)->playlist_ItemGetById_inner) = playlist_ItemGetById; \
((p_symbols)->playlist_ItemGetByInput_inner) = playlist_ItemGetByInput; \
((p_symbols)->playlist_NodeSort_inner) = playlist_NodeSort; \
......@@ -1474,9 +1461,6 @@ struct module_symbols_t
((p_symbols)->input_ItemGetById_inner) = input_ItemGetById; \
((p_symbols)->playlist_LiveSearchUpdate_inner) = playlist_LiveSearchUpdate; \
((p_symbols)->playlist_DeleteFromInput_inner) = playlist_DeleteFromInput; \
((p_symbols)->playlist_DeleteAllFromInput_inner) = playlist_DeleteAllFromInput; \
((p_symbols)->playlist_LockDeleteAllFromInput_inner) = playlist_LockDeleteAllFromInput; \
((p_symbols)->playlist_DeleteFromItemId_inner) = playlist_DeleteFromItemId; \
((p_symbols)->playlist_NodeDump_inner) = playlist_NodeDump; \
((p_symbols)->__intf_UserStringInput_inner) = __intf_UserStringInput; \
((p_symbols)->input_AddSubtitles_inner) = input_AddSubtitles; \
......@@ -1522,6 +1506,8 @@ struct module_symbols_t
(p_symbols)->sout_CfgCreate_deprecated = NULL; \
(p_symbols)->vlc_input_item_GetInfo_deprecated = NULL; \
(p_symbols)->vlc_input_item_AddInfo_deprecated = NULL; \
(p_symbols)->playlist_LockControl_deprecated = NULL; \
(p_symbols)->playlist_LockClear_deprecated = NULL; \
(p_symbols)->__playlist_ItemNew_deprecated = NULL; \
(p_symbols)->__playlist_ItemCopy_deprecated = NULL; \
(p_symbols)->playlist_ItemAddParent_deprecated = NULL; \
......@@ -1534,9 +1520,12 @@ struct module_symbols_t
(p_symbols)->playlist_ViewDump_deprecated = NULL; \
(p_symbols)->playlist_ViewEmpty_deprecated = NULL; \
(p_symbols)->playlist_ItemAdd_deprecated = NULL; \
(p_symbols)->playlist_NodeAddItem_deprecated = NULL; \
(p_symbols)->playlist_Delete_deprecated = NULL; \
(p_symbols)->playlist_LockDelete_deprecated = NULL; \
(p_symbols)->playlist_Disable_deprecated = NULL; \
(p_symbols)->playlist_Enable_deprecated = NULL; \
(p_symbols)->playlist_LockItemToNode_deprecated = NULL; \
(p_symbols)->playlist_Replace_deprecated = NULL; \
(p_symbols)->playlist_LockReplace_deprecated = NULL; \
(p_symbols)->playlist_LockItemGetById_deprecated = NULL; \
......@@ -1568,7 +1557,10 @@ struct module_symbols_t
(p_symbols)->playlist_PlaylistAddExt_deprecated = NULL; \
(p_symbols)->playlist_PlaylistAddInput_deprecated = NULL; \
(p_symbols)->vlc_input_item_AddOption_deprecated = NULL; \
(p_symbols)->playlist_DeleteAllFromInput_deprecated = NULL; \
(p_symbols)->playlist_LockDeleteAllFromInput_deprecated = NULL; \
(p_symbols)->playlist_AddWhereverNeeded_deprecated = NULL; \
(p_symbols)->playlist_DeleteFromItemId_deprecated = NULL; \
(p_symbols)->__intf_UserOkayCancel_deprecated = NULL; \
(p_symbols)->playlist_NodesCreateForSD_deprecated = NULL; \
(p_symbols)->stats_TimerClean_deprecated = NULL; \
......
......@@ -195,7 +195,7 @@ static int Open( vlc_object_t *p_this )
{
input_item_t *p_current = ( (input_thread_t*)p_access->p_parent)->
input.p_item;
p_item = playlist_LockItemGetByInput( p_playlist, p_current );
p_item = playlist_ItemGetByInput( p_playlist, p_current, VLC_FALSE );
if( !p_item )
{
......@@ -415,7 +415,7 @@ static int GetTracks( access_t *p_access,
return VLC_EGENERIC;
}
p_item_in_category = playlist_LockItemToNode( p_playlist, p_parent );
p_item_in_category = playlist_ItemToNode( p_playlist, p_parent, VLC_FALSE );
psz_name = strdup( "Audio CD" );
vlc_mutex_lock( &p_playlist->object_lock );
playlist_ItemSetName( p_parent, psz_name );
......@@ -502,7 +502,7 @@ static int GetTracks( access_t *p_access,
}
#endif
playlist_BothAddInput( p_playlist, p_input_item, p_item_in_category,
PLAYLIST_APPEND, PLAYLIST_END );
PLAYLIST_APPEND, PLAYLIST_END, NULL, NULL );
free( psz_uri ); free( psz_opt ); free( psz_name );
free( psz_first ); free( psz_last );
}
......
......@@ -844,12 +844,6 @@ CDDACreatePlaylistItem( const access_t *p_access, cdda_data_t *p_cdda,
free(psz_title);
if( !p_child ) return NULL;
#if 0
playlist_NodeAddItem( p_playlist, p_child,
p_item->p_parent->i_view,
p_item, PLAYLIST_APPEND, PLAYLIST_END );
playlist_CopyParents( p_item, p_child );
#endif
return p_child;
}
......@@ -945,8 +939,8 @@ CDDAFixupPlaylist( access_t *p_access, cdda_data_t *p_cdda,
if (p_playlist) {
p_item = playlist_LockItemGetByInput( p_playlist,
((input_thread_t *)p_access->p_parent)->input.p_item );
p_item = playlist_ItemGetByInput( p_playlist,
((input_thread_t *)p_access->p_parent)->input.p_item, VLC_FALSE );
if( p_item == p_playlist->status.p_item && !b_single_track )
{
......@@ -1030,7 +1024,7 @@ CDDAFixupPlaylist( access_t *p_access, cdda_data_t *p_cdda,
if( b_play )
{
playlist_Control( p_playlist, PLAYLIST_VIEWPLAY,
playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, VLC_TRUE,
p_playlist->status.p_item, NULL );
}
......
......@@ -185,7 +185,7 @@ static int Read( access_t *p_access, uint8_t *p_buffer, int i_len)
input_item_t *p_current_input = ( (input_thread_t*)p_access->p_parent)
->input.p_item;
playlist_item_t *p_current =
playlist_LockItemGetByInput( p_playlist, p_current_input );
playlist_ItemGetByInput( p_playlist, p_current_input, VLC_FALSE );
char *psz_name = strdup (p_access->psz_path);
if( psz_name == NULL )
......@@ -221,7 +221,7 @@ static int Read( access_t *p_access, uint8_t *p_buffer, int i_len)
msg_Dbg( p_access, "opening directory `%s'", p_access->psz_path );
p_current->p_input->i_type = ITEM_TYPE_DIRECTORY;
p_item_in_category = playlist_LockItemToNode( p_playlist, p_current );
p_item_in_category = playlist_ItemToNode( p_playlist, p_current, VLC_FALSE );
i_activity = var_GetInteger( p_playlist, "activity" );
var_SetInteger( p_playlist, "activity", i_activity +
......@@ -472,7 +472,7 @@ static int ReadDir( playlist_t *p_playlist, const char *psz_name,
playlist_BothAddInput( p_playlist, p_input,
p_parent_category,
PLAYLIST_APPEND|PLAYLIST_PREPARSE,
PLAYLIST_END );
PLAYLIST_END, NULL, NULL );
}
}
}
......
......@@ -533,7 +533,7 @@ static void FollowAnchor ( intf_thread_t *p_intf )
msg_Dbg( p_intf, "calling browser_Open with \"%s\"", psz_url );
#endif
(void) browser_Open( psz_url );
playlist_Control( p_playlist, PLAYLIST_PAUSE, 0 );
playlist_Control( p_playlist, PLAYLIST_PAUSE, VLC_TRUE, 0 );
}
free( psz_uri_to_load );
......
......@@ -800,10 +800,12 @@ static void PlayBookmark( intf_thread_t *p_intf, int i_num )
FOREACH_ARRAY( playlist_item_t *p_item, p_playlist->items )
if( !strcmp( psz_bookmark, p_item->p_input->psz_uri ) )
{
playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, NULL, p_item );
playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, VLC_TRUE,
NULL, p_item );
break;
}
FOREACH_END();
PL_UNLOCK;
vlc_object_release( p_playlist );
}
......
......@@ -197,26 +197,30 @@ void E_(MacroDo)( httpd_file_sys_t *p_args,
break;
}
playlist_Control( p_sys->p_playlist, PLAYLIST_VIEWPLAY,
NULL,
VLC_TRUE, NULL,
playlist_ItemGetById( p_sys->p_playlist,
i_item ) );
i_item, VLC_TRUE ) );
msg_Dbg( p_intf, "requested playlist item: %i", i_item );
break;
}
case MVLC_STOP:
playlist_Control( p_sys->p_playlist, PLAYLIST_STOP );
playlist_Control( p_sys->p_playlist, PLAYLIST_STOP,
VLC_TRUE );
msg_Dbg( p_intf, "requested playlist stop" );
break;
case MVLC_PAUSE:
playlist_Control( p_sys->p_playlist, PLAYLIST_PAUSE );
playlist_Control( p_sys->p_playlist, PLAYLIST_PAUSE,
VLC_TRUE );
msg_Dbg( p_intf, "requested playlist pause" );
break;
case MVLC_NEXT:
playlist_Control( p_sys->p_playlist, PLAYLIST_SKIP, 1 );
playlist_Control( p_sys->p_playlist, PLAYLIST_SKIP,
VLC_TRUE, 1 );
msg_Dbg( p_intf, "requested playlist next" );
break;
case MVLC_PREVIOUS:
playlist_Control( p_sys->p_playlist, PLAYLIST_SKIP, -1 );
playlist_Control( p_sys->p_playlist, PLAYLIST_SKIP,
VLC_TRUE, -1 );
msg_Dbg( p_intf, "requested playlist previous" );
break;
case MVLC_FULLSCREEN:
......@@ -368,8 +372,8 @@ void E_(MacroDo)( httpd_file_sys_t *p_args,
int i;
for( i = 0; i < i_nb_items; i++ )
{
playlist_LockDeleteAllFromInput( p_sys->p_playlist,
p_items[i] );
playlist_DeleteFromInput( p_sys->p_playlist,
p_items[i], VLC_FALSE );
msg_Dbg( p_intf, "requested playlist delete: %d",
p_items[i] );
p_items[i] = -1;
......@@ -410,8 +414,9 @@ void E_(MacroDo)( httpd_file_sys_t *p_args,
}
if( j == i_nb_items )
{
playlist_LockDeleteAllFromInput( p_sys->p_playlist,
p_sys->p_playlist->items.p_elems[i]->p_input->i_id );
playlist_DeleteFromInput( p_sys->p_playlist,
p_sys->p_playlist->items.p_elems[i]->p_input->i_id,
VLC_FALSE );
msg_Dbg( p_intf, "requested playlist delete: %d",
i );
}
......@@ -422,7 +427,7 @@ void E_(MacroDo)( httpd_file_sys_t *p_args,
}
case MVLC_EMPTY:
{
playlist_LockClear( p_sys->p_playlist );
playlist_Clear( p_sys->p_playlist, VLC_FALSE );
msg_Dbg( p_intf, "requested playlist empty" );
break;
}
......@@ -444,7 +449,7 @@ void E_(MacroDo)( httpd_file_sys_t *p_args,
if( !strcmp( type , "title" ) )
{
playlist_RecursiveNodeSort( p_sys->p_playlist, /*playlist_ItemGetById( p_sys->p_playlist, i_item ),*/
playlist_RecursiveNodeSort( p_sys->p_playlist,
/* Ugly hack,but not worse than before ... */
p_sys->p_playlist->p_root_onelevel,
SORT_TITLE_NODES_FIRST,
......
......@@ -489,31 +489,31 @@ void E_(EvaluateRPN)( intf_thread_t *p_intf, mvar_t *vars,
int i_id = E_(SSPopN)( st, vars );
int i_ret;
i_ret = playlist_Control( p_sys->p_playlist, PLAYLIST_VIEWPLAY,
i_ret = playlist_Control( p_sys->p_playlist, PLAYLIST_VIEWPLAY, VLC_TRUE,
NULL,
playlist_ItemGetById( p_sys->p_playlist,
i_id ) );
i_id, VLC_TRUE ) );
msg_Dbg( p_intf, "requested playlist item: %i", i_id );
E_(SSPushN)( st, i_ret );
}
else if( !strcmp( s, "vlc_stop" ) )