annotate audacious/playlist.h @ 816:8073d8300502 trunk

[svn] display audacious version and revision in the prefs window
author giacomo
date Sat, 11 Mar 2006 16:56:50 -0800
parents f908bcd87c3d
children ffc5ab7b4b2c
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 {
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 #define PLAYLIST_ENTRY(x) ((PlaylistEntry*)(x))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
41 struct _PlaylistEntry {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
42 gchar *filename;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
43 gchar *title;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
44 gint length;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
45 gboolean selected;
355
1c701dfe5098 [svn] Cache the decoder used for each PlaylistEntry. This reduces the amount
nenolod
parents: 0
diff changeset
46 InputPlugin *decoder;
0
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,
355
1c701dfe5098 [svn] Cache the decoder used for each PlaylistEntry. This reduces the amount
nenolod
parents: 0
diff changeset
52 const gchar * title, const gint len,
1c701dfe5098 [svn] Cache the decoder used for each PlaylistEntry. This reduces the amount
nenolod
parents: 0
diff changeset
53 InputPlugin * dec);
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
54 void playlist_entry_free(PlaylistEntry * entry);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
55
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
56 void playlist_init(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
57 void playlist_clear(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
58 void playlist_delete(gboolean crop);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
59
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
60 gboolean playlist_add(const gchar * filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
61 gboolean playlist_ins(const gchar * filename, gint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
62 guint playlist_add_dir(const gchar * dir);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
63 guint playlist_ins_dir(const gchar * dir, gint pos, gboolean background);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
64 guint playlist_add_url(const gchar * url);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
65 guint playlist_ins_url(const gchar * string, gint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
66
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
67 void playlist_play(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
68 void playlist_set_info(const gchar * title, gint length, gint rate,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
69 gint freq, gint nch);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
70 void playlist_check_pos_current(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
71 void playlist_next(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
72 void playlist_prev(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
73 void playlist_queue(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
74 void playlist_queue_position(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
75 void playlist_queue_remove(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
76 gint playlist_queue_get_length(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
77 gboolean playlist_is_position_queued(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
78 void playlist_clear_queue(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
79 gint playlist_get_queue_position(PlaylistEntry * entry);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
80 void playlist_eof_reached(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
81 void playlist_set_position(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
82 gint playlist_get_length(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
83 gint playlist_get_length_nolock(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
84 gint playlist_get_position(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
85 gint playlist_get_position_nolock(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
86 gchar *playlist_get_info_text(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
87 gint playlist_get_current_length(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
88
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
89 gboolean playlist_save(const gchar * filename, PlaylistFormat format);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
90 gboolean playlist_load(const gchar * filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
91
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
92 GList *playlist_get(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
93
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
94 void playlist_start_get_info_thread(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
95 void playlist_stop_get_info_thread();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
96 void playlist_start_get_info_scan(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
97
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
98 void playlist_sort(PlaylistSortType type);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
99 void playlist_sort_selected(PlaylistSortType type);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
100
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
101 void playlist_reverse(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
102 void playlist_random(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
103 void playlist_remove_dead_files(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
104
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
105 void playlist_fileinfo_current(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
106 void playlist_fileinfo(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
107
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
108 void playlist_delete_index(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
109 void playlist_delete_filenames(GList * filenames);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
110
398
f908bcd87c3d [svn] Generate cache content on demand if it was not previously there.
nenolod
parents: 356
diff changeset
111 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
112
99928e1275a1 [svn] This commit reduces the amount of times we probe a source down to ONE
nenolod
parents: 355
diff changeset
113 /* XXX this is for reverse compatibility --nenolod */
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
114 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
115
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
116 gchar *playlist_get_filename(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
117 gchar *playlist_get_songtitle(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
118 gint playlist_get_songtime(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
119
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
120 GList *playlist_get_selected(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
121 GList *playlist_get_selected_list(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
122 int playlist_get_num_selected(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
123
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
124 void playlist_get_total_time(gulong * total_time, gulong * selection_time,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
125 gboolean * total_more,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
126 gboolean * selection_more);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
127
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
128 void playlist_select_all(gboolean set);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
129 void playlist_select_range(gint min, gint max, gboolean sel);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
130 void playlist_select_invert_all(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
131 gboolean playlist_select_invert(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
132
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
133 gboolean playlist_read_info_selection(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
134 void playlist_read_info(guint pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
135
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
136 void playlist_set_shuffle(gboolean shuffle);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
137
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
138 void playlist_clear_selected(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
139
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
140 GList *get_playlist_nth(guint);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
141 gboolean playlist_set_current_name(const gchar * filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
142 const gchar *playlist_get_current_name(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
143 void playlist_new(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
144
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
145 PlaylistFormat playlist_format_get_from_name(const gchar * filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
146 gboolean is_playlist_name(const gchar * filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
147
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
148 #define PLAYLIST_LOCK() G_LOCK(playlist)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
149 #define PLAYLIST_UNLOCK() G_UNLOCK(playlist)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
150
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
151 G_LOCK_EXTERN(playlist);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
152
356
99928e1275a1 [svn] This commit reduces the amount of times we probe a source down to ONE
nenolod
parents: 355
diff changeset
153 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
154
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
155 #endif