libvlc_media_list_player.h 5.63 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
/*****************************************************************************
 * libvlc_media_list.h:  libvlc_media_list API
 *****************************************************************************
 * Copyright (C) 1998-2008 the VideoLAN team
 * $Id$
 *
 * Authors: Pierre d'Herbemont
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/

#ifndef LIBVLC_MEDIA_LIST_PLAYER_H
#define LIBVLC_MEDIA_LIST_PLAYER_H 1

/**
 * \file
 * This file defines libvlc_media_list_player API
 */

# ifdef __cplusplus
extern "C" {
# endif

/*****************************************************************************
 * Media List Player
 *****************************************************************************/
39
/** \defgroup libvlc_media_list_player LibVLC media list player
40
 * \ingroup libvlc
41 42 43 44 45
 * 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.
46 47 48 49 50
 * @{
 */

typedef struct libvlc_media_list_player_t libvlc_media_list_player_t;

Olivier Aubert's avatar
Olivier Aubert committed
51
/**
52 53 54 55 56 57 58 59 60
 *  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;

61 62 63 64
/**
 * Create new media_list_player.
 *
 * \param p_instance libvlc instance
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
65
 * \return media list player instance or NULL on error
66 67
 */
VLC_PUBLIC_API libvlc_media_list_player_t *
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
68
    libvlc_media_list_player_new( libvlc_instance_t * p_instance );
69 70 71 72 73 74 75 76 77

/**
 * Release media_list_player.
 *
 * \param p_mlp media list player instance
 */
VLC_PUBLIC_API void
    libvlc_media_list_player_release( libvlc_media_list_player_t * p_mlp );

78 79 80 81 82 83 84 85
/**
 * Return the event manager of this media_list_player.
 *
 * \param p_mlp media list player instance
 */
VLC_PUBLIC_API libvlc_event_manager_t *
    libvlc_media_list_player_event_manager(libvlc_media_list_player_t * p_mlp);

86 87 88 89 90 91 92 93 94
/**
 * Replace media player in media_list_player with this instance.
 *
 * \param p_mlp media list player instance
 * \param p_mi media player instance
 */
VLC_PUBLIC_API void
    libvlc_media_list_player_set_media_player(
                                     libvlc_media_list_player_t * p_mlp,
95
                                     libvlc_media_player_t * p_mi );
96 97 98 99

VLC_PUBLIC_API void
    libvlc_media_list_player_set_media_list(
                                     libvlc_media_list_player_t * p_mlp,
100
                                     libvlc_media_list_t * p_mlist );
101 102 103 104 105 106

/**
 * Play media list
 *
 * \param p_mlp media list player instance
 */
107 108
VLC_PUBLIC_API
void libvlc_media_list_player_play(libvlc_media_list_player_t * p_mlp);
109 110 111 112 113 114

/**
 * Pause media list
 *
 * \param p_mlp media list player instance
 */
115 116
VLC_PUBLIC_API
void libvlc_media_list_player_pause(libvlc_media_list_player_t * p_mlp);
117 118 119 120 121 122 123 124

/**
 * Is media list playing?
 *
 * \param p_mlp media list player instance
 * \return true for playing and false for not playing
 */
VLC_PUBLIC_API int
125
    libvlc_media_list_player_is_playing( libvlc_media_list_player_t * p_mlp );
126 127 128 129 130 131 132

/**
 * Get current libvlc_state of media list player
 *
 * \param p_mlp media list player instance
 * \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 );
135 136 137 138 139 140

/**
 * Play media list item at position index
 *
 * \param p_mlp media list player instance
 * \param i_index index in media list to play
141
 * \return 0 upon success -1 if the item wasn't found
142
 */
143 144 145
VLC_PUBLIC_API
int libvlc_media_list_player_play_item_at_index(libvlc_media_list_player_t * p_mlp,
                                                int i_index);
146

147 148 149
VLC_PUBLIC_API
int libvlc_media_list_player_play_item(libvlc_media_list_player_t * p_mlp,
                                       libvlc_media_t * p_md);
150 151 152 153 154 155 156

/**
 * Stop playing media list
 *
 * \param p_mlp media list player instance
 */
VLC_PUBLIC_API void
157
    libvlc_media_list_player_stop( libvlc_media_list_player_t * p_mlp);
158 159 160 161 162

/**
 * Play next item from media list
 *
 * \param p_mlp media list player instance
163
 * \return 0 upon success -1 if there is no next item
164
 */
165 166
VLC_PUBLIC_API
int libvlc_media_list_player_next(libvlc_media_list_player_t * p_mlp);
167

168 169 170 171
/**
 * Play previous item from media list
 *
 * \param p_mlp media list player instance
172
 * \return 0 upon success -1 if there is no previous item
173
 */
174 175
VLC_PUBLIC_API
int libvlc_media_list_player_previous(libvlc_media_list_player_t * p_mlp);
176 177 178 179 180 181 182 183 184



/**
 * Sets the playback mode for the playlist
 *
 * \param p_mlp media list player instance
 * \param e_mode playback mode specification
 */
185 186 187
VLC_PUBLIC_API
void libvlc_media_list_player_set_playback_mode(libvlc_media_list_player_t * p_mlp,
                                                libvlc_playback_mode_t e_mode );
188 189 190 191 192 193 194 195

/** @} media_list_player */

# ifdef __cplusplus
}
# endif

#endif /* LIBVLC_MEDIA_LIST_PLAYER_H */