annotate audacious/playlist.h @ 1420:0aa4bee03747 trunk

[svn] - ok, move this fix down a little
author nenolod
date Tue, 18 Jul 2006 12:33:34 -0700
parents 01dcb223833a
children 740c08db08d9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1230
a5d5f404b933 [svn] - attach a TitleInput tuple to the PlaylistEntry class.
nenolod
parents: 984
diff changeset
1 /* Audacious - Cross-platform multimedia player
a5d5f404b933 [svn] - attach a TitleInput tuple to the PlaylistEntry class.
nenolod
parents: 984
diff changeset
2 * Copyright (C) 2005-2006 William Pitcock, Tony Vroon, George Averill,
a5d5f404b933 [svn] - attach a TitleInput tuple to the PlaylistEntry class.
nenolod
parents: 984
diff changeset
3 * Giacomo Lozito, Derek Pomery and Yoshiki Yazawa.
a5d5f404b933 [svn] - attach a TitleInput tuple to the PlaylistEntry class.
nenolod
parents: 984
diff changeset
4 *
a5d5f404b933 [svn] - attach a TitleInput tuple to the PlaylistEntry class.
nenolod
parents: 984
diff changeset
5 * XMMS - Cross-platform multimedia player
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6 * Copyright (C) 1998-2003 Peter Alm, Mikael Alm, Olle Hallnas,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
7 * Thomas Nilsson and 4Front Technologies
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
8 * Copyright (C) 1999-2003 Haavard Kvaalen
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
9 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
10 * This program is free software; you can redistribute it and/or modify
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
11 * it under the terms of the GNU General Public License as published by
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
13 * (at your option) any later version.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
14 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
15 * This program is distributed in the hope that it will be useful,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
18 * GNU General Public License for more details.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
19 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
20 * You should have received a copy of the GNU General Public License
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
21 * along with this program; if not, write to the Free Software
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
23 */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
24 #ifndef PLAYLIST_H
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
25 #define PLAYLIST_H
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
26
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
27 #include <glib.h>
1230
a5d5f404b933 [svn] - attach a TitleInput tuple to the PlaylistEntry class.
nenolod
parents: 984
diff changeset
28 #include "libaudacious/titlestring.h"
355
1c701dfe5098 [svn] Cache the decoder used for each PlaylistEntry. This reduces the amount
nenolod
parents: 0
diff changeset
29 #include "input.h"
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
30
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
31 typedef enum {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
32 PLAYLIST_SORT_PATH,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
33 PLAYLIST_SORT_FILENAME,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
34 PLAYLIST_SORT_TITLE,
1251
5f09d64c61e2 [svn] - sort by Artist
nenolod
parents: 1235
diff changeset
35 PLAYLIST_SORT_ARTIST,
1415
01dcb223833a [svn] - sort by track number
nenolod
parents: 1251
diff changeset
36 PLAYLIST_SORT_DATE,
01dcb223833a [svn] - sort by track number
nenolod
parents: 1251
diff changeset
37 PLAYLIST_SORT_TRACK
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
38 } PlaylistSortType;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
39
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
40 typedef enum {
852
bcff46a2558d [svn] added multiple 'remove duplicates' (by title, by filename, by path+filename)
giacomo
parents: 840
diff changeset
41 PLAYLIST_DUPS_PATH,
bcff46a2558d [svn] added multiple 'remove duplicates' (by title, by filename, by path+filename)
giacomo
parents: 840
diff changeset
42 PLAYLIST_DUPS_FILENAME,
bcff46a2558d [svn] added multiple 'remove duplicates' (by title, by filename, by path+filename)
giacomo
parents: 840
diff changeset
43 PLAYLIST_DUPS_TITLE
bcff46a2558d [svn] added multiple 'remove duplicates' (by title, by filename, by path+filename)
giacomo
parents: 840
diff changeset
44 } PlaylistDupsType;
bcff46a2558d [svn] added multiple 'remove duplicates' (by title, by filename, by path+filename)
giacomo
parents: 840
diff changeset
45
bcff46a2558d [svn] added multiple 'remove duplicates' (by title, by filename, by path+filename)
giacomo
parents: 840
diff changeset
46 typedef enum {
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
47 PLAYLIST_FORMAT_UNKNOWN = -1,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
48 PLAYLIST_FORMAT_M3U,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
49 PLAYLIST_FORMAT_PLS,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
50 PLAYLIST_FORMAT_COUNT
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
51 } PlaylistFormat;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
52
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
53 #define PLAYLIST_ENTRY(x) ((PlaylistEntry*)(x))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
54 struct _PlaylistEntry {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
55 gchar *filename;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
56 gchar *title;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
57 gint length;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
58 gboolean selected;
355
1c701dfe5098 [svn] Cache the decoder used for each PlaylistEntry. This reduces the amount
nenolod
parents: 0
diff changeset
59 InputPlugin *decoder;
1230
a5d5f404b933 [svn] - attach a TitleInput tuple to the PlaylistEntry class.
nenolod
parents: 984
diff changeset
60 TitleInput *tuple; /* cached entry tuple, if available */
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
61 };
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
62
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
63 typedef struct _PlaylistEntry PlaylistEntry;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
64
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
65 PlaylistEntry *playlist_entry_new(const gchar * filename,
355
1c701dfe5098 [svn] Cache the decoder used for each PlaylistEntry. This reduces the amount
nenolod
parents: 0
diff changeset
66 const gchar * title, const gint len,
1c701dfe5098 [svn] Cache the decoder used for each PlaylistEntry. This reduces the amount
nenolod
parents: 0
diff changeset
67 InputPlugin * dec);
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
68 void playlist_entry_free(PlaylistEntry * entry);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
69
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
70 void playlist_init(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
71 void playlist_clear(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
72 void playlist_delete(gboolean crop);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
73
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
74 gboolean playlist_add(const gchar * filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
75 gboolean playlist_ins(const gchar * filename, gint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
76 guint playlist_add_dir(const gchar * dir);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
77 guint playlist_ins_dir(const gchar * dir, gint pos, gboolean background);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
78 guint playlist_add_url(const gchar * url);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
79 guint playlist_ins_url(const gchar * string, gint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
80
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
81 void playlist_play(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
82 void playlist_set_info(const gchar * title, gint length, gint rate,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
83 gint freq, gint nch);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
84 void playlist_check_pos_current(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
85 void playlist_next(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
86 void playlist_prev(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
87 void playlist_queue(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
88 void playlist_queue_position(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
89 void playlist_queue_remove(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
90 gint playlist_queue_get_length(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
91 gboolean playlist_is_position_queued(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
92 void playlist_clear_queue(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
93 gint playlist_get_queue_position(PlaylistEntry * entry);
984
bcd1ebd0a7c1 [svn] - jumptofile and queue support fun
nhjm449
parents: 852
diff changeset
94 gint playlist_get_queue_position_number(guint pos);
bcd1ebd0a7c1 [svn] - jumptofile and queue support fun
nhjm449
parents: 852
diff changeset
95 gint playlist_get_queue_qposition_number(guint pos);
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
96 void playlist_eof_reached(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
97 void playlist_set_position(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
98 gint playlist_get_length(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
99 gint playlist_get_length_nolock(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
100 gint playlist_get_position(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
101 gint playlist_get_position_nolock(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
102 gchar *playlist_get_info_text(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
103 gint playlist_get_current_length(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
104
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
105 gboolean playlist_save(const gchar * filename, PlaylistFormat format);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
106 gboolean playlist_load(const gchar * filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
107
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
108 GList *playlist_get(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
109
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
110 void playlist_start_get_info_thread(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
111 void playlist_stop_get_info_thread();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
112 void playlist_start_get_info_scan(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
113
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
114 void playlist_sort(PlaylistSortType type);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
115 void playlist_sort_selected(PlaylistSortType type);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
116
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
117 void playlist_reverse(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
118 void playlist_random(void);
852
bcff46a2558d [svn] added multiple 'remove duplicates' (by title, by filename, by path+filename)
giacomo
parents: 840
diff changeset
119 void playlist_remove_duplicates(PlaylistDupsType);
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
120 void playlist_remove_dead_files(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
121
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
122 void playlist_fileinfo_current(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
123 void playlist_fileinfo(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
124
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
125 void playlist_delete_index(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
126 void playlist_delete_filenames(GList * filenames);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
127
398
f908bcd87c3d [svn] Generate cache content on demand if it was not previously there.
nenolod
parents: 356
diff changeset
128 PlaylistEntry *playlist_get_entry_to_play();
356
99928e1275a1 [svn] This commit reduces the amount of times we probe a source down to ONE
nenolod
parents: 355
diff changeset
129
99928e1275a1 [svn] This commit reduces the amount of times we probe a source down to ONE
nenolod
parents: 355
diff changeset
130 /* XXX this is for reverse compatibility --nenolod */
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
131 const gchar *playlist_get_filename_to_play();
356
99928e1275a1 [svn] This commit reduces the amount of times we probe a source down to ONE
nenolod
parents: 355
diff changeset
132
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
133 gchar *playlist_get_filename(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
134 gchar *playlist_get_songtitle(guint pos);
1235
7918849bad3e [svn] - more sanity for input_get_song_tuple()
nenolod
parents: 1230
diff changeset
135 TitleInput *playlist_get_tuple(guint pos);
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
136 gint playlist_get_songtime(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
137
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
138 GList *playlist_get_selected(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
139 GList *playlist_get_selected_list(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
140 int playlist_get_num_selected(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
141
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
142 void playlist_get_total_time(gulong * total_time, gulong * selection_time,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
143 gboolean * total_more,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
144 gboolean * selection_more);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
145
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
146 void playlist_select_all(gboolean set);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
147 void playlist_select_range(gint min, gint max, gboolean sel);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
148 void playlist_select_invert_all(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
149 gboolean playlist_select_invert(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
150
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
151 gboolean playlist_read_info_selection(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
152 void playlist_read_info(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
153
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
154 void playlist_set_shuffle(gboolean shuffle);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
155
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
156 void playlist_clear_selected(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
157
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
158 GList *get_playlist_nth(guint);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
159 gboolean playlist_set_current_name(const gchar * filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
160 const gchar *playlist_get_current_name(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
161 void playlist_new(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
162
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
163 PlaylistFormat playlist_format_get_from_name(const gchar * filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
164 gboolean is_playlist_name(const gchar * filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
165
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
166 #define PLAYLIST_LOCK() G_LOCK(playlist)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
167 #define PLAYLIST_UNLOCK() G_UNLOCK(playlist)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
168
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
169 G_LOCK_EXTERN(playlist);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
170
356
99928e1275a1 [svn] This commit reduces the amount of times we probe a source down to ONE
nenolod
parents: 355
diff changeset
171 extern PlaylistEntry *playlist_position;
99928e1275a1 [svn] This commit reduces the amount of times we probe a source down to ONE
nenolod
parents: 355
diff changeset
172
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
173 #endif