2014-02-17 15:32:47 -05:00
|
|
|
/*
|
|
|
|
* Copyright 2014 (c) Anna Schumaker.
|
|
|
|
*/
|
|
|
|
#ifndef OCARINA_TABS_H
|
|
|
|
#define OCARINA_TABS_H
|
|
|
|
|
2014-02-21 22:06:42 -05:00
|
|
|
#include <ocarina.h>
|
|
|
|
#include <playqueue.h>
|
2014-02-17 15:32:47 -05:00
|
|
|
|
2014-02-17 19:15:02 -05:00
|
|
|
|
2014-02-21 22:06:42 -05:00
|
|
|
class Tab {
|
|
|
|
private:
|
2014-02-17 19:15:02 -05:00
|
|
|
std::set<unsigned int> visible_ids;
|
2014-02-21 22:06:42 -05:00
|
|
|
Glib::RefPtr<Gtk::TreeModelFilter> tab_filter;
|
2014-02-17 19:15:02 -05:00
|
|
|
|
2014-02-21 22:06:42 -05:00
|
|
|
protected:
|
|
|
|
Playqueue *tab_pq;
|
|
|
|
Glib::RefPtr<PlayqueueModel> tab_model;
|
2014-02-17 19:15:02 -05:00
|
|
|
|
2014-02-17 15:32:47 -05:00
|
|
|
|
2014-02-21 22:06:42 -05:00
|
|
|
/**
|
|
|
|
* Widgets that MUST be set by a child class
|
|
|
|
*/
|
|
|
|
Gtk::SearchEntry *tab_search;
|
|
|
|
Gtk::TreeView *tab_treeview;
|
2014-02-23 13:04:31 -05:00
|
|
|
Gtk::Widget *tab_widget;
|
2014-02-17 15:32:47 -05:00
|
|
|
|
2014-02-21 22:06:42 -05:00
|
|
|
/**
|
|
|
|
* Optional widgets that MAY be set
|
|
|
|
*/
|
|
|
|
Gtk::ToggleButton *tab_random;
|
|
|
|
Gtk::Label *tab_size;
|
2014-02-17 19:15:02 -05:00
|
|
|
|
2014-02-17 15:32:47 -05:00
|
|
|
|
2014-02-21 22:06:42 -05:00
|
|
|
/**
|
|
|
|
* Class helper functions
|
|
|
|
*/
|
|
|
|
void tab_init_random();
|
2014-02-23 13:04:31 -05:00
|
|
|
bool tab_is_cur();
|
2014-02-21 22:06:42 -05:00
|
|
|
void tab_set_size();
|
|
|
|
void tab_unmap();
|
2014-02-17 19:15:02 -05:00
|
|
|
|
2014-02-21 22:06:42 -05:00
|
|
|
public:
|
|
|
|
Tab(Playqueue *);
|
|
|
|
virtual ~Tab();
|
2014-02-23 13:04:31 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* More helper functions
|
|
|
|
*/
|
2014-02-21 22:06:42 -05:00
|
|
|
void tab_finish_init();
|
2014-02-23 13:04:31 -05:00
|
|
|
int tab_page_num();
|
|
|
|
void tab_runtime_changed();
|
2014-02-17 19:15:02 -05:00
|
|
|
|
2014-02-21 22:06:42 -05:00
|
|
|
/**
|
|
|
|
* internal callback functions
|
|
|
|
*/
|
|
|
|
virtual void on_post_init();
|
|
|
|
virtual void on_track_added(unsigned int);
|
|
|
|
virtual void on_track_deleted(unsigned int);
|
2014-02-17 19:15:02 -05:00
|
|
|
|
2014-02-21 22:06:42 -05:00
|
|
|
/**
|
|
|
|
* GTK-MM callback functions
|
|
|
|
*/
|
|
|
|
void on_random_toggled();
|
2014-02-23 13:21:39 -05:00
|
|
|
void on_row_activated(const Gtk::TreePath &, Gtk::TreeViewColumn *);
|
2014-02-21 22:06:42 -05:00
|
|
|
|
|
|
|
/* Filtering functions */
|
|
|
|
bool on_filter_visible(const Gtk::TreeIter &);
|
|
|
|
bool on_entry_key_released(GdkEventKey *);
|
|
|
|
void on_entry_changed();
|
|
|
|
};
|
2014-02-17 19:15:02 -05:00
|
|
|
|
|
|
|
|
2014-02-21 22:06:42 -05:00
|
|
|
void init_tabs();
|
|
|
|
void post_init_tabs();
|
|
|
|
void cleanup_tabs();
|
2014-02-17 19:15:02 -05:00
|
|
|
|
|
|
|
|
2014-02-21 22:06:42 -05:00
|
|
|
void init_collection_tab();
|
|
|
|
void init_history_tab();
|
|
|
|
void init_playlist_tab();
|
|
|
|
|
2014-02-17 15:32:47 -05:00
|
|
|
#endif /* OCARINA_TABS_H */
|