2014-02-17 15:32:47 -05:00
|
|
|
/*
|
|
|
|
* Copyright 2014 (c) Anna Schumaker.
|
|
|
|
*/
|
|
|
|
#ifndef OCARINA_TABS_H
|
|
|
|
#define OCARINA_TABS_H
|
|
|
|
|
2014-02-17 19:15:02 -05:00
|
|
|
#include <gtkmm.h>
|
2014-02-17 15:32:47 -05:00
|
|
|
#include <sstream>
|
|
|
|
|
2014-02-17 19:15:02 -05:00
|
|
|
struct FilterDesc {
|
|
|
|
/*
|
|
|
|
* Set these variables
|
|
|
|
*/
|
|
|
|
Glib::RefPtr<PlayqueueModel> model;
|
|
|
|
Gtk::SearchEntry *entry;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* These are configured automatically
|
|
|
|
*/
|
|
|
|
Glib::RefPtr<Gtk::TreeModelFilter> filter;
|
|
|
|
std::set<unsigned int> visible_ids;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct TabType {
|
2014-02-17 15:32:47 -05:00
|
|
|
void (*init_late)();
|
|
|
|
void (*cleanup)();
|
|
|
|
|
|
|
|
bool (*has_queue)(Playqueue *);
|
|
|
|
void (*track_added)(Playqueue *, unsigned int);
|
|
|
|
void (*track_deleted)(Playqueue *, unsigned int);
|
|
|
|
};
|
|
|
|
|
2014-02-17 19:15:02 -05:00
|
|
|
|
2014-02-17 15:32:47 -05:00
|
|
|
static inline std::string itoa(unsigned int i)
|
|
|
|
{
|
|
|
|
std::stringstream ss;
|
|
|
|
ss << i;
|
|
|
|
return ss.str();
|
|
|
|
}
|
|
|
|
|
2014-02-17 19:15:02 -05:00
|
|
|
|
|
|
|
/* collection.cpp */
|
2014-02-20 19:49:33 -05:00
|
|
|
void init_collection_tab();
|
2014-02-17 19:15:02 -05:00
|
|
|
|
|
|
|
/* history.cpp */
|
2014-02-20 19:49:33 -05:00
|
|
|
void init_history_tab();
|
2014-02-17 19:15:02 -05:00
|
|
|
|
|
|
|
/* playlist.cpp */
|
2014-02-20 19:49:33 -05:00
|
|
|
void init_playlist_tab();
|
2014-02-17 19:15:02 -05:00
|
|
|
|
|
|
|
/* tabs.cpp */
|
|
|
|
void init_filter(struct FilterDesc *);
|
2014-02-20 19:49:33 -05:00
|
|
|
void register_tab_type(struct TabType *);
|
2014-02-17 19:15:02 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2014-02-17 15:32:47 -05:00
|
|
|
#endif /* OCARINA_TABS_H */
|