1 #ifndef _UADE123_PLAYLIST_H_ 2 #define _UADE123_PLAYLIST_H_ 3 4 #include <stdio.h> 5 #include <stdlib.h> 6 7 #include "chrarray.h" 8 9 struct playlist { 10 int valid; 11 size_t pos; 12 int randomize; 13 int repeat; 14 struct chrarray list; 15 }; 16 17 18 struct playlist_iterator { 19 size_t index; 20 struct playlist *pl; 21 }; 22 23 24 enum { 25 UADE_PLAY_PREVIOUS = -1, 26 UADE_PLAY_CURRENT, 27 UADE_PLAY_NEXT, 28 UADE_PLAY_EXIT, 29 UADE_PLAY_FAILURE 30 }; 31 32 33 int playlist_add(struct playlist *pl, const char *name, int recursive, int cygwin); 34 int playlist_empty(struct playlist *pl); 35 int playlist_get(char *name, size_t maxlen, struct playlist *pl, int dir); 36 int playlist_init(struct playlist *pl); 37 void playlist_iterator(struct playlist_iterator *pli, struct playlist *pl); 38 char *playlist_iterator_get(struct playlist_iterator *pli); 39 int playlist_random(struct playlist *pl, int enable); 40 void playlist_randomize(struct playlist *pl); 41 void playlist_repeat(struct playlist *pl); 42 43 #endif 44