57 lines
1.5 KiB
C
57 lines
1.5 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 clear any saved search text. */
|
|
void gui_filter_clear_search(struct playlist *);
|
|
|
|
/* 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 */
|