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 {
60 
61 typedef bool_t (* PlaylistFilterFunc) (const char * filename, void * user);
62 typedef int (* PlaylistStringCompareFunc) (const char * a, const char * b);
63 typedef int (* PlaylistTupleCompareFunc) (const Tuple * a, const Tuple * b);
64 
65 #define AUD_API_NAME PlaylistAPI
66 #define AUD_API_SYMBOL playlist_api
67 
68 #ifdef _AUDACIOUS_CORE
69 
70 #include "api-local-begin.h"
71 #include "playlist-api.h"
72 #include "api-local-end.h"
73 
74 /* playlist-files.c */
75 bool_t playlist_load (const char * filename, char * * title,
76  Index * * filenames, Index * * tuples);
78  const char * filename);
79 
80 /* playlist-new.c */
81 void playlist_init (void);
82 void playlist_end (void);
83 
84 void playlist_insert_with_id (int at, int id);
87 
88 void playlist_load_state (void);
89 void playlist_save_state (void);
90 void playlist_resume (void);
91 
92 void playlist_reformat_titles (void);
93 void playlist_trigger_scan (void);
94 
96  Index * filenames, Index * tuples, Index * decoders);
97 
100 
101 int playback_entry_get_position (void);
102 char * playback_entry_get_filename (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 
110 /* playlist-utils.c */
111 void load_playlists (void);
112 void save_playlists (bool_t exiting);
113 
114 #else
115 
117 #include <audacious/playlist-api.h>
119 
121 #include <audacious/playlist-api.h>
122 #include <audacious/api-alias-end.h>
123 
124 #endif
125 
126 #undef AUD_API_NAME
127 #undef AUD_API_SYMBOL
128 
129 #endif
130 
131 #ifdef AUD_API_DECLARE
132 
133 #define AUD_API_NAME PlaylistAPI
134 #define AUD_API_SYMBOL playlist_api
135 
136 #include "api-define-begin.h"
137 #include "playlist-api.h"
138 #include "api-define-end.h"
139 
140 #include "api-declare-begin.h"
141 #include "playlist-api.h"
142 #include "api-declare-end.h"
143 
144 #undef AUD_API_NAME
145 #undef AUD_API_SYMBOL
146 
147 #endif