[c47208]: ogg123 / playlist.h  Maximize  Restore  History

Download this file

69 lines (50 with data), 2.5 kB

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

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks