ocarina/include/gui/filter.h
Anna Schumaker cdbf8b1736 core/playlist: Rename pl_private -> pl_search
And change its type to gchar **.  This lets the playlist code manage
setting and freeing search strings.  The UI is still responsible for
how this string is used.

This patch also  lets me remove the now-unused queue_deinit() function
and associated callback.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-05-13 08:45:04 -04:00

54 lines
1.4 KiB
C

/*
* Copyright 2016 (c) Anna Schumaker.
*/
#ifndef OCARINA_GUI_FILTER_H
#define OCARINA_GUI_FILTER_H
#include <core/playlist.h>
#include <gui/builder.h>
enum gui_filter_how {
GUI_FILTER_DEFAULT,
GUI_FILTER_ALBUM,
GUI_FILTER_ARTIST,
GUI_FILTER_GENRE,
GUI_FILTER_TITLE,
};
/* Called to initialize the filter model. */
void gui_filter_init();
/* Called to deinitialize the filter model. */
void gui_filter_deinit();
/* Called to set the current playlist. */
void gui_filter_set_playlist(struct playlist *);
/* Called to get the filter model. */
GtkTreeModelFilter *gui_filter_get();
/* Called to convert a filter model path into a track. */
struct track *gui_filter_path_get_track(GtkTreePath *);
/* Called to load the track at path. */
void gui_filter_path_load_track(GtkTreePath *);
/* Called to convert a filter model path into a queue index. */
unsigned int gui_filter_path_get_index(GtkTreePath *);
/* Called to convert a playlist iterator index into a path. */
GtkTreePath *gui_filter_path_from_index(unsigned int);
/* Called to access the filter search-entry. */
static inline GtkSearchEntry *gui_filter_search(void)
{
return GTK_SEARCH_ENTRY(gui_builder_widget("filter_search"));
}
/* Called to access the filter-how chooser. */
static inline GtkComboBox *gui_filter_how(void)
{
return GTK_COMBO_BOX(gui_builder_widget("filter_how"));
}
#endif /* OCARINA_GUI_FILTER_H */