/*****************************************************************************
* Media List Player
*****************************************************************************/
-/** \defgroup libvlc_media_list_player libvlc_media_list_player
+/** \defgroup libvlc_media_list_player LibVLC media list player
* \ingroup libvlc
- * LibVLC Media List Player, play a media_list. You can see that as a media
- * instance subclass
+ * The LibVLC media list player plays a @ref libvlc_media_list_t list of media,
+ * in a certain order.
+ * This is required to especially support playlist files.
+ * The normal @ref libvlc_media_player_t LibVLC media player can only play a
+ * single media, and does not handle playlist files properly.
* @{
*/
typedef struct libvlc_media_list_player_t libvlc_media_list_player_t;
+/**
+ * Defines playback modes for playlist.
+ */
+typedef enum libvlc_playback_mode_t
+{
+ libvlc_playback_mode_default,
+ libvlc_playback_mode_loop,
+ libvlc_playback_mode_repeat
+} libvlc_playback_mode_t;
+
/**
* Create new media_list_player.
*
* \param p_instance libvlc instance
- * \param p_e initialized exception instance
- * \return media list player instance
+ * \return media list player instance or NULL on error
*/
VLC_PUBLIC_API libvlc_media_list_player_t *
- libvlc_media_list_player_new( libvlc_instance_t * p_instance,
- libvlc_exception_t * p_e );
+ libvlc_media_list_player_new( libvlc_instance_t * p_instance );
/**
* Release media_list_player.
VLC_PUBLIC_API void
libvlc_media_list_player_release( libvlc_media_list_player_t * p_mlp );
+/**
+ * Return the event manager of this media_list_player.
+ *
+ * \param p_mlp media list player instance
+ * \return the event manager
+ */
+VLC_PUBLIC_API libvlc_event_manager_t *
+ libvlc_media_list_player_event_manager(libvlc_media_list_player_t * p_mlp);
+
/**
* Replace media player in media_list_player with this instance.
*
* \param p_mlp media list player instance
* \param p_mi media player instance
- * \param p_e initialized exception instance
*/
VLC_PUBLIC_API void
libvlc_media_list_player_set_media_player(
libvlc_media_list_player_t * p_mlp,
- libvlc_media_player_t * p_mi,
- libvlc_exception_t * p_e );
+ libvlc_media_player_t * p_mi );
+/**
+ * Set the media list associated with the player
+ *
+ * \param p_mlp media list player instance
+ * \param p_mlist list of media
+ */
VLC_PUBLIC_API void
libvlc_media_list_player_set_media_list(
libvlc_media_list_player_t * p_mlp,
- libvlc_media_list_t * p_mlist,
- libvlc_exception_t * p_e );
+ libvlc_media_list_t * p_mlist );
/**
* Play media list
*
* \param p_mlp media list player instance
- * \param p_e initialized exception instance
*/
-VLC_PUBLIC_API void
- libvlc_media_list_player_play( libvlc_media_list_player_t * p_mlp,
- libvlc_exception_t * p_e );
+VLC_PUBLIC_API
+void libvlc_media_list_player_play(libvlc_media_list_player_t * p_mlp);
/**
* Pause media list
*
* \param p_mlp media list player instance
- * \param p_e initialized exception instance
*/
-VLC_PUBLIC_API void
- libvlc_media_list_player_pause( libvlc_media_list_player_t * p_mlp,
- libvlc_exception_t * p_e );
+VLC_PUBLIC_API
+void libvlc_media_list_player_pause(libvlc_media_list_player_t * p_mlp);
/**
* Is media list playing?
*
* \param p_mlp media list player instance
- * \param p_e initialized exception instance
* \return true for playing and false for not playing
*/
VLC_PUBLIC_API int
- libvlc_media_list_player_is_playing( libvlc_media_list_player_t * p_mlp,
- libvlc_exception_t * p_e );
+ libvlc_media_list_player_is_playing( libvlc_media_list_player_t * p_mlp );
/**
* Get current libvlc_state of media list player
*
* \param p_mlp media list player instance
- * \param p_e initialized exception instance
* \return libvlc_state_t for media list player
*/
VLC_PUBLIC_API libvlc_state_t
- libvlc_media_list_player_get_state( libvlc_media_list_player_t * p_mlp,
- libvlc_exception_t * p_e );
+ libvlc_media_list_player_get_state( libvlc_media_list_player_t * p_mlp );
/**
* Play media list item at position index
*
* \param p_mlp media list player instance
* \param i_index index in media list to play
- * \param p_e initialized exception instance
+ * \return 0 upon success -1 if the item wasn't found
*/
-VLC_PUBLIC_API void
- libvlc_media_list_player_play_item_at_index(
- libvlc_media_list_player_t * p_mlp,
- int i_index,
- libvlc_exception_t * p_e );
+VLC_PUBLIC_API
+int libvlc_media_list_player_play_item_at_index(libvlc_media_list_player_t * p_mlp,
+ int i_index);
-VLC_PUBLIC_API void
- libvlc_media_list_player_play_item(
- libvlc_media_list_player_t * p_mlp,
- libvlc_media_t * p_md,
- libvlc_exception_t * p_e );
+/**
+ * Play the given media item
+ *
+ * \param p_mlp media list player instance
+ * \param p_md the media instance
+ * \return 0 upon success, -1 if the media is not part of the media list
+ */
+VLC_PUBLIC_API
+int libvlc_media_list_player_play_item(libvlc_media_list_player_t * p_mlp,
+ libvlc_media_t * p_md);
/**
* Stop playing media list
*
* \param p_mlp media list player instance
- * \param p_e initialized exception instance
*/
VLC_PUBLIC_API void
- libvlc_media_list_player_stop( libvlc_media_list_player_t * p_mlp,
- libvlc_exception_t * p_e );
+ libvlc_media_list_player_stop( libvlc_media_list_player_t * p_mlp);
/**
* Play next item from media list
*
* \param p_mlp media list player instance
- * \param p_e initialized exception instance
+ * \return 0 upon success -1 if there is no next item
*/
-VLC_PUBLIC_API void
- libvlc_media_list_player_next( libvlc_media_list_player_t * p_mlp,
- libvlc_exception_t * p_e );
+VLC_PUBLIC_API
+int libvlc_media_list_player_next(libvlc_media_list_player_t * p_mlp);
+
+/**
+ * Play previous item from media list
+ *
+ * \param p_mlp media list player instance
+ * \return 0 upon success -1 if there is no previous item
+ */
+VLC_PUBLIC_API
+int libvlc_media_list_player_previous(libvlc_media_list_player_t * p_mlp);
+
+
-/* NOTE: shouldn't there also be a libvlc_media_list_player_prev() */
+/**
+ * Sets the playback mode for the playlist
+ *
+ * \param p_mlp media list player instance
+ * \param e_mode playback mode specification
+ */
+VLC_PUBLIC_API
+void libvlc_media_list_player_set_playback_mode(libvlc_media_list_player_t * p_mlp,
+ libvlc_playback_mode_t e_mode );
/** @} media_list_player */