]> git.sesse.net Git - vlc/blob - include/vlc_playlist.h
* ALL: changed "struct foo_s" into "struct foo_t" to make greppers happy.
[vlc] / include / vlc_playlist.h
1 /*****************************************************************************
2  * vlc_playlist.h : Playlist functions
3  *****************************************************************************
4  * Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
5  * $Id: vlc_playlist.h,v 1.3 2002/07/20 18:01:42 sam 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 struct playlist_item_t
28 {
29     char *  psz_name;
30     int     i_type;   /* unused yet */
31     int     i_status; /* unused yet */
32 };
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 struct playlist_t
42 {
43     VLC_COMMON_MEMBERS
44
45     int                   i_index;                          /* current index */
46     int                   i_status;
47     int                   i_size;                              /* total size */
48
49     playlist_item_t **    pp_items;
50
51     input_thread_t *      p_input;
52 };
53
54 /*****************************************************************************
55  * Prototypes
56  *****************************************************************************/
57 #define playlist_Create(a) __playlist_Create(CAST_TO_VLC_OBJECT(a))
58 playlist_t * __playlist_Create   ( vlc_object_t * );
59 void           playlist_Destroy  ( playlist_t * );
60
61 #define playlist_Play(p) playlist_Command(p,PLAYLIST_PLAY,0)
62 #define playlist_Pause(p) playlist_Command(p,PLAYLIST_PAUSE,0)
63 #define playlist_Stop(p) playlist_Command(p,PLAYLIST_STOP,0)
64 #define playlist_Next(p) playlist_Command(p,PLAYLIST_SKIP,1)
65 #define playlist_Prev(p) playlist_Command(p,PLAYLIST_SKIP,-1)
66 #define playlist_Skip(p,i) playlist_Command(p,PLAYLIST_SKIP,i)
67 #define playlist_Goto(p,i) playlist_Command(p,PLAYLIST_GOTO,i)
68 VLC_EXPORT( void, playlist_Command, ( playlist_t *, int, int ) );
69
70 VLC_EXPORT( int,  playlist_Add,    ( playlist_t *, const char *, int, int ) );
71 VLC_EXPORT( int,  playlist_Delete, ( playlist_t *, int ) );
72