Commit e6e82bda authored by zorglub's avatar zorglub

Add functions to use the media library

parent af1c0e0a
...@@ -245,76 +245,131 @@ VLC_EXPORT( int, playlist_ServicesDiscoveryRemove, (playlist_t *, const char *)) ...@@ -245,76 +245,131 @@ VLC_EXPORT( int, playlist_ServicesDiscoveryRemove, (playlist_t *, const char *))
VLC_EXPORT( int, playlist_AddSDModules, (playlist_t *, char *)); VLC_EXPORT( int, playlist_AddSDModules, (playlist_t *, char *));
VLC_EXPORT( vlc_bool_t, playlist_IsServicesDiscoveryLoaded, ( playlist_t *,const char *)); VLC_EXPORT( vlc_bool_t, playlist_IsServicesDiscoveryLoaded, ( playlist_t *,const char *));
/* Playlist sorting */
VLC_EXPORT( int, playlist_TreeMove, ( playlist_t *, playlist_item_t *, playlist_item_t *, int ) );
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 */
VLC_EXPORT( int, playlist_Import, ( playlist_t *, const char *, playlist_item_t *, vlc_bool_t ) );
VLC_EXPORT( int, playlist_Export, ( playlist_t *, const char *, playlist_item_t *, const char * ) );
/********************************************************
* Item management
********************************************************/
/*************************** Item creation **************************/
/* Item management functions (act on items) */
#define playlist_ItemNew( a , b, c ) __playlist_ItemNew(VLC_OBJECT(a) , b , c )
VLC_EXPORT( playlist_item_t* , __playlist_ItemNew, ( vlc_object_t *,const char *,const char * ) );
VLC_EXPORT( playlist_item_t* , playlist_ItemNewWithType, ( vlc_object_t *,const char *,const char *, int , const char **, int, int) ); VLC_EXPORT( playlist_item_t* , playlist_ItemNewWithType, ( vlc_object_t *,const char *,const char *, int , const char **, int, int) );
#define playlist_ItemNew( a , b, c ) __playlist_ItemNew(VLC_OBJECT(a) , b , c )
/** Create a new item, without adding it to the playlist
* \param p_obj a vlc object (anyone will do)
* \param psz_uri the mrl of the item
* \param psz_name a text giving a name or description of the item
* \return the new item or NULL on failure
*/
static inline playlist_item_t * __playlist_ItemNew( vlc_object_t *p_obj,
const char *psz_uri, const char *psz_name )
{
/* 0 = ITEM_TYPE_UNKNOWN */
return playlist_ItemNewWithType( p_obj, psz_uri, psz_name, 0, NULL, -1,0);
}
#define playlist_ItemNewFromInput(a,b) __playlist_ItemNewFromInput(VLC_OBJECT(a),b) #define playlist_ItemNewFromInput(a,b) __playlist_ItemNewFromInput(VLC_OBJECT(a),b)
VLC_EXPORT( playlist_item_t *, __playlist_ItemNewFromInput, ( vlc_object_t *p_obj,input_item_t *p_input ) ); VLC_EXPORT( playlist_item_t *, __playlist_ItemNewFromInput, ( vlc_object_t *p_obj,input_item_t *p_input ) );
/*************************** Item deletion **************************/
VLC_EXPORT( int, playlist_ItemDelete, ( playlist_item_t * ) ); 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 ) );
/* Item informations accessors */ /*************************** Item fields accessors **************************/
VLC_EXPORT( int, playlist_ItemSetName, (playlist_item_t *, char * ) ); VLC_EXPORT( int, playlist_ItemSetName, (playlist_item_t *, char * ) );
VLC_EXPORT( int, playlist_ItemSetDuration, (playlist_item_t *, mtime_t ) );
VLC_EXPORT( void, playlist_ItemAddOption, (playlist_item_t *, const char *) ); /******************** Item addition ********************/
VLC_EXPORT( int, playlist_Add, ( playlist_t *, const char *, const char *, int, int, vlc_bool_t ) );
VLC_EXPORT( int, playlist_AddExt, ( playlist_t *, const char *, const char *, int, int, mtime_t, const char **,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( void, playlist_AddWhereverNeeded, (playlist_t* , input_item_t*, playlist_item_t*,playlist_item_t*,vlc_bool_t, int ) );
VLC_EXPORT(void, playlist_NodeDump, ( playlist_t *p_playlist, playlist_item_t *p_item, int i_level ) ); /** Add a MRL into the playlist.
* \see playlist_Add
*/
static inline int playlist_PlaylistAdd( playlist_t *p_playlist,
const char *psz_uri, const char *psz_name,
int i_mode, int i_pos )
{
return playlist_Add( p_playlist, psz_uri, psz_name, i_mode, i_pos,
VLC_TRUE);
}
/** Counts the items of a view */ /** Add a MRL to the media library
VLC_EXPORT( int, playlist_NodeChildrenCount, (playlist_t *,playlist_item_t* ) ); * \see playlist_Add
*/
static inline int playlist_MLAdd( playlist_t *p_playlist, const char *psz_uri,
const char *psz_name, int i_mode, int i_pos )
{
return playlist_Add( p_playlist, psz_uri, psz_name, i_mode, i_pos,
VLC_FALSE );
}
/* Node management */ /** Add a MRL to the playlist, with duration and options given
VLC_EXPORT( playlist_item_t *, playlist_NodeCreate, ( playlist_t *, char *, playlist_item_t * p_parent ) ); * \see playlist_AddExt
VLC_EXPORT( int, playlist_NodeAppend, (playlist_t *,playlist_item_t*,playlist_item_t *) ); */
VLC_EXPORT( int, playlist_NodeInsert, (playlist_t *,playlist_item_t*,playlist_item_t *, int) ); static inline int playlist_PlaylistAddExt( playlist_t *p_playlist,
VLC_EXPORT( int, playlist_NodeRemoveItem, (playlist_t *,playlist_item_t*,playlist_item_t *) ); const char * psz_uri, const char *psz_name, int i_mode, int i_pos,
VLC_EXPORT( playlist_item_t *, playlist_ChildSearchName, (playlist_item_t*, const char* ) ); mtime_t i_duration, const char **ppsz_options, int i_options )
VLC_EXPORT( int, playlist_NodeDelete, ( playlist_t *, playlist_item_t *, vlc_bool_t , vlc_bool_t ) ); {
VLC_EXPORT( int, playlist_NodeEmpty, ( playlist_t *, playlist_item_t *, vlc_bool_t ) ); return playlist_AddExt( p_playlist, psz_uri, psz_name, i_mode, i_pos,
VLC_EXPORT( void, playlist_NodesCreateForSD, (playlist_t *, char *, playlist_item_t **, playlist_item_t ** ) ); i_duration, ppsz_options, i_options, VLC_TRUE );
}
/* Tree walking - These functions are only for playlist, not plugins */ /** Add a MRL to the media library, with duration and options given
playlist_item_t *playlist_GetNextLeaf( playlist_t *p_playlist, * \see playlist_AddExt
playlist_item_t *p_root, */
playlist_item_t *p_item ); static inline int playlist_MLAddExt( playlist_t *p_playlist,
playlist_item_t *playlist_GetNextEnabledLeaf( playlist_t *p_playlist, const char * psz_uri, const char *psz_name, int i_mode, int i_pos,
playlist_item_t *p_root, mtime_t i_duration, const char **ppsz_options, int i_options )
playlist_item_t *p_item ); {
playlist_item_t *playlist_GetPrevLeaf( playlist_t *p_playlist, return playlist_AddExt( p_playlist, psz_uri, psz_name, i_mode, i_pos,
playlist_item_t *p_root, i_duration, ppsz_options, i_options, VLC_FALSE );
playlist_item_t *p_item ); }
playlist_item_t *playlist_GetLastLeaf( playlist_t *p_playlist,
playlist_item_t *p_root );
/** Add an input item to the playlist node
* \see playlist_AddInput
*/
static inline int playlist_PlaylistAddInput( playlist_t* p_playlist,
input_item_t *p_input, int i_mode, int i_pos )
{
return playlist_AddInput( p_playlist, p_input, i_mode, i_pos, VLC_TRUE );
}
/* Simple add/remove functions */ /** Add an input item to the media library
VLC_EXPORT( int, playlist_PlaylistAdd, ( playlist_t *, const char *, const char *, int, int ) ); * \see playlist_AddInput
VLC_EXPORT( int, playlist_PlaylistAddExt, ( playlist_t *, const char *, const char *, int, int, mtime_t, const char **,int ) ); */
VLC_EXPORT( int, playlist_PlaylistAddInput, ( playlist_t *, input_item_t *,int , int ) ); static inline int playlist_MLAddInput( playlist_t* p_playlist,
VLC_EXPORT( playlist_item_t *, playlist_NodeAddInput, ( playlist_t *, input_item_t *,playlist_item_t *,int , int ) ); input_item_t *p_input, int i_mode, int i_pos )
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 ) ); return playlist_AddInput( p_playlist, p_input, i_mode, i_pos, VLC_FALSE );
VLC_EXPORT( void, playlist_AddWhereverNeeded, (playlist_t* , input_item_t*, playlist_item_t*,playlist_item_t*,vlc_bool_t, int ) ); }
void playlist_SendAddNotify( playlist_t *p_playlist, int i_item_id, int i_node_id ); void playlist_SendAddNotify( playlist_t *p_playlist, int i_item_id, int i_node_id );
/* Misc item operations (act on item+playlist) */ /********************** Misc item operations **********************/
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( playlist_item_t*, playlist_ItemToNode, (playlist_t *,playlist_item_t *) ); 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_LockItemToNode, (playlist_t *,playlist_item_t *) );
playlist_item_t *playlist_ItemFindFromInputAndRoot( playlist_t *p_playlist, playlist_item_t *playlist_ItemFindFromInputAndRoot( playlist_t *p_playlist,
int i_input_id, playlist_item_t *p_root ); int i_input_id, playlist_item_t *p_root );
/* Item search functions */ /********************************** Item search *************************/
VLC_EXPORT( playlist_item_t *, playlist_ItemGetById, (playlist_t *, int) ); VLC_EXPORT( playlist_item_t *, playlist_ItemGetById, (playlist_t *, int) );
VLC_EXPORT( playlist_item_t *, playlist_ItemGetByInput, (playlist_t *,input_item_t * ) ); VLC_EXPORT( playlist_item_t *, playlist_ItemGetByInput, (playlist_t *,input_item_t * ) );
...@@ -340,14 +395,34 @@ static inline playlist_item_t *playlist_LockItemGetByInput( ...@@ -340,14 +395,34 @@ static inline playlist_item_t *playlist_LockItemGetByInput(
VLC_EXPORT( int, playlist_LiveSearchUpdate, (playlist_t *, playlist_item_t *, const char *) ); VLC_EXPORT( int, playlist_LiveSearchUpdate, (playlist_t *, playlist_item_t *, const char *) );
/* Playlist sorting */ /********************************************************
VLC_EXPORT( int, playlist_TreeMove, ( playlist_t *, playlist_item_t *, playlist_item_t *, int ) ); * Tree management
VLC_EXPORT( int, playlist_NodeSort, ( playlist_t *, playlist_item_t *,int, int ) ); ********************************************************/
VLC_EXPORT( int, playlist_RecursiveNodeSort, ( playlist_t *, playlist_item_t *,int, int ) ); VLC_EXPORT(void, playlist_NodeDump, ( playlist_t *p_playlist, playlist_item_t *p_item, int i_level ) );
VLC_EXPORT( int, playlist_NodeChildrenCount, (playlist_t *,playlist_item_t* ) );
/* Load/Save */ /* Node management */
VLC_EXPORT( int, playlist_Import, ( playlist_t *, const char *, playlist_item_t *, vlc_bool_t ) ); VLC_EXPORT( playlist_item_t *, playlist_NodeCreate, ( playlist_t *, char *, playlist_item_t * p_parent ) );
VLC_EXPORT( int, playlist_Export, ( playlist_t *, const char *, playlist_item_t *, const char * ) ); VLC_EXPORT( int, playlist_NodeAppend, (playlist_t *,playlist_item_t*,playlist_item_t *) );
VLC_EXPORT( int, playlist_NodeInsert, (playlist_t *,playlist_item_t*,playlist_item_t *, int) );
VLC_EXPORT( int, playlist_NodeRemoveItem, (playlist_t *,playlist_item_t*,playlist_item_t *) );
VLC_EXPORT( playlist_item_t *, playlist_ChildSearchName, (playlist_item_t*, const char* ) );
VLC_EXPORT( int, playlist_NodeDelete, ( playlist_t *, playlist_item_t *, vlc_bool_t , vlc_bool_t ) );
VLC_EXPORT( int, playlist_NodeEmpty, ( playlist_t *, playlist_item_t *, vlc_bool_t ) );
VLC_EXPORT( void, playlist_NodesCreateForSD, (playlist_t *, char *, playlist_item_t **, playlist_item_t ** ) );
/* Tree walking - These functions are only for playlist, not plugins */
playlist_item_t *playlist_GetNextLeaf( playlist_t *p_playlist,
playlist_item_t *p_root,
playlist_item_t *p_item );
playlist_item_t *playlist_GetNextEnabledLeaf( playlist_t *p_playlist,
playlist_item_t *p_root,
playlist_item_t *p_item );
playlist_item_t *playlist_GetPrevLeaf( playlist_t *p_playlist,
playlist_item_t *p_root,
playlist_item_t *p_item );
playlist_item_t *playlist_GetLastLeaf( playlist_t *p_playlist,
playlist_item_t *p_root );
/*********************************************************************** /***********************************************************************
* Inline functions * Inline functions
......
...@@ -265,14 +265,14 @@ struct module_symbols_t ...@@ -265,14 +265,14 @@ struct module_symbols_t
int (*playlist_ServicesDiscoveryRemove_inner) (playlist_t *, const char *); int (*playlist_ServicesDiscoveryRemove_inner) (playlist_t *, const char *);
int (*playlist_AddSDModules_inner) (playlist_t *, char *); int (*playlist_AddSDModules_inner) (playlist_t *, char *);
vlc_bool_t (*playlist_IsServicesDiscoveryLoaded_inner) (playlist_t *,const char *); vlc_bool_t (*playlist_IsServicesDiscoveryLoaded_inner) (playlist_t *,const char *);
playlist_item_t* (*__playlist_ItemNew_inner) (vlc_object_t *,const char *,const char *); void *__playlist_ItemNew_deprecated;
void *__playlist_ItemCopy_deprecated; void *__playlist_ItemCopy_deprecated;
playlist_item_t* (*playlist_ItemNewWithType_inner) (vlc_object_t *,const char *,const char *, int , const char **, int, int); playlist_item_t* (*playlist_ItemNewWithType_inner) (vlc_object_t *,const char *,const char *, int , const char **, int, int);
int (*playlist_ItemDelete_inner) (playlist_item_t *); int (*playlist_ItemDelete_inner) (playlist_item_t *);
void *playlist_ItemAddParent_deprecated; void *playlist_ItemAddParent_deprecated;
void *playlist_CopyParents_deprecated; void *playlist_CopyParents_deprecated;
int (*playlist_ItemSetName_inner) (playlist_item_t *, char *); int (*playlist_ItemSetName_inner) (playlist_item_t *, char *);
int (*playlist_ItemSetDuration_inner) (playlist_item_t *, mtime_t); void *playlist_ItemSetDuration_deprecated;
void *playlist_ViewInsert_deprecated; void *playlist_ViewInsert_deprecated;
void *playlist_ViewDelete_deprecated; void *playlist_ViewDelete_deprecated;
void *playlist_ViewFind_deprecated; void *playlist_ViewFind_deprecated;
...@@ -287,8 +287,8 @@ struct module_symbols_t ...@@ -287,8 +287,8 @@ struct module_symbols_t
playlist_item_t * (*playlist_ChildSearchName_inner) (playlist_item_t*, const char*); playlist_item_t * (*playlist_ChildSearchName_inner) (playlist_item_t*, const char*);
int (*playlist_NodeDelete_inner) (playlist_t *, playlist_item_t *, vlc_bool_t , vlc_bool_t); int (*playlist_NodeDelete_inner) (playlist_t *, playlist_item_t *, vlc_bool_t , vlc_bool_t);
int (*playlist_NodeEmpty_inner) (playlist_t *, playlist_item_t *, vlc_bool_t); int (*playlist_NodeEmpty_inner) (playlist_t *, playlist_item_t *, vlc_bool_t);
void *playlist_Add_deprecated; int (*playlist_Add_inner) (playlist_t *, const char *, const char *, int, int, vlc_bool_t);
void *playlist_AddExt_deprecated; int (*playlist_AddExt_inner) (playlist_t *, const char *, const char *, int, int, mtime_t, const char **,int, vlc_bool_t);
void *playlist_ItemAdd_deprecated; void *playlist_ItemAdd_deprecated;
void (*playlist_NodeAddItem_inner) (playlist_t *, playlist_item_t *, playlist_item_t *,int , int); void (*playlist_NodeAddItem_inner) (playlist_t *, playlist_item_t *, playlist_item_t *,int , int);
void *playlist_Delete_deprecated; void *playlist_Delete_deprecated;
...@@ -306,7 +306,7 @@ struct module_symbols_t ...@@ -306,7 +306,7 @@ struct module_symbols_t
playlist_item_t * (*playlist_ItemGetByInput_inner) (playlist_t *,input_item_t *); playlist_item_t * (*playlist_ItemGetByInput_inner) (playlist_t *,input_item_t *);
void *playlist_LockItemGetByInput_deprecated; void *playlist_LockItemGetByInput_deprecated;
void *playlist_GetPositionById_deprecated; void *playlist_GetPositionById_deprecated;
void (*playlist_ItemAddOption_inner) (playlist_item_t *, const char *); void *playlist_ItemAddOption_deprecated;
void *playlist_Sort_deprecated; void *playlist_Sort_deprecated;
void *playlist_Move_deprecated; void *playlist_Move_deprecated;
void *playlist_NodeGroup_deprecated; void *playlist_NodeGroup_deprecated;
...@@ -495,9 +495,9 @@ struct module_symbols_t ...@@ -495,9 +495,9 @@ struct module_symbols_t
input_item_t * (*__input_ItemNewExt_inner) (vlc_object_t *, const char *, const char*, int, const char **, int); input_item_t * (*__input_ItemNewExt_inner) (vlc_object_t *, const char *, const char*, int, const char **, int);
input_item_t * (*input_ItemNewWithType_inner) (vlc_object_t *, const char *, const char *e, int, const char **, int, int); input_item_t * (*input_ItemNewWithType_inner) (vlc_object_t *, const char *, const char *e, int, const char **, int, int);
playlist_item_t * (*playlist_NodeAddInput_inner) (playlist_t *, input_item_t *,playlist_item_t *,int , int); playlist_item_t * (*playlist_NodeAddInput_inner) (playlist_t *, input_item_t *,playlist_item_t *,int , int);
int (*playlist_PlaylistAdd_inner) (playlist_t *, const char *, const char *, int, int); void *playlist_PlaylistAdd_deprecated;
int (*playlist_PlaylistAddExt_inner) (playlist_t *, const char *, const char *, int, int, mtime_t, const char **,int); void *playlist_PlaylistAddExt_deprecated;
int (*playlist_PlaylistAddInput_inner) (playlist_t *, input_item_t *,int , int); 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);
playlist_item_t * (*__playlist_ItemNewFromInput_inner) (vlc_object_t *p_obj,input_item_t *p_input); 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); input_item_t * (*input_ItemGetById_inner) (playlist_t *, int);
...@@ -524,6 +524,7 @@ struct module_symbols_t ...@@ -524,6 +524,7 @@ struct module_symbols_t
vlc_bool_t (*__intf_UserProgressIsCancelled_inner) (vlc_object_t*, int); vlc_bool_t (*__intf_UserProgressIsCancelled_inner) (vlc_object_t*, int);
int (*__intf_Progress_inner) (vlc_object_t*, const char*, const char*, float, int); int (*__intf_Progress_inner) (vlc_object_t*, const char*, const char*, float, int);
void (*__intf_ProgressUpdate_inner) (vlc_object_t*, int, const char*, float, int); void (*__intf_ProgressUpdate_inner) (vlc_object_t*, int, const char*, float, int);
int (*playlist_AddInput_inner) (playlist_t *, input_item_t *,int , int, vlc_bool_t);
}; };
# if defined (__PLUGIN__) # if defined (__PLUGIN__)
# define aout_FiltersCreatePipeline (p_symbols)->aout_FiltersCreatePipeline_inner # define aout_FiltersCreatePipeline (p_symbols)->aout_FiltersCreatePipeline_inner
...@@ -771,11 +772,9 @@ struct module_symbols_t ...@@ -771,11 +772,9 @@ struct module_symbols_t
# define playlist_ServicesDiscoveryRemove (p_symbols)->playlist_ServicesDiscoveryRemove_inner # define playlist_ServicesDiscoveryRemove (p_symbols)->playlist_ServicesDiscoveryRemove_inner
# define playlist_AddSDModules (p_symbols)->playlist_AddSDModules_inner # define playlist_AddSDModules (p_symbols)->playlist_AddSDModules_inner
# define playlist_IsServicesDiscoveryLoaded (p_symbols)->playlist_IsServicesDiscoveryLoaded_inner # define playlist_IsServicesDiscoveryLoaded (p_symbols)->playlist_IsServicesDiscoveryLoaded_inner
# define __playlist_ItemNew (p_symbols)->__playlist_ItemNew_inner
# define playlist_ItemNewWithType (p_symbols)->playlist_ItemNewWithType_inner # define playlist_ItemNewWithType (p_symbols)->playlist_ItemNewWithType_inner
# define playlist_ItemDelete (p_symbols)->playlist_ItemDelete_inner # define playlist_ItemDelete (p_symbols)->playlist_ItemDelete_inner
# define playlist_ItemSetName (p_symbols)->playlist_ItemSetName_inner # define playlist_ItemSetName (p_symbols)->playlist_ItemSetName_inner
# define playlist_ItemSetDuration (p_symbols)->playlist_ItemSetDuration_inner
# define playlist_NodeCreate (p_symbols)->playlist_NodeCreate_inner # define playlist_NodeCreate (p_symbols)->playlist_NodeCreate_inner
# define playlist_NodeAppend (p_symbols)->playlist_NodeAppend_inner # define playlist_NodeAppend (p_symbols)->playlist_NodeAppend_inner
# define playlist_NodeInsert (p_symbols)->playlist_NodeInsert_inner # define playlist_NodeInsert (p_symbols)->playlist_NodeInsert_inner
...@@ -784,13 +783,14 @@ struct module_symbols_t ...@@ -784,13 +783,14 @@ struct module_symbols_t
# define playlist_ChildSearchName (p_symbols)->playlist_ChildSearchName_inner # define playlist_ChildSearchName (p_symbols)->playlist_ChildSearchName_inner
# define playlist_NodeDelete (p_symbols)->playlist_NodeDelete_inner # define playlist_NodeDelete (p_symbols)->playlist_NodeDelete_inner
# define playlist_NodeEmpty (p_symbols)->playlist_NodeEmpty_inner # 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_NodeAddItem (p_symbols)->playlist_NodeAddItem_inner
# define playlist_LockDelete (p_symbols)->playlist_LockDelete_inner # define playlist_LockDelete (p_symbols)->playlist_LockDelete_inner
# define playlist_ItemToNode (p_symbols)->playlist_ItemToNode_inner # define playlist_ItemToNode (p_symbols)->playlist_ItemToNode_inner
# define playlist_LockItemToNode (p_symbols)->playlist_LockItemToNode_inner # define playlist_LockItemToNode (p_symbols)->playlist_LockItemToNode_inner
# define playlist_ItemGetById (p_symbols)->playlist_ItemGetById_inner # define playlist_ItemGetById (p_symbols)->playlist_ItemGetById_inner
# define playlist_ItemGetByInput (p_symbols)->playlist_ItemGetByInput_inner # define playlist_ItemGetByInput (p_symbols)->playlist_ItemGetByInput_inner
# define playlist_ItemAddOption (p_symbols)->playlist_ItemAddOption_inner
# define playlist_NodeSort (p_symbols)->playlist_NodeSort_inner # define playlist_NodeSort (p_symbols)->playlist_NodeSort_inner
# define playlist_RecursiveNodeSort (p_symbols)->playlist_RecursiveNodeSort_inner # define playlist_RecursiveNodeSort (p_symbols)->playlist_RecursiveNodeSort_inner
# define playlist_Import (p_symbols)->playlist_Import_inner # define playlist_Import (p_symbols)->playlist_Import_inner
...@@ -967,9 +967,6 @@ struct module_symbols_t ...@@ -967,9 +967,6 @@ struct module_symbols_t
# define __input_ItemNewExt (p_symbols)->__input_ItemNewExt_inner # define __input_ItemNewExt (p_symbols)->__input_ItemNewExt_inner
# define input_ItemNewWithType (p_symbols)->input_ItemNewWithType_inner # define input_ItemNewWithType (p_symbols)->input_ItemNewWithType_inner
# define playlist_NodeAddInput (p_symbols)->playlist_NodeAddInput_inner # define playlist_NodeAddInput (p_symbols)->playlist_NodeAddInput_inner
# define playlist_PlaylistAdd (p_symbols)->playlist_PlaylistAdd_inner
# define playlist_PlaylistAddExt (p_symbols)->playlist_PlaylistAddExt_inner
# define playlist_PlaylistAddInput (p_symbols)->playlist_PlaylistAddInput_inner
# define playlist_BothAddInput (p_symbols)->playlist_BothAddInput_inner # define playlist_BothAddInput (p_symbols)->playlist_BothAddInput_inner
# define __playlist_ItemNewFromInput (p_symbols)->__playlist_ItemNewFromInput_inner # define __playlist_ItemNewFromInput (p_symbols)->__playlist_ItemNewFromInput_inner
# define input_ItemGetById (p_symbols)->input_ItemGetById_inner # define input_ItemGetById (p_symbols)->input_ItemGetById_inner
...@@ -990,6 +987,7 @@ struct module_symbols_t ...@@ -990,6 +987,7 @@ struct module_symbols_t
# define __intf_UserProgressIsCancelled (p_symbols)->__intf_UserProgressIsCancelled_inner # define __intf_UserProgressIsCancelled (p_symbols)->__intf_UserProgressIsCancelled_inner
# define __intf_Progress (p_symbols)->__intf_Progress_inner # define __intf_Progress (p_symbols)->__intf_Progress_inner
# define __intf_ProgressUpdate (p_symbols)->__intf_ProgressUpdate_inner # define __intf_ProgressUpdate (p_symbols)->__intf_ProgressUpdate_inner
# define playlist_AddInput (p_symbols)->playlist_AddInput_inner
# elif defined (HAVE_DYNAMIC_PLUGINS) && !defined (__BUILTIN__) # elif defined (HAVE_DYNAMIC_PLUGINS) && !defined (__BUILTIN__)
/****************************************************************** /******************************************************************
* STORE_SYMBOLS: store VLC APIs into p_symbols for plugin access. * STORE_SYMBOLS: store VLC APIs into p_symbols for plugin access.
...@@ -1240,11 +1238,9 @@ struct module_symbols_t ...@@ -1240,11 +1238,9 @@ struct module_symbols_t
((p_symbols)->playlist_ServicesDiscoveryRemove_inner) = playlist_ServicesDiscoveryRemove; \ ((p_symbols)->playlist_ServicesDiscoveryRemove_inner) = playlist_ServicesDiscoveryRemove; \
((p_symbols)->playlist_AddSDModules_inner) = playlist_AddSDModules; \ ((p_symbols)->playlist_AddSDModules_inner) = playlist_AddSDModules; \
((p_symbols)->playlist_IsServicesDiscoveryLoaded_inner) = playlist_IsServicesDiscoveryLoaded; \ ((p_symbols)->playlist_IsServicesDiscoveryLoaded_inner) = playlist_IsServicesDiscoveryLoaded; \
((p_symbols)->__playlist_ItemNew_inner) = __playlist_ItemNew; \
((p_symbols)->playlist_ItemNewWithType_inner) = playlist_ItemNewWithType; \ ((p_symbols)->playlist_ItemNewWithType_inner) = playlist_ItemNewWithType; \
((p_symbols)->playlist_ItemDelete_inner) = playlist_ItemDelete; \ ((p_symbols)->playlist_ItemDelete_inner) = playlist_ItemDelete; \
((p_symbols)->playlist_ItemSetName_inner) = playlist_ItemSetName; \ ((p_symbols)->playlist_ItemSetName_inner) = playlist_ItemSetName; \
((p_symbols)->playlist_ItemSetDuration_inner) = playlist_ItemSetDuration; \
((p_symbols)->playlist_NodeCreate_inner) = playlist_NodeCreate; \ ((p_symbols)->playlist_NodeCreate_inner) = playlist_NodeCreate; \
((p_symbols)->playlist_NodeAppend_inner) = playlist_NodeAppend; \ ((p_symbols)->playlist_NodeAppend_inner) = playlist_NodeAppend; \
((p_symbols)->playlist_NodeInsert_inner) = playlist_NodeInsert; \ ((p_symbols)->playlist_NodeInsert_inner) = playlist_NodeInsert; \
...@@ -1253,13 +1249,14 @@ struct module_symbols_t ...@@ -1253,13 +1249,14 @@ struct module_symbols_t
((p_symbols)->playlist_ChildSearchName_inner) = playlist_ChildSearchName; \ ((p_symbols)->playlist_ChildSearchName_inner) = playlist_ChildSearchName; \
((p_symbols)->playlist_NodeDelete_inner) = playlist_NodeDelete; \ ((p_symbols)->playlist_NodeDelete_inner) = playlist_NodeDelete; \
((p_symbols)->playlist_NodeEmpty_inner) = playlist_NodeEmpty; \ ((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_NodeAddItem_inner) = playlist_NodeAddItem; \
((p_symbols)->playlist_LockDelete_inner) = playlist_LockDelete; \ ((p_symbols)->playlist_LockDelete_inner) = playlist_LockDelete; \
((p_symbols)->playlist_ItemToNode_inner) = playlist_ItemToNode; \ ((p_symbols)->playlist_ItemToNode_inner) = playlist_ItemToNode; \
((p_symbols)->playlist_LockItemToNode_inner) = playlist_LockItemToNode; \ ((p_symbols)->playlist_LockItemToNode_inner) = playlist_LockItemToNode; \
((p_symbols)->playlist_ItemGetById_inner) = playlist_ItemGetById; \ ((p_symbols)->playlist_ItemGetById_inner) = playlist_ItemGetById; \
((p_symbols)->playlist_ItemGetByInput_inner) = playlist_ItemGetByInput; \ ((p_symbols)->playlist_ItemGetByInput_inner) = playlist_ItemGetByInput; \
((p_symbols)->playlist_ItemAddOption_inner) = playlist_ItemAddOption; \
((p_symbols)->playlist_NodeSort_inner) = playlist_NodeSort; \ ((p_symbols)->playlist_NodeSort_inner) = playlist_NodeSort; \
((p_symbols)->playlist_RecursiveNodeSort_inner) = playlist_RecursiveNodeSort; \ ((p_symbols)->playlist_RecursiveNodeSort_inner) = playlist_RecursiveNodeSort; \
((p_symbols)->playlist_Import_inner) = playlist_Import; \ ((p_symbols)->playlist_Import_inner) = playlist_Import; \
...@@ -1436,9 +1433,6 @@ struct module_symbols_t ...@@ -1436,9 +1433,6 @@ struct module_symbols_t
((p_symbols)->__input_ItemNewExt_inner) = __input_ItemNewExt; \ ((p_symbols)->__input_ItemNewExt_inner) = __input_ItemNewExt; \
((p_symbols)->input_ItemNewWithType_inner) = input_ItemNewWithType; \ ((p_symbols)->input_ItemNewWithType_inner) = input_ItemNewWithType; \
((p_symbols)->playlist_NodeAddInput_inner) = playlist_NodeAddInput; \ ((p_symbols)->playlist_NodeAddInput_inner) = playlist_NodeAddInput; \
((p_symbols)->playlist_PlaylistAdd_inner) = playlist_PlaylistAdd; \
((p_symbols)->playlist_PlaylistAddExt_inner) = playlist_PlaylistAddExt; \
((p_symbols)->playlist_PlaylistAddInput_inner) = playlist_PlaylistAddInput; \
((p_symbols)->playlist_BothAddInput_inner) = playlist_BothAddInput; \ ((p_symbols)->playlist_BothAddInput_inner) = playlist_BothAddInput; \
((p_symbols)->__playlist_ItemNewFromInput_inner) = __playlist_ItemNewFromInput; \ ((p_symbols)->__playlist_ItemNewFromInput_inner) = __playlist_ItemNewFromInput; \
((p_symbols)->input_ItemGetById_inner) = input_ItemGetById; \ ((p_symbols)->input_ItemGetById_inner) = input_ItemGetById; \
...@@ -1459,18 +1453,19 @@ struct module_symbols_t ...@@ -1459,18 +1453,19 @@ struct module_symbols_t
((p_symbols)->__intf_UserProgressIsCancelled_inner) = __intf_UserProgressIsCancelled; \ ((p_symbols)->__intf_UserProgressIsCancelled_inner) = __intf_UserProgressIsCancelled; \
((p_symbols)->__intf_Progress_inner) = __intf_Progress; \ ((p_symbols)->__intf_Progress_inner) = __intf_Progress; \
((p_symbols)->__intf_ProgressUpdate_inner) = __intf_ProgressUpdate; \ ((p_symbols)->__intf_ProgressUpdate_inner) = __intf_ProgressUpdate; \
((p_symbols)->playlist_AddInput_inner) = playlist_AddInput; \
(p_symbols)->net_ConvertIPv4_deprecated = NULL; \ (p_symbols)->net_ConvertIPv4_deprecated = NULL; \
(p_symbols)->__playlist_ItemNew_deprecated = NULL; \
(p_symbols)->__playlist_ItemCopy_deprecated = NULL; \ (p_symbols)->__playlist_ItemCopy_deprecated = NULL; \
(p_symbols)->playlist_ItemAddParent_deprecated = NULL; \ (p_symbols)->playlist_ItemAddParent_deprecated = NULL; \
(p_symbols)->playlist_CopyParents_deprecated = NULL; \ (p_symbols)->playlist_CopyParents_deprecated = NULL; \
(p_symbols)->playlist_ItemSetDuration_deprecated = NULL; \
(p_symbols)->playlist_ViewInsert_deprecated = NULL; \ (p_symbols)->playlist_ViewInsert_deprecated = NULL; \
(p_symbols)->playlist_ViewDelete_deprecated = NULL; \ (p_symbols)->playlist_ViewDelete_deprecated = NULL; \
(p_symbols)->playlist_ViewFind_deprecated = NULL; \ (p_symbols)->playlist_ViewFind_deprecated = NULL; \
(p_symbols)->playlist_ViewUpdate_deprecated = NULL; \ (p_symbols)->playlist_ViewUpdate_deprecated = NULL; \
(p_symbols)->playlist_ViewDump_deprecated = NULL; \ (p_symbols)->playlist_ViewDump_deprecated = NULL; \
(p_symbols)->playlist_ViewEmpty_deprecated = NULL; \ (p_symbols)->playlist_ViewEmpty_deprecated = NULL; \
(p_symbols)->playlist_Add_deprecated = NULL; \
(p_symbols)->playlist_AddExt_deprecated = NULL; \
(p_symbols)->playlist_ItemAdd_deprecated = NULL; \ (p_symbols)->playlist_ItemAdd_deprecated = NULL; \
(p_symbols)->playlist_Delete_deprecated = NULL; \ (p_symbols)->playlist_Delete_deprecated = NULL; \
(p_symbols)->playlist_Disable_deprecated = NULL; \ (p_symbols)->playlist_Disable_deprecated = NULL; \
...@@ -1482,6 +1477,7 @@ struct module_symbols_t ...@@ -1482,6 +1477,7 @@ struct module_symbols_t
(p_symbols)->playlist_LockItemGetByPos_deprecated = NULL; \ (p_symbols)->playlist_LockItemGetByPos_deprecated = NULL; \
(p_symbols)->playlist_LockItemGetByInput_deprecated = NULL; \ (p_symbols)->playlist_LockItemGetByInput_deprecated = NULL; \
(p_symbols)->playlist_GetPositionById_deprecated = NULL; \ (p_symbols)->playlist_GetPositionById_deprecated = NULL; \
(p_symbols)->playlist_ItemAddOption_deprecated = NULL; \
(p_symbols)->playlist_Sort_deprecated = NULL; \ (p_symbols)->playlist_Sort_deprecated = NULL; \
(p_symbols)->playlist_Move_deprecated = NULL; \ (p_symbols)->playlist_Move_deprecated = NULL; \
(p_symbols)->playlist_NodeGroup_deprecated = NULL; \ (p_symbols)->playlist_NodeGroup_deprecated = NULL; \
...@@ -1494,6 +1490,9 @@ struct module_symbols_t ...@@ -1494,6 +1490,9 @@ struct module_symbols_t
(p_symbols)->stats_HandlerDestroy_deprecated = NULL; \ (p_symbols)->stats_HandlerDestroy_deprecated = NULL; \
(p_symbols)->__stats_TimerDumpAll_deprecated = NULL; \ (p_symbols)->__stats_TimerDumpAll_deprecated = NULL; \
(p_symbols)->playlist_ItemNewFromInput_deprecated = NULL; \ (p_symbols)->playlist_ItemNewFromInput_deprecated = NULL; \
(p_symbols)->playlist_PlaylistAdd_deprecated = NULL; \
(p_symbols)->playlist_PlaylistAddExt_deprecated = NULL; \
(p_symbols)->playlist_PlaylistAddInput_deprecated = NULL; \
(p_symbols)->__intf_UserOkayCancel_deprecated = NULL; \ (p_symbols)->__intf_UserOkayCancel_deprecated = NULL; \
(p_symbols)->stats_TimerClean_deprecated = NULL; \ (p_symbols)->stats_TimerClean_deprecated = NULL; \
(p_symbols)->stats_TimersClean_deprecated = NULL; \ (p_symbols)->stats_TimersClean_deprecated = NULL; \
......
...@@ -37,42 +37,23 @@ int DeleteInner( playlist_t * p_playlist, playlist_item_t *p_item, ...@@ -37,42 +37,23 @@ int DeleteInner( playlist_t * p_playlist, playlist_item_t *p_item,
/***************************************************************************** /*****************************************************************************
* Playlist item creation * Playlist item creation
*****************************************************************************/ *****************************************************************************/
/**
* Create a new item, without adding it to the playlist
*
* \param p_obj a vlc object (anyone will do)
* \param psz_uri the mrl of the item
* \param psz_name a text giving a name or description of the item
* \return the new item or NULL on failure
*/
playlist_item_t * __playlist_ItemNew( vlc_object_t *p_obj,
const char *psz_uri,
const char *psz_name )
{
return playlist_ItemNewWithType( p_obj, psz_uri,
psz_name, 0, NULL, -1,
ITEM_TYPE_UNKNOWN );
}
playlist_item_t * playlist_ItemNewWithType( vlc_object_t *p_obj, playlist_item_t * playlist_ItemNewWithType( vlc_object_t *p_obj,
const char *psz_uri, const char *psz_uri,
const char *psz_name, const char *psz_name,
int i_options, int i_options,
const char **ppsz_options, const char **ppsz_options,
int i_duration, int i_duration, int i_type )
int i_type )
{ {
input_item_t *p_input; input_item_t *p_input;
if( psz_uri == NULL ) return NULL; if( psz_uri == NULL ) return NULL;
p_input = input_ItemNewWithType( p_obj, psz_uri, p_input = input_ItemNewWithType( p_obj, psz_uri,
psz_name, i_options, ppsz_options, psz_name, i_options, ppsz_options,
i_duration, i_type ); i_duration, i_type );
return playlist_ItemNewFromInput( p_obj, p_input ); return playlist_ItemNewFromInput( p_obj, p_input );
} }
playlist_item_t *__playlist_ItemNewFromInput( vlc_object_t *p_obj, playlist_item_t *__playlist_ItemNewFromInput( vlc_object_t *p_obj,
input_item_t *p_input ) input_item_t *p_input )
{ {
/** FIXME !!!!! don't find playlist each time */ /** FIXME !!!!! don't find playlist each time */
playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_obj, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_obj, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
...@@ -185,10 +166,7 @@ void playlist_LockClear( playlist_t *p_playlist ) ...@@ -185,10 +166,7 @@ void playlist_LockClear( playlist_t *p_playlist )
/*************************************************************************** /***************************************************************************
* Playlist item addition * Playlist item addition
***************************************************************************/ ***************************************************************************/
/** Add an item to the playlist or the media library
/**
* Add a MRL into the playlist.
*
* \param p_playlist the playlist to add into * \param p_playlist the playlist to add into
* \param psz_uri the mrl to add to the playlist * \param psz_uri the mrl to add to the playlist