Added vorbis-tools.
[vorbis-lancer-gcc.git] / vorbis-tools-1.2.0 / ogg123 / playlist.h
blob5ce6cbcc66a4ba92ba0e1981e85c57593217c617
1 /********************************************************************
2 * *
3 * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
4 * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
5 * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
6 * PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
7 * *
8 * THE Ogg123 SOURCE CODE IS (C) COPYRIGHT 2000-2002 *
9 * by Stan Seibert <volsung@xiph.org> AND OTHER CONTRIBUTORS *
10 * http://www.xiph.org/ *
11 * *
12 ********************************************************************
14 last mod: $Id: playlist.h,v 1.1 2002/07/06 03:23:13 volsung Exp $
16 ********************************************************************/
18 #ifndef __PLAYLIST_H__
19 #define __PLAYLIST_H__
21 typedef struct playlist_element_t {
22 char *filename;
23 struct playlist_element_t *next;
24 } playlist_element_t;
26 /* Actual playlist structure */
27 typedef struct playlist_t {
29 /* Linked list with empty head node */
30 playlist_element_t *head;
32 /* Keep track of this for speedy appends */
33 playlist_element_t *last;
34 } playlist_t;
36 playlist_t *playlist_create();
37 void playlist_destroy(playlist_t *list);
39 /* All of the playlist_append_* functions return
40 1 if append was successful
41 0 if failure (either directory could not be accessed or playlist on disk
42 could not be opened)
46 /* Add this filename to the playlist. Filename will be strdup()'ed. Note
47 that this function will never fail. */
48 int playlist_append_file(playlist_t *list, char *filename);
50 /* Recursively adds files from the directory and subdirectories */
51 int playlist_append_directory(playlist_t *list, char *dirname);
53 /* Opens a file containing filenames, one per line, and adds them to the
54 playlist */
55 int playlist_append_from_file(playlist_t *list, char *playlist_filename);
57 /* Return the number of items in the playlist */
58 int playlist_length(playlist_t *list);
60 /* Convert the playlist to an array of strings. Strings are deep copied.
61 Size will be set to the number of elements in the array. */
62 char **playlist_to_array(playlist_t *list, int *size);
64 /* Deallocate array and all contained strings created by playlist_to_array. */
65 void playlist_array_destroy(char **array, int size);
68 #endif /* __PLAYLIST_H__ */