0
|
1 /* XMMS - Cross-platform multimedia player
|
|
2 * Copyright (C) 1998-2003 Peter Alm, Mikael Alm, Olle Hallnas,
|
|
3 * Thomas Nilsson and 4Front Technologies
|
|
4 * Copyright (C) 1999-2003 Haavard Kvaalen
|
|
5 *
|
|
6 * This program is free software; you can redistribute it and/or modify
|
|
7 * it under the terms of the GNU General Public License as published by
|
|
8 * the Free Software Foundation; either version 2 of the License, or
|
|
9 * (at your option) any later version.
|
|
10 *
|
|
11 * This program is distributed in the hope that it will be useful,
|
|
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14 * GNU General Public License for more details.
|
|
15 *
|
|
16 * You should have received a copy of the GNU General Public License
|
|
17 * along with this program; if not, write to the Free Software
|
|
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
19 */
|
|
20 #ifndef PLAYLIST_H
|
|
21 #define PLAYLIST_H
|
|
22
|
|
23 #include <glib.h>
|
|
24
|
|
25
|
|
26 typedef enum {
|
|
27 PLAYLIST_SORT_PATH,
|
|
28 PLAYLIST_SORT_FILENAME,
|
|
29 PLAYLIST_SORT_TITLE,
|
|
30 PLAYLIST_SORT_DATE
|
|
31 } PlaylistSortType;
|
|
32
|
|
33 typedef enum {
|
|
34 PLAYLIST_FORMAT_UNKNOWN = -1,
|
|
35 PLAYLIST_FORMAT_M3U,
|
|
36 PLAYLIST_FORMAT_PLS,
|
|
37 PLAYLIST_FORMAT_COUNT
|
|
38 } PlaylistFormat;
|
|
39
|
|
40
|
|
41 #define PLAYLIST_ENTRY(x) ((PlaylistEntry*)(x))
|
|
42 struct _PlaylistEntry {
|
|
43 gchar *filename;
|
|
44 gchar *title;
|
|
45 gint length;
|
|
46 gboolean selected;
|
|
47 };
|
|
48
|
|
49 typedef struct _PlaylistEntry PlaylistEntry;
|
|
50
|
|
51 PlaylistEntry *playlist_entry_new(const gchar * filename,
|
|
52 const gchar * title, const gint len);
|
|
53 void playlist_entry_free(PlaylistEntry * entry);
|
|
54
|
|
55 void playlist_init(void);
|
|
56 void playlist_clear(void);
|
|
57 void playlist_delete(gboolean crop);
|
|
58
|
|
59 gboolean playlist_add(const gchar * filename);
|
|
60 gboolean playlist_ins(const gchar * filename, gint pos);
|
|
61 guint playlist_add_dir(const gchar * dir);
|
|
62 guint playlist_ins_dir(const gchar * dir, gint pos, gboolean background);
|
|
63 guint playlist_add_url(const gchar * url);
|
|
64 guint playlist_ins_url(const gchar * string, gint pos);
|
|
65
|
|
66 void playlist_play(void);
|
|
67 void playlist_set_info(const gchar * title, gint length, gint rate,
|
|
68 gint freq, gint nch);
|
|
69 void playlist_check_pos_current(void);
|
|
70 void playlist_next(void);
|
|
71 void playlist_prev(void);
|
|
72 void playlist_queue(void);
|
|
73 void playlist_queue_position(guint pos);
|
|
74 void playlist_queue_remove(guint pos);
|
|
75 gint playlist_queue_get_length(void);
|
|
76 gboolean playlist_is_position_queued(guint pos);
|
|
77 void playlist_clear_queue(void);
|
|
78 gint playlist_get_queue_position(PlaylistEntry * entry);
|
|
79 void playlist_eof_reached(void);
|
|
80 void playlist_set_position(guint pos);
|
|
81 gint playlist_get_length(void);
|
|
82 gint playlist_get_length_nolock(void);
|
|
83 gint playlist_get_position(void);
|
|
84 gint playlist_get_position_nolock(void);
|
|
85 gchar *playlist_get_info_text(void);
|
|
86 gint playlist_get_current_length(void);
|
|
87
|
|
88 gboolean playlist_save(const gchar * filename, PlaylistFormat format);
|
|
89 gboolean playlist_load(const gchar * filename);
|
|
90
|
|
91 GList *playlist_get(void);
|
|
92
|
|
93 void playlist_start_get_info_thread(void);
|
|
94 void playlist_stop_get_info_thread();
|
|
95 void playlist_start_get_info_scan(void);
|
|
96
|
|
97 void playlist_sort(PlaylistSortType type);
|
|
98 void playlist_sort_selected(PlaylistSortType type);
|
|
99
|
|
100 void playlist_reverse(void);
|
|
101 void playlist_random(void);
|
|
102 void playlist_remove_dead_files(void);
|
|
103
|
|
104 void playlist_fileinfo_current(void);
|
|
105 void playlist_fileinfo(guint pos);
|
|
106
|
|
107 void playlist_delete_index(guint pos);
|
|
108 void playlist_delete_filenames(GList * filenames);
|
|
109
|
|
110 const gchar *playlist_get_filename_to_play();
|
|
111 gchar *playlist_get_filename(guint pos);
|
|
112 gchar *playlist_get_songtitle(guint pos);
|
|
113 gint playlist_get_songtime(guint pos);
|
|
114
|
|
115 GList *playlist_get_selected(void);
|
|
116 GList *playlist_get_selected_list(void);
|
|
117 int playlist_get_num_selected(void);
|
|
118
|
|
119 void playlist_get_total_time(gulong * total_time, gulong * selection_time,
|
|
120 gboolean * total_more,
|
|
121 gboolean * selection_more);
|
|
122
|
|
123 void playlist_select_all(gboolean set);
|
|
124 void playlist_select_range(gint min, gint max, gboolean sel);
|
|
125 void playlist_select_invert_all(void);
|
|
126 gboolean playlist_select_invert(guint pos);
|
|
127
|
|
128 gboolean playlist_read_info_selection(void);
|
|
129 void playlist_read_info(guint pos);
|
|
130
|
|
131 void playlist_set_shuffle(gboolean shuffle);
|
|
132
|
|
133 void playlist_clear_selected(void);
|
|
134
|
|
135 GList *get_playlist_nth(guint);
|
|
136 gboolean playlist_set_current_name(const gchar * filename);
|
|
137 const gchar *playlist_get_current_name(void);
|
|
138 void playlist_new(void);
|
|
139
|
|
140 PlaylistFormat playlist_format_get_from_name(const gchar * filename);
|
|
141 gboolean is_playlist_name(const gchar * filename);
|
|
142
|
|
143 #define PLAYLIST_LOCK() G_LOCK(playlist)
|
|
144 #define PLAYLIST_UNLOCK() G_UNLOCK(playlist)
|
|
145
|
|
146 G_LOCK_EXTERN(playlist);
|
|
147
|
|
148 #endif
|