Code

screen_search: revert label to "Filename"
[ncmpc.git] / src / filelist.h
index 3ad6cc2acbe72305d791a7b7121d3e819f9a6c30..a54e2aef993e5e0db8b180d3c356650041b81030 100644 (file)
 
 #include <glib.h>
 
+struct mpd_connection;
 struct mpd_song;
 
-typedef struct filelist_entry {
+struct filelist_entry {
        guint flags;
-       struct mpd_InfoEntity *entity;
-} filelist_entry_t;
-
-typedef struct filelist {
-       /* path */
-       gchar *path;
+       struct mpd_entity *entity;
+};
 
+struct filelist {
        /* the list */
        GPtrArray *entries;
-} mpdclient_filelist_t;
+};
 
 struct filelist *
-filelist_new(const char *path);
+filelist_new(void);
 
 void
 filelist_free(struct filelist *filelist);
@@ -62,14 +60,15 @@ filelist_get(const struct filelist *filelist, guint i)
 }
 
 struct filelist_entry *
-filelist_append(struct filelist *filelist, struct mpd_InfoEntity *entity);
-
-struct filelist_entry *
-filelist_prepend(struct filelist *filelist, struct mpd_InfoEntity *entity);
+filelist_append(struct filelist *filelist, struct mpd_entity *entity);
 
 void
 filelist_move(struct filelist *filelist, struct filelist *from);
 
+gint
+compare_filelist_entry_path(gconstpointer filelist_entry1,
+                           gconstpointer filelist_entry2);
+
 /* Sorts the whole filelist, at the moment used by filelist_search */
 void
 filelist_sort_all(struct filelist *filelist, GCompareFunc compare_func);
@@ -79,10 +78,31 @@ filelist_sort_all(struct filelist *filelist, GCompareFunc compare_func);
 void
 filelist_sort_dir_play(struct filelist *filelist, GCompareFunc compare_func);
 
+/**
+ * Eliminates duplicate songs from the filelist.
+ */
+void
+filelist_no_duplicates(struct filelist *filelist);
+
 int
 filelist_find_song(struct filelist *flist, const struct mpd_song *song);
 
 int
 filelist_find_directory(struct filelist *filelist, const char *name);
 
+/**
+ * Receives entities from the connection, and appends them to the
+ * specified filelist.  This does not finish the response, and does
+ * not check for errors.
+ */
+void
+filelist_recv(struct filelist *filelist, struct mpd_connection *connection);
+
+/**
+ * Creates a new filelist and receives entities from the connection.
+ * This does not finish the response, and does not check for errors.
+ */
+struct filelist *
+filelist_new_recv(struct mpd_connection *connection);
+
 #endif