2016-08-21 10:27:52 -04:00
|
|
|
/*
|
|
|
|
* Copyright 2016 (c) Anna Schumaker.
|
|
|
|
*/
|
|
|
|
#ifndef OCARINA_GUI_FILTER_H
|
|
|
|
#define OCARINA_GUI_FILTER_H
|
2016-08-22 10:15:09 -04:00
|
|
|
#include <core/playlist.h>
|
2016-08-21 10:27:52 -04:00
|
|
|
#include <gui/builder.h>
|
|
|
|
|
2016-08-22 09:12:13 -04:00
|
|
|
enum gui_filter_how {
|
|
|
|
GUI_FILTER_DEFAULT,
|
|
|
|
GUI_FILTER_ALBUM,
|
|
|
|
GUI_FILTER_ARTIST,
|
|
|
|
GUI_FILTER_GENRE,
|
|
|
|
GUI_FILTER_TITLE,
|
|
|
|
};
|
|
|
|
|
2016-08-21 10:27:52 -04:00
|
|
|
/* Called to initialize the filter model. */
|
|
|
|
void gui_filter_init();
|
|
|
|
|
|
|
|
/* Called to deinitialize the filter model. */
|
|
|
|
void gui_filter_deinit();
|
|
|
|
|
2016-08-22 10:15:09 -04:00
|
|
|
/* 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 *);
|
|
|
|
|
2016-08-21 10:27:52 -04:00
|
|
|
/* Called to get the filter model. */
|
|
|
|
GtkTreeModelFilter *gui_filter_get();
|
|
|
|
|
2016-08-21 12:49:07 -04:00
|
|
|
/* Called to convert a filter model path into a track. */
|
|
|
|
struct track *gui_filter_path_get_track(GtkTreePath *);
|
|
|
|
|
2016-08-24 09:06:04 -04:00
|
|
|
/* Called to load the track at path. */
|
|
|
|
void gui_filter_path_load_track(GtkTreePath *);
|
|
|
|
|
2016-08-22 07:32:18 -04:00
|
|
|
/* Called to convert a filter model path into a queue index. */
|
|
|
|
unsigned int gui_filter_path_get_index(GtkTreePath *);
|
|
|
|
|
2016-08-24 08:02:59 -04:00
|
|
|
/* Called to convert a playlist iterator index into a path. */
|
|
|
|
GtkTreePath *gui_filter_path_from_index(unsigned int);
|
|
|
|
|
2016-08-22 07:51:40 -04:00
|
|
|
/* 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"));
|
|
|
|
}
|
|
|
|
|
2016-08-21 10:27:52 -04:00
|
|
|
#endif /* OCARINA_GUI_FILTER_H */
|