1 /*****************************************************************************
2 * libvlc_media_list.h: libvlc_media_list API
3 *****************************************************************************
4 * Copyright (C) 1998-2008 the VideoLAN team
7 * Authors: Pierre d'Herbemont
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #ifndef LIBVLC_MEDIA_LIST_PLAYER_H
25 #define LIBVLC_MEDIA_LIST_PLAYER_H 1
29 * This file defines libvlc_media_list_player API
36 /*****************************************************************************
38 *****************************************************************************/
39 /** \defgroup libvlc_media_list_player LibVLC media list player
41 * The LibVLC media list player plays a @ref libvlc_media_list_t list of media,
43 * This is required to especially support playlist files.
44 * The normal @ref libvlc_media_player_t LibVLC media player can only play a
45 * single media, and does not handle playlist files properly.
49 typedef struct libvlc_media_list_player_t libvlc_media_list_player_t;
52 * Defines playback modes for playlist.
54 typedef enum libvlc_playback_mode_t
56 libvlc_playback_mode_default,
57 libvlc_playback_mode_loop,
58 libvlc_playback_mode_repeat
59 } libvlc_playback_mode_t;
62 * Create new media_list_player.
64 * \param p_instance libvlc instance
65 * \return media list player instance or NULL on error
67 VLC_PUBLIC_API libvlc_media_list_player_t *
68 libvlc_media_list_player_new( libvlc_instance_t * p_instance );
71 * Release media_list_player.
73 * \param p_mlp media list player instance
76 libvlc_media_list_player_release( libvlc_media_list_player_t * p_mlp );
79 * Return the event manager of this media_list_player.
81 * \param p_mlp media list player instance
83 VLC_PUBLIC_API libvlc_event_manager_t *
84 libvlc_media_list_player_event_manager(libvlc_media_list_player_t * p_mlp);
87 * Replace media player in media_list_player with this instance.
89 * \param p_mlp media list player instance
90 * \param p_mi media player instance
93 libvlc_media_list_player_set_media_player(
94 libvlc_media_list_player_t * p_mlp,
95 libvlc_media_player_t * p_mi );
98 libvlc_media_list_player_set_media_list(
99 libvlc_media_list_player_t * p_mlp,
100 libvlc_media_list_t * p_mlist );
105 * \param p_mlp media list player instance
108 void libvlc_media_list_player_play(libvlc_media_list_player_t * p_mlp);
113 * \param p_mlp media list player instance
116 void libvlc_media_list_player_pause(libvlc_media_list_player_t * p_mlp);
119 * Is media list playing?
121 * \param p_mlp media list player instance
122 * \return true for playing and false for not playing
125 libvlc_media_list_player_is_playing( libvlc_media_list_player_t * p_mlp );
128 * Get current libvlc_state of media list player
130 * \param p_mlp media list player instance
131 * \return libvlc_state_t for media list player
133 VLC_PUBLIC_API libvlc_state_t
134 libvlc_media_list_player_get_state( libvlc_media_list_player_t * p_mlp );
137 * Play media list item at position index
139 * \param p_mlp media list player instance
140 * \param i_index index in media list to play
141 * \return 0 upon success -1 if the item wasn't found
144 int libvlc_media_list_player_play_item_at_index(libvlc_media_list_player_t * p_mlp,
148 int libvlc_media_list_player_play_item(libvlc_media_list_player_t * p_mlp,
149 libvlc_media_t * p_md);
152 * Stop playing media list
154 * \param p_mlp media list player instance
157 libvlc_media_list_player_stop( libvlc_media_list_player_t * p_mlp);
160 * Play next item from media list
162 * \param p_mlp media list player instance
163 * \return 0 upon success -1 if there is no next item
166 int libvlc_media_list_player_next(libvlc_media_list_player_t * p_mlp);
169 * Play previous item from media list
171 * \param p_mlp media list player instance
172 * \return 0 upon success -1 if there is no previous item
175 int libvlc_media_list_player_previous(libvlc_media_list_player_t * p_mlp);
180 * Sets the playback mode for the playlist
182 * \param p_mlp media list player instance
183 * \param e_mode playback mode specification
186 void libvlc_media_list_player_set_playback_mode(libvlc_media_list_player_t * p_mlp,
187 libvlc_playback_mode_t e_mode );
189 /** @} media_list_player */
195 #endif /* LIBVLC_MEDIA_LIST_PLAYER_H */