1 /*
2  * MPlayer GUI for Win32
3  * Copyright (C) 2003 Sascha Sommer <saschasommer@freenet.de>
4  * Copyright (C) 2006 Erik Augustson <erik_27can@yahoo.com>
5  * Copyright (C) 2006 Gianluigi Tiesi <sherpya@netfarm.it>
6  *
7  * This file is part of MPlayer.
8  *
9  * MPlayer 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  * MPlayer 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 along
20  * with MPlayer; if not, write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22  */
23 
24 #ifndef MPLAYER_GUI_PLAYLIST_H
25 #define MPLAYER_GUI_PLAYLIST_H
26 
27 typedef struct
28 {
29     char *filename;
30     char *artist;
31     char *title;
32     int duration;
33 } pl_track_t;
34 
35 typedef struct playlist_t playlist_t;
36 struct playlist_t
37 {
38     int current;                  /* currently used track */
39     int trackcount;               /* number of tracknumber */
40     pl_track_t **tracks;             /* tracklist */
41     void (*add_track)(playlist_t* playlist, const char *filename, const char *artist, const char *title, int duration);
42     void (*remove_track)(playlist_t* playlist, int number);
43     void (*moveup_track)(playlist_t* playlist, int number);
44     void (*movedown_track)(playlist_t* playlist, int number);
45     void (*dump_playlist)(playlist_t* playlist);
46     void (*sort_playlist)(/*playlist_t* playlist, int opt*/);
47     void (*clear_playlist)(playlist_t* playlist);
48     void (*free_playlist)(playlist_t* playlist);
49 };
50 
51 #define SORT_BYFILENAME     1
52 #define SORT_BYARTIST       2
53 #define SORT_BYTITLE        3
54 #define SORT_BYDURATION     4
55 
56 playlist_t *create_playlist(void);
57 int adddirtoplaylist(playlist_t *playlist, const char* path, int recursive);
58 
59 #endif /* MPLAYER_GUI_PLAYLIST_H */
60