1 /*****************************************************************************
2 * intf_playlist.h : Playlist functions
3 *****************************************************************************
4 * Copyright (C) 1999, 2000 VideoLAN
5 * $Id: intf_playlist.h,v 1.2 2001/03/21 13:42:33 sam Exp $
7 * Authors: Samuel Hocevar <sam@zoy.org>
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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 *****************************************************************************/
24 /*****************************************************************************
25 * playlist_item_t: playlist item
26 *****************************************************************************/
27 typedef struct playlist_item_s
30 int i_type; /* unused yet */
31 int i_status; /* unused yet */
34 /*****************************************************************************
35 * playlist_t: playlist structure
36 *****************************************************************************
37 * The structure contains information about the size and browsing mode of
38 * the playlist, a change lock, a dynamic array of playlist items, and a
39 * current item which is an exact copy of one of the array members.
40 *****************************************************************************/
41 typedef struct playlist_s
43 int i_index; /* current index */
44 int i_size; /* total size */
46 int i_mode; /* parse mode (random, forward, backward) */
47 int i_seed; /* seed used for random mode */
49 vlc_mutex_t change_lock;
51 playlist_item_t current;
52 playlist_item_t* p_item;
55 /* Used by intf_PlaylistAdd */
56 #define PLAYLIST_START 0
57 #define PLAYLIST_END -1
59 /* Playlist parsing mode */
60 #define PLAYLIST_REPEAT_CURRENT 0 /* Keep playing current item */
61 #define PLAYLIST_FORWARD 1 /* Parse playlist until end */
62 #define PLAYLIST_BACKWARD -1 /* Parse backwards */
63 #define PLAYLIST_FORWARD_LOOP 2 /* Parse playlist and loop */
64 #define PLAYLIST_BACKWARD_LOOP -2 /* Parse backwards and loop */
65 #define PLAYLIST_RANDOM 3 /* Shuffle play */
66 #define PLAYLIST_REVERSE_RANDOM -3 /* Reverse shuffle play */
68 /*****************************************************************************
70 *****************************************************************************/
71 playlist_t * intf_PlaylistCreate ( void );
72 void intf_PlaylistInit ( playlist_t * p_playlist );
73 int intf_PlaylistAdd ( playlist_t * p_playlist,
74 int i_pos, const char * psz_item );
75 int intf_PlaylistDelete ( playlist_t * p_playlist, int i_pos );
76 void intf_PlaylistNext ( playlist_t * p_playlist );
77 void intf_PlaylistPrev ( playlist_t * p_playlist );
78 void intf_PlaylistDestroy ( playlist_t * p_playlist );
79 void intf_PlaylistJumpto ( playlist_t * p_playlist , int i_pos);