1 /*****************************************************************************
2 * intf_playlist.h : Playlist functions
3 *****************************************************************************
4 * Copyright (C) 1999, 2000 VideoLAN
5 * $Id: intf_playlist.h,v 1.5 2001/12/30 07:09:54 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 */
50 vlc_mutex_t change_lock;
52 playlist_item_t current;
53 playlist_item_t* p_item;
56 /* Used by intf_PlaylistAdd */
57 #define PLAYLIST_START 0
58 #define PLAYLIST_END -1
60 /* Playlist parsing mode */
61 #define PLAYLIST_REPEAT_CURRENT 0 /* Keep playing current item */
62 #define PLAYLIST_FORWARD 1 /* Parse playlist until end */
63 #define PLAYLIST_BACKWARD -1 /* Parse backwards */
64 #define PLAYLIST_FORWARD_LOOP 2 /* Parse playlist and loop */
65 #define PLAYLIST_BACKWARD_LOOP -2 /* Parse backwards and loop */
66 #define PLAYLIST_RANDOM 3 /* Shuffle play */
67 #define PLAYLIST_REVERSE_RANDOM -3 /* Reverse shuffle play */
69 /*****************************************************************************
71 *****************************************************************************/
73 playlist_t * intf_PlaylistCreate ( void );
74 void intf_PlaylistInit ( playlist_t * p_playlist );
75 int intf_PlaylistAdd ( playlist_t * p_playlist,
76 int i_pos, const char * psz_item );
77 int intf_PlaylistDelete ( playlist_t * p_playlist, int i_pos );
78 void intf_PlaylistNext ( playlist_t * p_playlist );
79 void intf_PlaylistPrev ( playlist_t * p_playlist );
80 void intf_PlaylistDestroy ( playlist_t * p_playlist );
81 void intf_PlaylistJumpto ( playlist_t * p_playlist , int i_pos);
82 void intf_UrlDecode ( char * );
84 # define intf_PlaylistAdd p_symbols->intf_PlaylistAdd
85 # define intf_PlaylistDelete p_symbols->intf_PlaylistDelete
86 # define intf_PlaylistNext p_symbols->intf_PlaylistNext
87 # define intf_PlaylistPrev p_symbols->intf_PlaylistPrev
88 # define intf_PlaylistDestroy p_symbols->intf_PlaylistDestroy
89 # define intf_PlaylistJumpto p_symbols->intf_PlaylistJumpto
90 # define intf_UrlDecode p_symbols->intf_UrlDecode