]> git.sesse.net Git - vlc/blobdiff - include/vlc_playlist.h
configure: simplify maintainer mode and rectify default in help
[vlc] / include / vlc_playlist.h
index 09f416237267a661bc37bf6497a737b4b1050658..947b2c613bd2bb15d5283e6d5cb416d6f47ada49 100644 (file)
 extern "C" {
 # endif
 
-#include <vlc_input.h>
 #include <vlc_events.h>
 
 TYPEDEF_ARRAY(playlist_item_t*, playlist_item_array_t)
 
+struct intf_thread_t;
+
 /**
  * \file
  * This file contain structures and function prototypes related
@@ -102,7 +103,6 @@ TYPEDEF_ARRAY(playlist_item_t*, playlist_item_array_t)
  *
  * - "item-change": It will contain the input_item_t->i_id of a changed input
  * item monitored by the playlist.
- * - "item-current": It will contain a input_item_t->i_id of the current
  * item being played.
  *
  * - "playlist-item-append": It will contain a pointer to a playlist_add_t.
@@ -138,6 +138,7 @@ struct playlist_item_t
     playlist_item_t      **pp_children; /**< Children nodes/items */
     playlist_item_t       *p_parent;    /**< Item parent */
     int                    i_children;  /**< Number of children, -1 if not a node */
+    unsigned               i_nb_played; /**< Times played */
 
     int                    i_id;        /**< Playlist item specific id */
     uint8_t                i_flags;     /**< Flags \see playlist_item_flags_e */
@@ -252,20 +253,34 @@ enum pl_locked_state
 #define PL_UNLOCK playlist_Unlock( p_playlist )
 #define PL_ASSERT_LOCKED playlist_AssertLocked( p_playlist )
 
-VLC_API playlist_t * pl_Get( vlc_object_t * ) VLC_USED;
-#define pl_Get( a ) pl_Get( VLC_OBJECT(a) )
+/** Playlist commands */
+enum {
+    PLAYLIST_PLAY,      /**< No arg.                            res=can fail*/
+    PLAYLIST_VIEWPLAY,  /**< arg1= playlist_item_t*,*/
+                        /**  arg2 = playlist_item_t*          , res=can fail */
+    PLAYLIST_TOGGLE_PAUSE, /**< No arg                          res=can fail */
+    PLAYLIST_STOP,      /**< No arg                             res=can fail*/
+    PLAYLIST_SKIP,      /**< arg1=int,                          res=can fail*/
+    PLAYLIST_PAUSE,     /**< No arg */
+    PLAYLIST_RESUME,    /**< No arg */
+};
 
-/* Playlist control */
 #define playlist_Play(p) playlist_Control(p,PLAYLIST_PLAY, pl_Unlocked )
-#define playlist_Pause(p) playlist_Control(p,PLAYLIST_PAUSE, pl_Unlocked )
+#define playlist_TogglePause(p) \
+        playlist_Control(p, PLAYLIST_TOGGLE_PAUSE, pl_Unlocked)
 #define playlist_Stop(p) playlist_Control(p,PLAYLIST_STOP, pl_Unlocked )
 #define playlist_Next(p) playlist_Control(p,PLAYLIST_SKIP, pl_Unlocked, 1)
 #define playlist_Prev(p) playlist_Control(p,PLAYLIST_SKIP, pl_Unlocked, -1)
 #define playlist_Skip(p,i) playlist_Control(p,PLAYLIST_SKIP, pl_Unlocked,  (i) )
+#define playlist_Pause(p) \
+        playlist_Control(p, PLAYLIST_PAUSE, pl_Unlocked)
+#define playlist_Resume(p) \
+        playlist_Control(p, PLAYLIST_RESUME, pl_Unlocked)
 
 VLC_API void playlist_Lock( playlist_t * );
 VLC_API void playlist_Unlock( playlist_t * );
 VLC_API void playlist_AssertLocked( playlist_t * );
+VLC_API void playlist_Deactivate( playlist_t * );
 
 /**
  * Do a playlist action.
@@ -275,25 +290,22 @@ VLC_API void playlist_AssertLocked( playlist_t * );
  * \param i_query the command to do
  * \param b_locked TRUE if playlist is locked when entering this function
  * \param variable number of arguments
- * \return VLC_SUCCESS or an error
  */
-VLC_API int playlist_Control( playlist_t *p_playlist, int i_query, bool b_locked, ...  );
+VLC_API void playlist_Control( playlist_t *p_playlist, int i_query, bool b_locked, ...  );
 
 /** Get current playing input. The object is retained.
  */
 VLC_API input_thread_t * playlist_CurrentInput( playlist_t *p_playlist ) VLC_USED;
 
+/** Get the duration of all items in a node.
+ */
+VLC_API mtime_t playlist_GetNodeDuration( playlist_item_t * );
+
 /** Clear the playlist
  * \param b_locked TRUE if playlist is locked when entering this function
  */
 VLC_API void playlist_Clear( playlist_t *, bool );
 
-/** Enqueue an input item for preparsing */
-VLC_API int playlist_PreparseEnqueue(playlist_t *, input_item_t * );
-
-/** Request the art for an input item to be fetched */
-VLC_API int playlist_AskForArtEnqueue(playlist_t *, input_item_t * );
-
 /* Playlist sorting */
 VLC_API int playlist_TreeMove( playlist_t *, playlist_item_t *, playlist_item_t *, int );
 VLC_API int playlist_TreeMoveMany( playlist_t *, int, playlist_item_t **, playlist_item_t *, int );
@@ -368,6 +380,8 @@ VLC_API playlist_item_t * playlist_GetPrevLeaf( playlist_t *p_playlist, playlist
  * Audio output management
  **************************/
 
+VLC_API audio_output_t *playlist_GetAout( playlist_t * );
+
 #define AOUT_VOLUME_DEFAULT             256
 #define AOUT_VOLUME_MAX                 512
 
@@ -391,13 +405,6 @@ VLC_API void playlist_EnableAudioFilter( playlist_t *, const char *, bool );
 /***********************************************************************
  * Inline functions
  ***********************************************************************/
-/** Small helper tp get current playing input or NULL. Release the input after use. */
-#define pl_CurrentInput(a) __pl_CurrentInput( VLC_OBJECT(a) )
-static  inline input_thread_t * __pl_CurrentInput( vlc_object_t * p_this )
-{
-    return playlist_CurrentInput( pl_Get( p_this ) );
-}
-
 /** Tell if the playlist is empty */
 static inline bool playlist_IsEmpty( playlist_t *p_playlist )
 {