50 lines
1.2 KiB
C++
50 lines
1.2 KiB
C++
|
|
#include <ocarina/footer.h>
|
|
#include <ocarina/button.h>
|
|
|
|
static GtkWidget *footer = NULL;
|
|
|
|
static void add_controls()
|
|
{
|
|
GtkWidget *controls = gtk_hbox_new(FALSE, 0);
|
|
gtk_widget_show(controls);
|
|
|
|
box_pack_end(controls, make_volume_button(), FALSE, FALSE, 0);
|
|
box_pack_end(controls, make_stop_button(), FALSE, FALSE, 0);
|
|
box_pack_end(controls, make_pause_button(), FALSE, FALSE, 0);
|
|
box_pack_end(controls, make_play_button(), FALSE, FALSE, 0);
|
|
box_pack_end(controls, make_forward_button(), FALSE, FALSE, 0);
|
|
box_pack_end(controls, make_rewind_button(), FALSE, FALSE, 0);
|
|
box_pack_end(controls, make_open_button(), FALSE, FALSE, 0);
|
|
|
|
box_pack_start(footer, controls, FALSE, FALSE, 0);
|
|
}
|
|
|
|
static void make_footer()
|
|
{
|
|
GtkWidget *sep = gtk_hseparator_new();
|
|
footer = gtk_vbox_new(FALSE, 0);
|
|
box_pack_start(footer, sep, FALSE, FALSE, 0);
|
|
|
|
/*
|
|
* The pause button begins life hidden, so show everything up until
|
|
* this point, and then add the controls
|
|
*/
|
|
gtk_widget_show_all(footer);
|
|
add_controls();
|
|
}
|
|
|
|
GtkWidget *get_footer()
|
|
{
|
|
if (footer == NULL)
|
|
make_footer();
|
|
g_object_ref(footer);
|
|
return footer;
|
|
}
|
|
|
|
void put_footer()
|
|
{
|
|
if (footer != NULL)
|
|
g_object_unref(footer);
|
|
}
|