annotate audacious/playlist.h @ 918:b59d9a02b160 trunk

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