libvlc_media_list_player.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * libvlc_media_list_player.h:  libvlc_media_list API
00003  *****************************************************************************
00004  * Copyright (C) 1998-2008 VLC authors and VideoLAN
00005  * $Id: 2a7cacff1c87e7b0edfba86726bcc98af24e46f9 $
00006  *
00007  * Authors: Pierre d'Herbemont
00008  *
00009  * This program is free software; you can redistribute it and/or modify it
00010  * under the terms of the GNU Lesser General Public License as published by
00011  * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU Lesser General Public License
00020  * along with this program; if not, write to the Free Software Foundation,
00021  * 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 LIBVLC_API libvlc_media_list_player_t *
00068     libvlc_media_list_player_new( libvlc_instance_t * p_instance );
00069 
00070 /**
00071  * Release a media_list_player after use
00072  * Decrement the reference count of a media player object. If the
00073  * reference count is 0, then libvlc_media_list_player_release() will
00074  * release the media player object. If the media player object
00075  * has been released, then it should not be used again.
00076  *
00077  * \param p_mlp media list player instance
00078  */
00079 LIBVLC_API void
00080     libvlc_media_list_player_release( libvlc_media_list_player_t * p_mlp );
00081 
00082 /**
00083  * Retain a reference to a media player list object. Use
00084  * libvlc_media_list_player_release() to decrement reference count.
00085  *
00086  * \param p_mlp media player list object
00087  */
00088 LIBVLC_API void
00089     libvlc_media_list_player_retain( libvlc_media_list_player_t *p_mlp );
00090 
00091 /**
00092  * Return the event manager of this media_list_player.
00093  *
00094  * \param p_mlp media list player instance
00095  * \return the event manager
00096  */
00097 LIBVLC_API libvlc_event_manager_t *
00098     libvlc_media_list_player_event_manager(libvlc_media_list_player_t * p_mlp);
00099 
00100 /**
00101  * Replace media player in media_list_player with this instance.
00102  *
00103  * \param p_mlp media list player instance
00104  * \param p_mi media player instance
00105  */
00106 LIBVLC_API void
00107     libvlc_media_list_player_set_media_player(
00108                                      libvlc_media_list_player_t * p_mlp,
00109                                      libvlc_media_player_t * p_mi );
00110 
00111 /**
00112  * Set the media list associated with the player
00113  *
00114  * \param p_mlp media list player instance
00115  * \param p_mlist list of media
00116  */
00117 LIBVLC_API void
00118     libvlc_media_list_player_set_media_list(
00119                                      libvlc_media_list_player_t * p_mlp,
00120                                      libvlc_media_list_t * p_mlist );
00121 
00122 /**
00123  * Play media list
00124  *
00125  * \param p_mlp media list player instance
00126  */
00127 LIBVLC_API
00128 void libvlc_media_list_player_play(libvlc_media_list_player_t * p_mlp);
00129 
00130 /**
00131  * Pause media list
00132  *
00133  * \param p_mlp media list player instance
00134  */
00135 LIBVLC_API
00136 void libvlc_media_list_player_pause(libvlc_media_list_player_t * p_mlp);
00137 
00138 /**
00139  * Is media list playing?
00140  *
00141  * \param p_mlp media list player instance
00142  * \return true for playing and false for not playing
00143  *
00144  * \libvlc_return_bool
00145  */
00146 LIBVLC_API int
00147     libvlc_media_list_player_is_playing( libvlc_media_list_player_t * p_mlp );
00148 
00149 /**
00150  * Get current libvlc_state of media list player
00151  *
00152  * \param p_mlp media list player instance
00153  * \return libvlc_state_t for media list player
00154  */
00155 LIBVLC_API libvlc_state_t
00156     libvlc_media_list_player_get_state( libvlc_media_list_player_t * p_mlp );
00157 
00158 /**
00159  * Play media list item at position index
00160  *
00161  * \param p_mlp media list player instance
00162  * \param i_index index in media list to play
00163  * \return 0 upon success -1 if the item wasn't found
00164  */
00165 LIBVLC_API
00166 int libvlc_media_list_player_play_item_at_index(libvlc_media_list_player_t * p_mlp,
00167                                                 int i_index);
00168 
00169 /**
00170  * Play the given media item
00171  *
00172  * \param p_mlp media list player instance
00173  * \param p_md the media instance
00174  * \return 0 upon success, -1 if the media is not part of the media list
00175  */
00176 LIBVLC_API
00177 int libvlc_media_list_player_play_item(libvlc_media_list_player_t * p_mlp,
00178                                        libvlc_media_t * p_md);
00179 
00180 /**
00181  * Stop playing media list
00182  *
00183  * \param p_mlp media list player instance
00184  */
00185 LIBVLC_API void
00186     libvlc_media_list_player_stop( libvlc_media_list_player_t * p_mlp);
00187 
00188 /**
00189  * Play next item from media list
00190  *
00191  * \param p_mlp media list player instance
00192  * \return 0 upon success -1 if there is no next item
00193  */
00194 LIBVLC_API
00195 int libvlc_media_list_player_next(libvlc_media_list_player_t * p_mlp);
00196 
00197 /**
00198  * Play previous item from media list
00199  *
00200  * \param p_mlp media list player instance
00201  * \return 0 upon success -1 if there is no previous item
00202  */
00203 LIBVLC_API
00204 int libvlc_media_list_player_previous(libvlc_media_list_player_t * p_mlp);
00205 
00206 
00207 
00208 /**
00209  * Sets the playback mode for the playlist
00210  *
00211  * \param p_mlp media list player instance
00212  * \param e_mode playback mode specification
00213  */
00214 LIBVLC_API
00215 void libvlc_media_list_player_set_playback_mode(libvlc_media_list_player_t * p_mlp,
00216                                                 libvlc_playback_mode_t e_mode );
00217 
00218 /** @} media_list_player */
00219 
00220 # ifdef __cplusplus
00221 }
00222 # endif
00223 
00224 #endif /* LIBVLC_MEDIA_LIST_PLAYER_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines