2014-02-17 15:32:47 -05:00
|
|
|
/*
|
|
|
|
* Copyright 2014 (c) Anna Schumaker.
|
|
|
|
*/
|
|
|
|
#ifndef OCARINA_TABS_H
|
|
|
|
#define OCARINA_TABS_H
|
|
|
|
|
2014-06-04 13:59:15 -04:00
|
|
|
#include <gui/ocarina.h>
|
2015-04-08 16:49:58 -04:00
|
|
|
#include <gui/queue/model.h>
|
2015-04-19 09:36:31 -04:00
|
|
|
#include <gui/queue/toolbar.h>
|
2015-04-19 09:52:27 -04:00
|
|
|
#include <gui/queue/window.h>
|
2015-12-10 13:26:22 -05:00
|
|
|
#include <core/playlist.h>
|
2014-06-05 10:19:22 -04:00
|
|
|
#include <core/queue.h>
|
2014-02-17 19:15:02 -05:00
|
|
|
|
2015-11-29 20:10:15 -05:00
|
|
|
class Tab {
|
2014-02-21 22:06:42 -05:00
|
|
|
private:
|
2014-02-28 19:25:35 -05:00
|
|
|
unsigned int tab_sorting_count;
|
|
|
|
std::string tab_sorting_title;
|
2014-02-17 19:15:02 -05:00
|
|
|
|
2014-02-21 22:06:42 -05:00
|
|
|
protected:
|
2015-04-19 09:24:25 -04:00
|
|
|
Glib::RefPtr<Gtk::Builder> tab_builder;
|
2015-11-16 09:12:15 -05:00
|
|
|
queue *tab_pq;
|
2015-04-19 09:14:57 -04:00
|
|
|
Gtk::VBox tab_vbox;
|
2014-02-17 15:32:47 -05:00
|
|
|
|
2015-04-19 09:36:31 -04:00
|
|
|
QueueToolbar *tab_toolbar;
|
2015-04-19 09:52:27 -04:00
|
|
|
QueueWindow *tab_window;
|
2015-04-19 12:13:32 -04:00
|
|
|
QueueLabel *tab_label;
|
2014-02-17 15:32:47 -05:00
|
|
|
|
2014-02-21 22:06:42 -05:00
|
|
|
/**
|
|
|
|
* Class helper functions
|
|
|
|
*/
|
2014-02-28 19:25:35 -05:00
|
|
|
void tab_dec_sort_count();
|
2014-02-21 22:06:42 -05:00
|
|
|
void tab_unmap();
|
2014-02-17 19:15:02 -05:00
|
|
|
|
2014-02-21 22:06:42 -05:00
|
|
|
public:
|
2015-11-16 09:12:15 -05:00
|
|
|
Tab(queue *);
|
2014-02-21 22:06:42 -05:00
|
|
|
virtual ~Tab();
|
2014-02-23 13:04:31 -05:00
|
|
|
|
2015-04-03 12:02:49 -04:00
|
|
|
/**
|
|
|
|
* QNotifier implementation
|
|
|
|
*/
|
|
|
|
void on_track_added(unsigned int);
|
2015-04-09 09:09:33 -04:00
|
|
|
virtual void on_track_removed(unsigned int);
|
2016-01-29 10:12:09 -05:00
|
|
|
void on_tracks_cleared(unsigned int);
|
2015-04-03 20:58:26 -04:00
|
|
|
void on_track_updated(unsigned int);
|
2015-04-03 12:02:49 -04:00
|
|
|
|
2014-02-23 13:04:31 -05:00
|
|
|
/**
|
|
|
|
* More helper functions
|
|
|
|
*/
|
2014-02-23 15:27:19 -05:00
|
|
|
int tab_page_num();
|
2014-03-01 19:33:41 -05:00
|
|
|
bool tab_is_cur();
|
2014-02-23 13:04:31 -05:00
|
|
|
void tab_runtime_changed();
|
2014-02-28 19:25:35 -05:00
|
|
|
void tab_display_sorting();
|
2014-02-23 15:27:19 -05:00
|
|
|
void tab_focus_search();
|
2014-02-28 20:01:30 -05:00
|
|
|
void tab_selected_ids(std::vector<unsigned int> &);
|
2015-11-16 09:12:15 -05:00
|
|
|
void tab_queue_add(queue *);
|
2014-02-23 17:04:39 -05:00
|
|
|
bool tab_queue_selected(bool);
|
2014-02-28 16:31:36 -05:00
|
|
|
bool tab_add_to_queue(unsigned int);
|
2015-12-10 13:26:22 -05:00
|
|
|
bool tab_add_to_playlist(enum playlist_t);
|
2014-02-28 20:39:07 -05:00
|
|
|
bool tab_favorite_selected();
|
2014-03-01 19:33:41 -05:00
|
|
|
void tab_ban_selected();
|
2014-02-17 19:15:02 -05:00
|
|
|
|
2014-02-21 22:06:42 -05:00
|
|
|
/**
|
2014-02-23 17:04:39 -05:00
|
|
|
* internal callback functions that can be overridden if necessary
|
2014-02-21 22:06:42 -05:00
|
|
|
*/
|
2014-02-23 17:04:39 -05:00
|
|
|
virtual bool on_key_press_event(const std::string &);
|
2014-03-01 19:33:41 -05:00
|
|
|
virtual void on_show_rc_menu();
|
2014-02-17 19:15:02 -05:00
|
|
|
|
2014-02-21 22:06:42 -05:00
|
|
|
/**
|
|
|
|
* GTK-MM callback functions
|
|
|
|
*/
|
2014-02-23 20:34:52 -05:00
|
|
|
void on_repeat_toggled();
|
2014-03-01 19:33:41 -05:00
|
|
|
bool on_key_pressed(GdkEventKey *);
|
|
|
|
void on_column_clicked(unsigned int);
|
|
|
|
bool on_button_pressed(GdkEventButton *);
|
2014-02-21 22:06:42 -05:00
|
|
|
};
|
2014-02-17 19:15:02 -05:00
|
|
|
|
|
|
|
|
2015-11-16 09:12:15 -05:00
|
|
|
Tab *find_tab(queue *);
|
2014-02-23 15:27:19 -05:00
|
|
|
void tab_focus_search();
|
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();
|
2014-02-23 17:04:39 -05:00
|
|
|
void init_queue_tabs();
|
2014-02-21 22:06:42 -05:00
|
|
|
|
2014-02-17 15:32:47 -05:00
|
|
|
#endif /* OCARINA_TABS_H */
|