]> git.sesse.net Git - vlc/blob - include/intf_playlist.h
56a6764681554cf995dc2528e956be2104b09932
[vlc] / include / intf_playlist.h
1 /*****************************************************************************
2  * intf_playlist.h : Playlist functions
3  *****************************************************************************
4  * Copyright (C) 1999, 2000 VideoLAN
5  * $Id: intf_playlist.h,v 1.3 2001/05/15 01:01:44 stef Exp $
6  *
7  * Authors: Samuel Hocevar <sam@zoy.org>
8  *
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.
13  * 
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.
18  *
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  *****************************************************************************/
23
24 /*****************************************************************************
25  * playlist_item_t: playlist item
26  *****************************************************************************/
27 typedef struct playlist_item_s
28 {
29     char*             psz_name;
30     int               i_type;   /* unused yet */
31     int               i_status; /* unused yet */
32 } playlist_item_t;
33
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
42 {
43     int                   i_index;                          /* current index */
44     int                   i_size;                              /* total size */
45
46     int                   i_mode;  /* parse mode (random, forward, backward) */
47     int                   i_seed;               /* seed used for random mode */
48     boolean_t             b_stopped;
49
50     vlc_mutex_t           change_lock;
51
52     playlist_item_t       current;
53     playlist_item_t*      p_item;
54 } playlist_t;
55
56 /* Used by intf_PlaylistAdd */
57 #define PLAYLIST_START            0
58 #define PLAYLIST_END             -1
59
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 */
68
69 /*****************************************************************************
70  * Prototypes
71  *****************************************************************************/
72 playlist_t * intf_PlaylistCreate   ( void );
73 void         intf_PlaylistInit     ( playlist_t * p_playlist );
74 int          intf_PlaylistAdd      ( playlist_t * p_playlist,
75                                      int i_pos, const char * psz_item );
76 int          intf_PlaylistDelete   ( playlist_t * p_playlist, int i_pos );
77 void         intf_PlaylistNext     ( playlist_t * p_playlist );
78 void         intf_PlaylistPrev     ( playlist_t * p_playlist );
79 void         intf_PlaylistDestroy  ( playlist_t * p_playlist );
80 void         intf_PlaylistJumpto   ( playlist_t * p_playlist , int i_pos);
81