~ubuntu-branches/ubuntu/lucid/mpg123/lucid

« back to all changes in this revision

Viewing changes to src/playlist.h

Tags: upstream-0.60
ImportĀ upstreamĀ versionĀ 0.60

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
        playlist: playlist logic
 
3
 
 
4
        copyright 1995-2006 by the mpg123 project - free software under the terms of the LGPL 2.1
 
5
        see COPYING and AUTHORS files in distribution or http://mpg123.de
 
6
        initially written by Michael Hipp, outsourced/reorganized by Thomas Orgis
 
7
*/
 
8
#ifndef MPG123_PLAYLIST_H
 
9
#define MPG123_PLAYLIST_H
 
10
 
 
11
#include "stringbuf.h"
 
12
 
 
13
enum playlist_type { UNKNOWN = 0, M3U, PLS, NO_LIST };
 
14
 
 
15
typedef struct listitem
 
16
{
 
17
        char* url; /* the filename */
 
18
        char freeit; /* if it was allocated and should be free()d here */
 
19
} listitem;
 
20
 
 
21
typedef struct playlist_struct
 
22
{
 
23
        FILE* file; /* the current playlist stream */
 
24
        size_t entry; /* entry in the playlist file */
 
25
        size_t size;
 
26
        size_t fill;
 
27
        size_t pos;
 
28
        size_t alloc_step;
 
29
        struct listitem* list;
 
30
        struct stringbuf linebuf;
 
31
        struct stringbuf dir;
 
32
        enum playlist_type type;
 
33
} playlist_struct;
 
34
 
 
35
extern struct playlist_struct pl;
 
36
 
 
37
/* create playlist form argv including reading of playlist file */
 
38
void prepare_playlist(int argc, char** argv);
 
39
/* returns the next url to play or NULL when there is none left */
 
40
char *get_next_file();
 
41
/* frees memory that got allocated in prepare_playlist */
 
42
void free_playlist();
 
43
 
 
44
#endif