]> git.sesse.net Git - vlc/blobdiff - include/vlc_playlist.h
Fix a little bug with the playlist interface (items swaped)
[vlc] / include / vlc_playlist.h
index 869c1007cb6cb335987ace4362e5ec68ebd7e742..e9033674d772e8729f1206e611ccf947c0d0b4ac 100644 (file)
@@ -32,9 +32,9 @@
 extern "C" {
 # endif
 
-#include <assert.h>
 #include <vlc_input.h>
 #include <vlc_events.h>
+#include <vlc_services_discovery.h>
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -158,32 +158,18 @@ 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 */
-
-    /* the playlist items for category and onelevel */
-    playlist_item_t*    p_cat;
-    playlist_item_t*    p_one;
-
-    services_discovery_sys_t *p_sys;
-    void (*pf_run) ( services_discovery_t *);
-};
-
 /** Structure containing information about the playlist */
 struct playlist_t
 {
     VLC_COMMON_MEMBERS
 
-    /* pp_sd & i_sd are for internal use ONLY. Understood ? it's PRIVATE ! */
-    services_discovery_t **pp_sd; /**< Loaded service discovery modules */
-    int                   i_sd;   /**< Number of service discovery modules */
+    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 ? */
 
@@ -282,8 +268,8 @@ struct playlist_add_t
  *****************************************************************************/
 
 /* Helpers */
-#define PL_LOCK vlc_object_lock( p_playlist );
-#define PL_UNLOCK vlc_object_unlock( p_playlist );
+#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
 
@@ -291,7 +277,7 @@ VLC_EXPORT( playlist_t *, __pl_Yield, ( vlc_object_t * ) );
 #define pl_Yield( a ) __pl_Yield( VLC_OBJECT(a) )
 
 VLC_EXPORT( void, __pl_Release, ( vlc_object_t * ) );
-#define pl_Release(a) __pl_Release( VLC_OBJECT(a) );
+#define pl_Release(a) __pl_Release( VLC_OBJECT(a) )
 
 /* Playlist control */
 #define playlist_Play(p) playlist_Control(p,PLAYLIST_PLAY, VLC_FALSE )
@@ -404,7 +390,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 *) );
@@ -417,33 +403,6 @@ VLC_EXPORT( playlist_item_t *, playlist_GetNextLeaf, ( playlist_t *p_playlist, p
 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
- ***********************************************************************/
-
-/* Get the services discovery modules names to use in Create(), in a null
- * terminated string array. Array and string must be freed after use. */
-VLC_EXPORT( char **, services_discovery_GetServicesNames, ( vlc_object_t * p_super ) );
-
-/* 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 ) );
-VLC_EXPORT( void,                   services_discovery_Stop, ( 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
  ***********************************************************************/