libvlc_media_list_player.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * libvlc_media_list.h:  libvlc_media_list API
00003  *****************************************************************************
00004  * Copyright (C) 1998-2008 the VideoLAN team
00005  * $Id: bd7563585547ddd87484dc96516f7c3a7f904578 $
00006  *
00007  * Authors: Pierre d'Herbemont
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00022  *****************************************************************************/
00023 
00024 #ifndef LIBVLC_MEDIA_LIST_PLAYER_H
00025 #define LIBVLC_MEDIA_LIST_PLAYER_H 1
00026 
00027 /**
00028  * \file
00029  * This file defines libvlc_media_list_player API
00030  */
00031 
00032 # ifdef __cplusplus
00033 extern "C" {
00034 # endif
00035 
00036 /*****************************************************************************
00037  * Media List Player
00038  *****************************************************************************/
00039 /** \defgroup libvlc_media_list_player LibVLC media list player
00040  * \ingroup libvlc
00041  * The LibVLC media list player plays a @ref libvlc_media_list_t list of media,
00042  * in a certain order.
00043  * This is required to especially support playlist files.
00044  * The normal @ref libvlc_media_player_t LibVLC media player can only play a
00045  * single media, and does not handle playlist files properly.
00046  * @{
00047  */
00048 
00049 typedef struct libvlc_media_list_player_t libvlc_media_list_player_t;
00050 
00051 /**
00052  *  Defines playback modes for playlist.
00053  */
00054 typedef enum libvlc_playback_mode_t
00055 {
00056     libvlc_playback_mode_default,
00057     libvlc_playback_mode_loop,
00058     libvlc_playback_mode_repeat
00059 } libvlc_playback_mode_t;
00060 
00061 /**
00062  * Create new media_list_player.
00063  *
00064  * \param p_instance libvlc instance
00065  * \return media list player instance or NULL on error
00066  */
00067 VLC_PUBLIC_API libvlc_media_list_player_t *
00068     libvlc_media_list_player_new( libvlc_instance_t * p_instance );
00069 
00070 /**
00071  * Release media_list_player.
00072  *
00073  * \param p_mlp media list player instance
00074  */
00075 VLC_PUBLIC_API void
00076     libvlc_media_list_player_release( libvlc_media_list_player_t * p_mlp );
00077 
00078 /**
00079  * Return the event manager of this media_list_player.
00080  *
00081  * \param p_mlp media list player instance
00082  * \return the event manager
00083  */
00084 VLC_PUBLIC_API libvlc_event_manager_t *
00085     libvlc_media_list_player_event_manager(libvlc_media_list_player_t * p_mlp);
00086 
00087 /**
00088  * Replace media player in media_list_player with this instance.
00089  *
00090  * \param p_mlp media list player instance
00091  * \param p_mi media player instance
00092  */
00093 VLC_PUBLIC_API void
00094     libvlc_media_list_player_set_media_player(
00095                                      libvlc_media_list_player_t * p_mlp,
00096                                      libvlc_media_player_t * p_mi );
00097 
00098 /**
00099  * Set the media list associated with the player
00100  *
00101  * \param p_mlp media list player instance
00102  * \param p_mlist list of media
00103  */
00104 VLC_PUBLIC_API void
00105     libvlc_media_list_player_set_media_list(
00106                                      libvlc_media_list_player_t * p_mlp,
00107                                      libvlc_media_list_t * p_mlist );
00108 
00109 /**
00110  * Play media list
00111  *
00112  * \param p_mlp media list player instance
00113  */
00114 VLC_PUBLIC_API
00115 void libvlc_media_list_player_play(libvlc_media_list_player_t * p_mlp);
00116 
00117 /**
00118  * Pause media list
00119  *
00120  * \param p_mlp media list player instance
00121  */
00122 VLC_PUBLIC_API
00123 void libvlc_media_list_player_pause(libvlc_media_list_player_t * p_mlp);
00124 
00125 /**
00126  * Is media list playing?
00127  *
00128  * \param p_mlp media list player instance
00129  * \return true for playing and false for not playing
00130  */
00131 VLC_PUBLIC_API int
00132     libvlc_media_list_player_is_playing( libvlc_media_list_player_t * p_mlp );
00133 
00134 /**
00135  * Get current libvlc_state of media list player
00136  *
00137  * \param p_mlp media list player instance
00138  * \return libvlc_state_t for media list player
00139  */
00140 VLC_PUBLIC_API libvlc_state_t
00141     libvlc_media_list_player_get_state( libvlc_media_list_player_t * p_mlp );
00142 
00143 /**
00144  * Play media list item at position index
00145  *
00146  * \param p_mlp media list player instance
00147  * \param i_index index in media list to play
00148  * \return 0 upon success -1 if the item wasn't found
00149  */
00150 VLC_PUBLIC_API
00151 int libvlc_media_list_player_play_item_at_index(libvlc_media_list_player_t * p_mlp,
00152                                                 int i_index);
00153 
00154 /**
00155  * Play the given media item
00156  *
00157  * \param p_mlp media list player instance
00158  * \param p_md the media instance
00159  * \return 0 upon success, -1 if the media is not part of the media list
00160  */
00161 VLC_PUBLIC_API
00162 int libvlc_media_list_player_play_item(libvlc_media_list_player_t * p_mlp,
00163                                        libvlc_media_t * p_md);
00164 
00165 /**
00166  * Stop playing media list
00167  *
00168  * \param p_mlp media list player instance
00169  */
00170 VLC_PUBLIC_API void
00171     libvlc_media_list_player_stop( libvlc_media_list_player_t * p_mlp);
00172 
00173 /**
00174  * Play next item from media list
00175  *
00176  * \param p_mlp media list player instance
00177  * \return 0 upon success -1 if there is no next item
00178  */
00179 VLC_PUBLIC_API
00180 int libvlc_media_list_player_next(libvlc_media_list_player_t * p_mlp);
00181 
00182 /**
00183  * Play previous item from media list
00184  *
00185  * \param p_mlp media list player instance
00186  * \return 0 upon success -1 if there is no previous item
00187  */
00188 VLC_PUBLIC_API
00189 int libvlc_media_list_player_previous(libvlc_media_list_player_t * p_mlp);
00190 
00191 
00192 
00193 /**
00194  * Sets the playback mode for the playlist
00195  *
00196  * \param p_mlp media list player instance
00197  * \param e_mode playback mode specification
00198  */
00199 VLC_PUBLIC_API
00200 void libvlc_media_list_player_set_playback_mode(libvlc_media_list_player_t * p_mlp,
00201                                                 libvlc_playback_mode_t e_mode );
00202 
00203 /** @} media_list_player */
00204 
00205 # ifdef __cplusplus
00206 }
00207 # endif
00208 
00209 #endif /* LIBVLC_MEDIA_LIST_PLAYER_H */

Generated on Mon Nov 22 07:55:19 2010 for VLC by  doxygen 1.5.6