Audacious  $Id:Doxyfile42802007-03-2104:39:00Znenolod$
playlist.h
Go to the documentation of this file.
1 /*
2  * playlist.h
3  * Copyright 2010-2012 John Lindgren
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions, and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions, and the following disclaimer in the documentation
13  * provided with the distribution.
14  *
15  * This software is provided "as is" and without any warranty, express or
16  * implied. In no event shall the authors be liable for any damages arising from
17  * the use of this software.
18  */
19 
20 #ifndef AUDACIOUS_PLAYLIST_H
21 #define AUDACIOUS_PLAYLIST_H
22 
23 #include <stdint.h>
24 
25 #include <audacious/api.h>
26 #include <audacious/types.h>
27 #include <libaudcore/index.h>
28 #include <libaudcore/tuple.h>
29 
30 /* The values which can be passed (packed into a pointer) to the "playlist
31  * update" hook. PLAYLIST_UPDATE_SELECTION means that entries have been
32  * selected or unselected, or that entries have been added to or removed from
33  * the queue. PLAYLIST_UPDATE_METADATA means that new metadata has been read
34  * for some entries, or that the title or filename of a playlist has changed,
35  * and implies PLAYLIST_UPDATE_SELECTION. PLAYLIST_UPDATE_STRUCTURE covers any
36  * change not listed under the other types, and implies both
37  * PLAYLIST_UPDATE_SELECTION and PLAYLIST_UPDATE_METADATA. */
38 enum {
42 
43 /* The values which can be passed to playlist_sort_by_scheme(),
44  * playlist_sort_selected_by_scheme(), and
45  * playlist_remove_duplicates_by_scheme(). PLAYLIST_SORT_PATH means the entire
46  * URI of a song file; PLAYLIST_SORT_FILENAME means the portion after the last
47  * "/" (forward slash). PLAYLIST_SORT_DATE means the song's release date (not
48  * the file's modification time). */
49 enum {
59 
60 typedef bool_t (* PlaylistFilterFunc) (const char * filename, void * user);
61 typedef int (* PlaylistStringCompareFunc) (const char * a, const char * b);
62 typedef int (* PlaylistTupleCompareFunc) (const Tuple * a, const Tuple * b);
63 
64 #define AUD_API_NAME PlaylistAPI
65 #define AUD_API_SYMBOL playlist_api
66 
67 #ifdef _AUDACIOUS_CORE
68 
69 #include "api-local-begin.h"
70 #include "playlist-api.h"
71 #include "api-local-end.h"
72 
73 /* playlist-files.c */
74 bool_t playlist_load (const char * filename, char * * title,
75  Index * * filenames, Index * * tuples);
77  const char * filename);
78 
79 /* playlist-new.c */
80 void playlist_init (void);
81 void playlist_end (void);
82 
83 void playlist_insert_with_id (int at, int id);
86 
87 void playlist_load_state (void);
88 void playlist_save_state (void);
89 void playlist_resume (void);
90 
91 void playlist_reformat_titles (void);
92 void playlist_trigger_scan (void);
93 
95  Index * filenames, Index * tuples, Index * decoders);
96 
99 
100 int playback_entry_get_position (void);
102 Tuple * playback_entry_get_tuple (void);
103 char * playback_entry_get_title (void);
104 int playback_entry_get_length (void);
105 
106 void playback_entry_set_tuple (Tuple * tuple);
107 
109 int playback_entry_get_end_time (void);
110 
111 /* playlist-utils.c */
112 void load_playlists (void);
113 void save_playlists (bool_t exiting);
114 
115 #else
116 
118 #include <audacious/playlist-api.h>
120 
122 #include <audacious/playlist-api.h>
123 #include <audacious/api-alias-end.h>
124 
125 #endif
126 
127 #undef AUD_API_NAME
128 #undef AUD_API_SYMBOL
129 
130 #endif
131 
132 #ifdef AUD_API_DECLARE
133 
134 #define AUD_API_NAME PlaylistAPI
135 #define AUD_API_SYMBOL playlist_api
136 
137 #include "api-define-begin.h"
138 #include "playlist-api.h"
139 #include "api-define-end.h"
140 
141 #include "api-declare-begin.h"
142 #include "playlist-api.h"
143 #include "api-declare-end.h"
144 
145 #undef AUD_API_NAME
146 #undef AUD_API_SYMBOL
147 
148 #endif