gui: Respond to playqueue changed callbacks
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
This commit is contained in:
parent
42d57567e0
commit
a0067c4542
16
gui/tabs.cpp
16
gui/tabs.cpp
|
@ -1,6 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2014 (c) Anna Schumaker.
|
* Copyright 2014 (c) Anna Schumaker.
|
||||||
*/
|
*/
|
||||||
|
#include <callback.h>
|
||||||
#include <deck.h>
|
#include <deck.h>
|
||||||
#include <ocarina.h>
|
#include <ocarina.h>
|
||||||
#include <playqueue.h>
|
#include <playqueue.h>
|
||||||
|
@ -26,11 +27,10 @@ private:
|
||||||
|
|
||||||
Gtk::VBox tab_page;
|
Gtk::VBox tab_page;
|
||||||
|
|
||||||
void set_tab_size();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
OcarinaTab(const std::string &, Playqueue *);
|
OcarinaTab(const std::string &, Playqueue *);
|
||||||
~OcarinaTab();
|
~OcarinaTab();
|
||||||
|
void set_tab_size();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -74,9 +74,21 @@ void OcarinaTab::set_tab_size()
|
||||||
/*
|
/*
|
||||||
* Do stuff with tabs
|
* Do stuff with tabs
|
||||||
*/
|
*/
|
||||||
|
static void on_track_added(Playqueue *pq)
|
||||||
|
{
|
||||||
|
tab_map[pq]->set_tab_size();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void on_track_deleted(Playqueue *pq)
|
||||||
|
{
|
||||||
|
tab_map[pq]->set_tab_size();
|
||||||
|
}
|
||||||
|
|
||||||
void init_tabs()
|
void init_tabs()
|
||||||
{
|
{
|
||||||
new OcarinaTab("Library", deck::get_library_pq());
|
new OcarinaTab("Library", deck::get_library_pq());
|
||||||
|
get_callbacks()->on_queue_track_add = on_track_added;
|
||||||
|
get_callbacks()->on_queue_track_del = on_track_deleted;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cleanup_tabs()
|
void cleanup_tabs()
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2013 (c) Anna Schumaker.
|
* Copyright 2013 (c) Anna Schumaker.
|
||||||
*/
|
*/
|
||||||
|
#include <deck.h>
|
||||||
#include <idle.h>
|
#include <idle.h>
|
||||||
#include <ocarina.h>
|
#include <ocarina.h>
|
||||||
#include <print.h>
|
#include <print.h>
|
||||||
|
@ -117,6 +118,8 @@ int main(int argc, char **argv)
|
||||||
Gtk::Window *window;
|
Gtk::Window *window;
|
||||||
|
|
||||||
Gtk::Main ocarina(argc, argv);
|
Gtk::Main ocarina(argc, argv);
|
||||||
|
|
||||||
|
deck :: init();
|
||||||
window = connect_wires();
|
window = connect_wires();
|
||||||
|
|
||||||
schedule_test(test_0);
|
schedule_test(test_0);
|
||||||
|
|
Loading…
Reference in New Issue