]> git.sesse.net Git - vlc/blob - include/intf_playlist.h
* Bug fixes and enhancements in the Gtk+/Gnome interfaces.
[vlc] / include / intf_playlist.h
1 /*****************************************************************************
2  * intf_playlist.h : Playlist functions
3  *****************************************************************************
4  * Copyright (C) 1999, 2000 VideoLAN
5  *
6  * Authors: Samuel Hocevar <sam@zoy.org>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  * 
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
21  *****************************************************************************/
22
23 /*****************************************************************************
24  * playlist_item_t: playlist item
25  *****************************************************************************/
26 typedef struct playlist_item_s
27 {
28     char*             psz_name;
29     int               i_type;   /* unused yet */
30     int               i_status; /* unused yet */
31 } playlist_item_t;
32
33 /*****************************************************************************
34  * playlist_t: playlist structure
35  *****************************************************************************
36  * The structure contains information about the size and browsing mode of
37  * the playlist, a change lock, a dynamic array of playlist items, and a
38  * current item which is an exact copy of one of the array members.
39  *****************************************************************************/
40 typedef struct playlist_s
41 {
42     int                   i_index;                          /* current index */
43     int                   i_size;                              /* total size */
44
45     int                   i_mode;  /* parse mode (random, forward, backward) */
46     int                   i_seed;               /* seed used for random mode */
47
48     vlc_mutex_t           change_lock;
49
50     playlist_item_t       current;
51     playlist_item_t*      p_item;
52 } playlist_t;
53
54 /* Used by intf_PlaylistAdd */
55 #define PLAYLIST_START            0
56 #define PLAYLIST_END             -1
57
58 /* Playlist parsing mode */
59 #define PLAYLIST_REPEAT_CURRENT   0             /* Keep playing current item */
60 #define PLAYLIST_FORWARD          1              /* Parse playlist until end */
61 #define PLAYLIST_BACKWARD        -1                       /* Parse backwards */
62 #define PLAYLIST_FORWARD_LOOP     2               /* Parse playlist and loop */
63 #define PLAYLIST_BACKWARD_LOOP   -2              /* Parse backwards and loop */
64 #define PLAYLIST_RANDOM           3                          /* Shuffle play */
65 #define PLAYLIST_REVERSE_RANDOM  -3                  /* Reverse shuffle play */
66
67 /*****************************************************************************
68  * Prototypes
69  *****************************************************************************/
70 playlist_t * intf_PlaylistCreate   ( void );
71 void         intf_PlaylistInit     ( playlist_t * p_playlist );
72 int          intf_PlaylistAdd      ( playlist_t * p_playlist,
73                                      int i_pos, const char * psz_item );
74 int          intf_PlaylistDelete   ( playlist_t * p_playlist, int i_pos );
75 void         intf_PlaylistNext     ( playlist_t * p_playlist );
76 void         intf_PlaylistPrev     ( playlist_t * p_playlist );
77 void         intf_PlaylistDestroy  ( playlist_t * p_playlist );
78 void         intf_PlaylistJumpto   ( playlist_t * p_playlist , int i_pos);
79