Audacious $Id:Doxyfile42802007-03-2104:39:00Znenolod$
playlist.h
Go to the documentation of this file.
00001 /*
00002  * playlist.h
00003  * Copyright 2010 John Lindgren
00004  *
00005  * This file is part of Audacious.
00006  *
00007  * Audacious is free software: you can redistribute it and/or modify it under
00008  * the terms of the GNU General Public License as published by the Free Software
00009  * Foundation, version 2 or version 3 of the License.
00010  *
00011  * Audacious is distributed in the hope that it will be useful, but WITHOUT ANY
00012  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
00013  * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License along with
00016  * Audacious. If not, see <http://www.gnu.org/licenses/>.
00017  *
00018  * The Audacious team does not consider modular code linking to Audacious or
00019  * using our public API to be a derived work.
00020  */
00021 
00022 #ifndef AUDACIOUS_PLAYLIST_H
00023 #define AUDACIOUS_PLAYLIST_H
00024 
00025 #include <glib.h>
00026 #include <audacious/api.h>
00027 #include <audacious/types.h>
00028 #include <libaudcore/index.h>
00029 #include <libaudcore/tuple.h>
00030 
00031 /* The values which can be passed (packed into a pointer) to the "playlist
00032  * update" hook.  PLAYLIST_UPDATE_SELECTION means that entries have been
00033  * selected or unselected, entries have been added or removed from the queue,
00034  * or that the current song has changed.  PLAYLIST_UPDATE_METADATA means that
00035  * new metadata has been read for some entries, and implies
00036  * PLAYLIST_UPDATE_SELECTION.  PLAYLIST_UPDATE_STRUCTURE covers any change not
00037  * listed under the other types, and implies both PLAYLIST_UPDATE_SELECTION and
00038  * PLAYLIST_UPDATE_METADATA. */
00039 enum {
00040  PLAYLIST_UPDATE_SELECTION,
00041  PLAYLIST_UPDATE_METADATA,
00042  PLAYLIST_UPDATE_STRUCTURE,
00043  PLAYLIST_UPDATE_TYPES};
00044 
00045 /* The values which can be passed to playlist_sort_by_scheme(),
00046  * playlist_sort_selected_by_scheme(), and
00047  * playlist_remove_duplicates_by_scheme().  PLAYLIST_SORT_PATH means the entire
00048  * URI of a song file; PLAYLIST_SORT_FILENAME means the portion after the last
00049  * "/" (forward slash).  PLAYLIST_SORT_DATE means the song's release date (not
00050  * the file's modification time). */
00051 enum {
00052  PLAYLIST_SORT_PATH,
00053  PLAYLIST_SORT_FILENAME,
00054  PLAYLIST_SORT_TITLE,
00055  PLAYLIST_SORT_ALBUM,
00056  PLAYLIST_SORT_ARTIST,
00057  PLAYLIST_SORT_DATE,
00058  PLAYLIST_SORT_TRACK,
00059  PLAYLIST_SORT_FORMATTED_TITLE,
00060  PLAYLIST_SORT_SCHEMES};
00061 
00062 #define PlaylistFilenameCompareFunc PlaylistStringCompareFunc /* deprecated */
00063 typedef gint (* PlaylistStringCompareFunc) (const gchar * a, const gchar * b);
00064 typedef gint (* PlaylistTupleCompareFunc) (const Tuple * a, const Tuple * b);
00065 
00066 #define AUD_API_NAME PlaylistAPI
00067 #define AUD_API_SYMBOL playlist_api
00068 
00069 #ifdef _AUDACIOUS_CORE
00070 
00071 #include "api-local-begin.h"
00072 #include "playlist-api.h"
00073 #include "api-local-end.h"
00074 
00075 /* playlist-new.c */
00076 void playlist_init (void);
00077 void playlist_end (void);
00078 void playlist_load_state (void);
00079 void playlist_save_state (void);
00080 
00081 void playlist_reformat_titles (void);
00082 
00083 void playlist_entry_insert_batch_with_decoders (gint playlist, gint at,
00084  struct index * filenames, struct index * decoders, struct index * tuples);
00085 void playlist_entry_set_tuple (gint playlist, gint entry, Tuple * tuple);
00086 
00087 gboolean playlist_entry_is_segmented (gint playlist, gint entry);
00088 gint playlist_entry_get_start_time (gint playlist, gint entry);
00089 gint playlist_entry_get_end_time (gint playlist, gint entry);
00090 
00091 gboolean playlist_prev_song (gint playlist);
00092 gboolean playlist_next_song (gint playlist, gboolean repeat);
00093 
00094 /* playlist-utils.c */
00095 void save_playlists (void);
00096 void load_playlists (void);
00097 
00098 #else
00099 
00100 #include <audacious/api-define-begin.h>
00101 #include <audacious/playlist-api.h>
00102 #include <audacious/api-define-end.h>
00103 
00104 #include <audacious/api-alias-begin.h>
00105 #include <audacious/playlist-api.h>
00106 #include <audacious/api-alias-end.h>
00107 
00108 #endif
00109 
00110 #undef AUD_API_NAME
00111 #undef AUD_API_SYMBOL
00112 
00113 #endif
00114 
00115 #ifdef AUD_API_DECLARE
00116 
00117 #define AUD_API_NAME PlaylistAPI
00118 #define AUD_API_SYMBOL playlist_api
00119 
00120 #include "api-define-begin.h"
00121 #include "playlist-api.h"
00122 #include "api-define-end.h"
00123 
00124 #include "api-declare-begin.h"
00125 #include "playlist-api.h"
00126 #include "api-declare-end.h"
00127 
00128 #undef AUD_API_NAME
00129 #undef AUD_API_SYMBOL
00130 
00131 #endif