X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Fvlc_playlist.h;h=68e7786b04d7faaf0ca8d9a09b3d8fe359e0bb87;hb=25aa7cd697491ba163a49637abccc25c700b8ca3;hp=3a7f95d56578c2d9e74506159a583728b1901d28;hpb=716d5bf2f23ca759a3558558cb900e7039ba5e5c;p=vlc diff --git a/include/vlc_playlist.h b/include/vlc_playlist.h index 3a7f95d565..68e7786b04 100644 --- a/include/vlc_playlist.h +++ b/include/vlc_playlist.h @@ -35,6 +35,7 @@ extern "C" { #include #include #include +#include #include #include @@ -158,24 +159,19 @@ struct playlist_item_t typedef enum { PLAYLIST_STOPPED,PLAYLIST_RUNNING,PLAYLIST_PAUSED } playlist_status_t; - -struct services_discovery_t -{ - VLC_COMMON_MEMBERS - char * psz_module; - module_t * p_module; - - char * psz_localized_name; /* Accessed through Setters for non class function */ - vlc_event_manager_t event_manager; /* Accessed through Setters for non class function */ - - services_discovery_sys_t *p_sys; - void (*pf_run) ( services_discovery_t *); -}; - /** Structure containing information about the playlist */ struct playlist_t { VLC_COMMON_MEMBERS + + struct playlist_services_discovery_support_t { + /* the playlist items for category and onelevel */ + playlist_item_t* p_cat; + playlist_item_t* p_one; + services_discovery_t * p_sd; /**< Loaded service discovery modules */ + } ** pp_sds; + int i_sds; /**< Number of service discovery modules */ + int i_enabled; /**< How many items are enabled ? */ playlist_item_array_t items; /**< Arrays of items */ @@ -192,13 +188,6 @@ struct playlist_t int i_last_playlist_id; /**< Last id to an item */ int i_last_input_id ; /**< Last id on an input */ - struct playlist_archived_services_discovery_t { - services_discovery_t * p_sd; /* The service discovery module */ - playlist_item_t * p_cat;/* Corresponding item in the category view */ - playlist_item_t * p_one;/* Corresponding item in the one level view */ - } **pp_asds; /**< Loaded service discovery modules */ - int i_asds; /**< Number of service discovery modules */ - /* Predefined items */ playlist_item_t * p_root_category; /**< Root of category tree */ playlist_item_t * p_root_onelevel; /**< Root of onelevel tree */ @@ -280,18 +269,16 @@ struct playlist_add_t *****************************************************************************/ /* Helpers */ -#define PL_LOCK vlc_mutex_lock( &p_playlist->object_lock ); -#define PL_UNLOCK vlc_mutex_unlock( &p_playlist->object_lock ); +#define PL_LOCK vlc_object_lock( p_playlist ) +#define PL_UNLOCK vlc_object_unlock( p_playlist ) #define pl_Get( a ) a->p_libvlc->p_playlist + +VLC_EXPORT( playlist_t *, __pl_Yield, ( vlc_object_t * ) ); #define pl_Yield( a ) __pl_Yield( VLC_OBJECT(a) ) -static inline playlist_t *__pl_Yield( vlc_object_t *p_this ) -{ - assert( p_this->p_libvlc->p_playlist ); - vlc_object_yield( p_this->p_libvlc->p_playlist ); - return p_this->p_libvlc->p_playlist; -} -#define pl_Release(a) vlc_object_release( a->p_libvlc->p_playlist ); + +VLC_EXPORT( void, __pl_Release, ( vlc_object_t * ) ); +#define pl_Release(a) __pl_Release( VLC_OBJECT(a) ) /* Playlist control */ #define playlist_Play(p) playlist_Control(p,PLAYLIST_PLAY, VLC_FALSE ) @@ -404,7 +391,7 @@ VLC_EXPORT(void, playlist_NodeDump, ( playlist_t *p_playlist, playlist_item_t *p VLC_EXPORT( int, playlist_NodeChildrenCount, (playlist_t *,playlist_item_t* ) ); /* Node management */ -VLC_EXPORT( playlist_item_t *, playlist_NodeCreate, ( playlist_t *, const char *, playlist_item_t * p_parent, int i_flags ) ); +VLC_EXPORT( playlist_item_t *, playlist_NodeCreate, ( playlist_t *, const char *, playlist_item_t * p_parent, int i_flags, input_item_t * ) ); 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 *) ); @@ -413,35 +400,10 @@ VLC_EXPORT( int, playlist_NodeDelete, ( playlist_t *, playlist_item_t *, vlc_boo VLC_EXPORT( int, playlist_NodeEmpty, ( playlist_t *, playlist_item_t *, vlc_bool_t ) ); VLC_EXPORT( void, playlist_NodesPairCreate, (playlist_t *, const char *, playlist_item_t **, playlist_item_t **, vlc_bool_t ) ); VLC_EXPORT( playlist_item_t *, playlist_GetPreferredNode, ( playlist_t *p_playlist, playlist_item_t *p_node ) ); -VLC_EXPORT( playlist_item_t *, playlist_GetNextLeaf, ( playlist_t *p_playlist, playlist_item_t *p_root, playlist_item_t *p_item, vlc_bool_t b_ena, vlc_bool_t b_unplayed ) ); -VLC_EXPORT( playlist_item_t *, playlist_GetPrevLeaf, ( playlist_t *p_playlist, playlist_item_t *p_root, playlist_item_t *p_item, vlc_bool_t b_ena, vlc_bool_t b_unplayed ) ); +VLC_EXPORT( playlist_item_t *, playlist_GetNextLeaf, ( playlist_t *p_playlist, playlist_item_t *p_root, playlist_item_t *p_item, vlc_bool_t b_ena, vlc_bool_t b_unplayed ) ); +VLC_EXPORT( playlist_item_t *, playlist_GetPrevLeaf, ( playlist_t *p_playlist, playlist_item_t *p_root, playlist_item_t *p_item, vlc_bool_t b_ena, vlc_bool_t b_unplayed ) ); VLC_EXPORT( playlist_item_t *, playlist_GetLastLeaf, ( playlist_t *p_playlist, playlist_item_t *p_root ) ); -/*********************************************************************** - * Service Discovery - ***********************************************************************/ -/* XXX: no need to inline */ -/* XXX: no need to inline */ -/* Return the number of services_discovery available */ - -/* Creation of a service_discovery object */ -VLC_EXPORT( services_discovery_t *, services_discovery_Create, ( vlc_object_t * p_super, const char * psz_service_name ) ); -VLC_EXPORT( void, services_discovery_Destroy, ( services_discovery_t * p_this ) ); -VLC_EXPORT( int, services_discovery_Start, ( services_discovery_t * p_this ) ); - -/* Read info from discovery object */ -VLC_EXPORT( char *, services_discovery_GetLocalizedName, ( services_discovery_t * p_this ) ); - -/* Receive event notification (prefered way to get new items) */ -VLC_EXPORT( vlc_event_manager_t *, services_discovery_EventManager, ( services_discovery_t * p_this ) ); - -/* Used by services_discovery to post update about their items */ -VLC_EXPORT( void, services_discovery_SetLocalizedName, ( services_discovery_t * p_this, const char * ) ); - /* About the psz_category, it is a legacy way to add info to the item, - * for more options, directly set the (meta) data on the input item */ -VLC_EXPORT( void, services_discovery_AddItem, ( services_discovery_t * p_this, input_item_t * p_item, const char * psz_category ) ); -VLC_EXPORT( void, services_discovery_RemoveItem, ( services_discovery_t * p_this, input_item_t * p_item ) ); - /*********************************************************************** * Inline functions ***********************************************************************/ @@ -451,7 +413,9 @@ static inline int playlist_Import( playlist_t *p_playlist, const char *psz_file) char psz_uri[256+10]; input_item_t *p_input; snprintf( psz_uri, 256+9, "file/://%s", psz_file ); - p_input = input_ItemNewExt( p_playlist, psz_uri, psz_file, 0, NULL, -1 ); + const char *const psz_option = "meta-file"; + p_input = input_ItemNewExt( p_playlist, psz_uri, psz_file, + 1, &psz_option, -1 ); playlist_AddInput( p_playlist, p_input, PLAYLIST_APPEND, PLAYLIST_END, VLC_TRUE, VLC_FALSE ); input_Read( p_playlist, p_input, VLC_TRUE ); @@ -468,12 +432,7 @@ static inline int playlist_Import( playlist_t *p_playlist, const char *psz_file) #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 ) -{ - PL_LOCK; - vlc_cond_signal( &p_playlist->object_wait ); - PL_UNLOCK; -} +#define playlist_Signal( p_playlist ) vlc_object_signal( p_playlist ) /** @} */ # ifdef __cplusplus