#ifndef _VLC_PLAYLIST_H_
#define _VLC_PLAYLIST_H_
+#include <assert.h>
+
/**
* \file
* This file contain structures and function prototypes related
/**
* \defgroup vlc_playlist Playlist
- * Brief description. Longer description
* @{
*/
#define PLAYLIST_RO_FLAG 0x0008 /**< Write-enabled ? */
#define PLAYLIST_REMOVE_FLAG 0x0010 /**< Remove this item at the end */
#define PLAYLIST_EXPANDED_FLAG 0x0020 /**< Expanded node */
-#define PLAYLIST_PREFCAT_FLAG 0x0040 /**< Prefer category */
/**
* Playlist status
void (*pf_run) ( services_discovery_t *);
};
-struct playlist_preparse_t
-{
- VLC_COMMON_MEMBERS
- vlc_mutex_t lock;
- int i_waiting;
- input_item_t **pp_waiting;
-};
-
-
/** Structure containing information about the playlist */
struct playlist_t
{
int i_input_items;
input_item_t ** pp_input_items;
+ int i_random; /**< Number of candidates for random */
+ playlist_item_t ** pp_random; /**< Random candidate items */
+ int i_random_index; /**< Current random item */
+ vlc_bool_t b_reset_random; /**< Recreate random array ?*/
+
int i_last_playlist_id; /**< Last id to an item */
int i_last_input_id ; /**< Last id on an input */
vlc_bool_t b_always_tree;/**< Always display as tree */
vlc_bool_t b_never_tree;/**< Never display as tree */
+ vlc_bool_t b_doing_ml; /**< Doing media library stuff, */
+ /*get quicker */
+
/* Runtime */
input_thread_t * p_input; /**< the input thread associated
* with the current item */
mtime_t i_vout_destroyed_date;
mtime_t i_sout_destroyed_date;
playlist_preparse_t *p_preparse; /**< Preparser object */
+ playlist_preparse_t *p_secondary_preparse; /**< Preparser object */
vlc_mutex_t gc_lock; /**< Lock to protect the garbage collection */
/* Global thread */
#define playlist_ThreadCreate(a) __playlist_ThreadCreate(VLC_OBJECT(a))
-playlist_t *__playlist_ThreadCreate ( vlc_object_t * );
+void __playlist_ThreadCreate ( vlc_object_t * );
int playlist_ThreadDestroy ( playlist_t * );
/* Helpers */
#define PL_LOCK vlc_mutex_lock( &p_playlist->object_lock );
#define PL_UNLOCK vlc_mutex_unlock( &p_playlist->object_lock );
-/* Creation/Deletion */
-playlist_t *playlist_Create ( vlc_object_t * );
-void playlist_Destroy ( playlist_t * );
-
-/* Engine */
-void playlist_MainLoop( playlist_t * );
-void playlist_LastLoop( playlist_t * );
-void playlist_PreparseLoop( playlist_preparse_t * );
-
-/* Control */
-playlist_item_t * playlist_NextItem ( playlist_t * );
-int playlist_PlayItem ( playlist_t *, playlist_item_t * );
+#define pl_Get( a ) a->p_libvlc->p_playlist
+#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 );
/* Playlist control */
#define playlist_Play(p) playlist_LockControl(p,PLAYLIST_PLAY )
return playlist_AddInput( p_playlist, p_input, i_mode, i_pos, VLC_TRUE );
}
-/** Add an input item to the media library
+/** Add an input item to the media library
* \see playlist_AddInput
*/
static inline int playlist_MLAddInput( playlist_t* p_playlist,
return playlist_AddInput( p_playlist, p_input, i_mode, i_pos, VLC_FALSE );
}
-void playlist_SendAddNotify( playlist_t *p_playlist, int i_item_id, int i_node_id );
-
/********************** 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_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 ** ) );
+VLC_EXPORT( void, playlist_NodesPairCreate, (playlist_t *, 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 ) );
-/* 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
***********************************************************************/
* @}
*/
-#define PLAYLIST_DEBUG 1
-
-#ifdef PLAYLIST_DEBUG
-#define PL_DEBUG( msg, args... ) msg_Dbg( p_playlist, msg, ## args )
-#else
-#define PL_DEBUG( msg, args ... ) {}
-#endif
-
#endif