Audacious  $Id:Doxyfile42802007-03-2104:39:00Znenolod$
playlist.h
Go to the documentation of this file.
1 /*
2  * playlist.h
3  * Copyright 2010 John Lindgren
4  *
5  * This file is part of Audacious.
6  *
7  * Audacious is free software: you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License as published by the Free Software
9  * Foundation, version 2 or version 3 of the License.
10  *
11  * Audacious is distributed in the hope that it will be useful, but WITHOUT ANY
12  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13  * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along with
16  * Audacious. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * The Audacious team does not consider modular code linking to Audacious or
19  * using our public API to be a derived work.
20  */
21 
22 #ifndef AUDACIOUS_PLAYLIST_H
23 #define AUDACIOUS_PLAYLIST_H
24 
25 #include <stdint.h>
26 
27 #include <audacious/api.h>
28 #include <audacious/types.h>
29 #include <libaudcore/index.h>
30 #include <libaudcore/tuple.h>
31 
32 /* The values which can be passed (packed into a pointer) to the "playlist
33  * update" hook. PLAYLIST_UPDATE_SELECTION means that entries have been
34  * selected or unselected, or that entries have been added to or removed from
35  * the queue. PLAYLIST_UPDATE_METADATA means that new metadata has been read
36  * for some entries, or that the title or filename of a playlist has changed,
37  * and implies PLAYLIST_UPDATE_SELECTION. PLAYLIST_UPDATE_STRUCTURE covers any
38  * change not listed under the other types, and implies both
39  * PLAYLIST_UPDATE_SELECTION and PLAYLIST_UPDATE_METADATA. */
40 enum {
44 
45 /* The values which can be passed to playlist_sort_by_scheme(),
46  * playlist_sort_selected_by_scheme(), and
47  * playlist_remove_duplicates_by_scheme(). PLAYLIST_SORT_PATH means the entire
48  * URI of a song file; PLAYLIST_SORT_FILENAME means the portion after the last
49  * "/" (forward slash). PLAYLIST_SORT_DATE means the song's release date (not
50  * the file's modification time). */
51 enum {
61 
62 typedef bool_t (* PlaylistFilterFunc) (const char * filename, void * user);
63 typedef int (* PlaylistStringCompareFunc) (const char * a, const char * b);
64 typedef int (* PlaylistTupleCompareFunc) (const Tuple * a, const Tuple * b);
65 
66 #define AUD_API_NAME PlaylistAPI
67 #define AUD_API_SYMBOL playlist_api
68 
69 #ifdef _AUDACIOUS_CORE
70 
71 #include "api-local-begin.h"
72 #include "playlist-api.h"
73 #include "api-local-end.h"
74 
75 /* playlist-files.c */
76 bool_t playlist_load (const char * filename, char * * title,
77  Index * * filenames, Index * * tuples);
79  const char * filename);
80 
81 /* playlist-new.c */
82 void playlist_init (void);
83 void playlist_end (void);
84 
85 void playlist_insert_with_id (int at, int id);
88 
89 void playlist_load_state (void);
90 void playlist_save_state (void);
91 void playlist_resume (void);
92 
93 void playlist_reformat_titles (void);
94 void playlist_trigger_scan (void);
95 
97  Index * filenames, Index * tuples, Index * decoders);
98 
101 
102 int playback_entry_get_position (void);
104 Tuple * playback_entry_get_tuple (void);
105 char * playback_entry_get_title (void);
106 int playback_entry_get_length (void);
107 
108 void playback_entry_set_tuple (Tuple * tuple);
109 
111 int playback_entry_get_end_time (void);
112 
113 /* playlist-utils.c */
114 void load_playlists (void);
115 void save_playlists (bool_t exiting);
116 
117 #else
118 
120 #include <audacious/playlist-api.h>
122 
124 #include <audacious/playlist-api.h>
125 #include <audacious/api-alias-end.h>
126 
127 #endif
128 
129 #undef AUD_API_NAME
130 #undef AUD_API_SYMBOL
131 
132 #endif
133 
134 #ifdef AUD_API_DECLARE
135 
136 #define AUD_API_NAME PlaylistAPI
137 #define AUD_API_SYMBOL playlist_api
138 
139 #include "api-define-begin.h"
140 #include "playlist-api.h"
141 #include "api-define-end.h"
142 
143 #include "api-declare-begin.h"
144 #include "playlist-api.h"
145 #include "api-declare-end.h"
146 
147 #undef AUD_API_NAME
148 #undef AUD_API_SYMBOL
149 
150 #endif