annotate audacious/playlist.h @ 119:ba761ed802ab trunk

[svn] s/xmms/Audacious/g
author nenolod
date Thu, 03 Nov 2005 21:56:07 -0800
parents cb178e5ad177
children 1c701dfe5098
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>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
24
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 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
34 PLAYLIST_FORMAT_UNKNOWN = -1,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
35 PLAYLIST_FORMAT_M3U,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
36 PLAYLIST_FORMAT_PLS,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
37 PLAYLIST_FORMAT_COUNT
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
38 } PlaylistFormat;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
39
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
40
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
41 #define PLAYLIST_ENTRY(x) ((PlaylistEntry*)(x))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
42 struct _PlaylistEntry {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
43 gchar *filename;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
44 gchar *title;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
45 gint length;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
46 gboolean selected;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
47 };
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
48
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
49 typedef struct _PlaylistEntry PlaylistEntry;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
50
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
51 PlaylistEntry *playlist_entry_new(const gchar * filename,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
52 const gchar * title, const gint len);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
53 void playlist_entry_free(PlaylistEntry * entry);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
54
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
55 void playlist_init(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
56 void playlist_clear(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
57 void playlist_delete(gboolean crop);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
58
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
59 gboolean playlist_add(const gchar * filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
60 gboolean playlist_ins(const gchar * filename, gint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
61 guint playlist_add_dir(const gchar * dir);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
62 guint playlist_ins_dir(const gchar * dir, gint pos, gboolean background);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
63 guint playlist_add_url(const gchar * url);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
64 guint playlist_ins_url(const gchar * string, gint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
65
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
66 void playlist_play(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
67 void playlist_set_info(const gchar * title, gint length, gint rate,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
68 gint freq, gint nch);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
69 void playlist_check_pos_current(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
70 void playlist_next(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
71 void playlist_prev(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
72 void playlist_queue(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
73 void playlist_queue_position(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
74 void playlist_queue_remove(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
75 gint playlist_queue_get_length(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
76 gboolean playlist_is_position_queued(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
77 void playlist_clear_queue(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
78 gint playlist_get_queue_position(PlaylistEntry * entry);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
79 void playlist_eof_reached(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
80 void playlist_set_position(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
81 gint playlist_get_length(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
82 gint playlist_get_length_nolock(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
83 gint playlist_get_position(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
84 gint playlist_get_position_nolock(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
85 gchar *playlist_get_info_text(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
86 gint playlist_get_current_length(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
87
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
88 gboolean playlist_save(const gchar * filename, PlaylistFormat format);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
89 gboolean playlist_load(const gchar * filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
90
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
91 GList *playlist_get(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
92
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
93 void playlist_start_get_info_thread(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
94 void playlist_stop_get_info_thread();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
95 void playlist_start_get_info_scan(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
96
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
97 void playlist_sort(PlaylistSortType type);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
98 void playlist_sort_selected(PlaylistSortType type);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
99
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
100 void playlist_reverse(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
101 void playlist_random(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
102 void playlist_remove_dead_files(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
103
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
104 void playlist_fileinfo_current(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
105 void playlist_fileinfo(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
106
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
107 void playlist_delete_index(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
108 void playlist_delete_filenames(GList * filenames);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
109
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
110 const gchar *playlist_get_filename_to_play();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
111 gchar *playlist_get_filename(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
112 gchar *playlist_get_songtitle(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
113 gint playlist_get_songtime(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
114
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
115 GList *playlist_get_selected(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
116 GList *playlist_get_selected_list(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
117 int playlist_get_num_selected(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
118
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
119 void playlist_get_total_time(gulong * total_time, gulong * selection_time,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
120 gboolean * total_more,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
121 gboolean * selection_more);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
122
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
123 void playlist_select_all(gboolean set);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
124 void playlist_select_range(gint min, gint max, gboolean sel);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
125 void playlist_select_invert_all(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
126 gboolean playlist_select_invert(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
127
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
128 gboolean playlist_read_info_selection(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
129 void playlist_read_info(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
130
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
131 void playlist_set_shuffle(gboolean shuffle);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
132
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
133 void playlist_clear_selected(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
134
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
135 GList *get_playlist_nth(guint);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
136 gboolean playlist_set_current_name(const gchar * filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
137 const gchar *playlist_get_current_name(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
138 void playlist_new(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
139
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
140 PlaylistFormat playlist_format_get_from_name(const gchar * filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
141 gboolean is_playlist_name(const gchar * filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
142
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
143 #define PLAYLIST_LOCK() G_LOCK(playlist)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
144 #define PLAYLIST_UNLOCK() G_UNLOCK(playlist)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
145
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
146 G_LOCK_EXTERN(playlist);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
147
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
148 #endif