summaryrefslogtreecommitdiffstats
path: root/common/playlist.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/playlist.h')
-rw-r--r--common/playlist.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/common/playlist.h b/common/playlist.h
index bbf6821428..d0f17e315f 100644
--- a/common/playlist.h
+++ b/common/playlist.h
@@ -26,8 +26,9 @@ struct playlist_param {
};
struct playlist_entry {
- struct playlist_entry *prev, *next;
+ // Invariant: (pl && pl->entries[pl_index] == this) || (!pl && pl_index < 0)
struct playlist *pl;
+ int pl_index;
char *filename;
@@ -59,7 +60,8 @@ struct playlist_entry {
};
struct playlist {
- struct playlist_entry *first, *last;
+ struct playlist_entry **entries;
+ int num_entries;
// This provides some sort of stable iterator. If this entry is removed from
// the playlist, current is set to the next element (or NULL), and
@@ -75,20 +77,24 @@ void playlist_entry_add_params(struct playlist_entry *e,
struct playlist_entry *playlist_entry_new(const char *filename);
-void playlist_insert(struct playlist *pl, struct playlist_entry *after,
- struct playlist_entry *add);
void playlist_add(struct playlist *pl, struct playlist_entry *add);
void playlist_remove(struct playlist *pl, struct playlist_entry *entry);
void playlist_clear(struct playlist *pl);
+void playlist_clear_except_current(struct playlist *pl);
void playlist_move(struct playlist *pl, struct playlist_entry *entry,
struct playlist_entry *at);
void playlist_add_file(struct playlist *pl, const char *filename);
void playlist_shuffle(struct playlist *pl);
+struct playlist_entry *playlist_get_first(struct playlist *pl);
+struct playlist_entry *playlist_get_last(struct playlist *pl);
struct playlist_entry *playlist_get_next(struct playlist *pl, int direction);
+struct playlist_entry *playlist_entry_get_rel(struct playlist_entry *e,
+ int direction);
void playlist_add_base_path(struct playlist *pl, bstr base_path);
void playlist_add_redirect(struct playlist *pl, const char *redirected_from);
+void playlist_set_stream_flags(struct playlist *pl, int flags);
void playlist_transfer_entries(struct playlist *pl, struct playlist *source_pl);
void playlist_append_entries(struct playlist *pl, struct playlist *source_pl);