ocarina: Add a next() button

Users press this button to choose the next song.
This commit is contained in:
Bryan Schumaker 2011-11-06 19:18:03 -05:00
parent e908f46c21
commit fffb9875ac
3 changed files with 15 additions and 0 deletions

View File

@ -21,6 +21,7 @@ GtkWidget *make_pause_button();
GtkWidget *make_stop_button();
GtkWidget *make_rewind_button();
GtkWidget *make_forward_button();
GtkWidget *make_next_button();
GtkWidget *make_open_button();
GtkWidget *make_volume_button();

View File

@ -3,6 +3,7 @@
using namespace std;
#include <ocarina/button.h>
#include <libsaria/controls.h>
#include <libsaria/audio.h>
static list<GtkWidget *> play_buttons;
@ -97,3 +98,15 @@ GtkWidget *make_forward_button()
on_click_forward,
true);
}
static void on_click_next(GtkWidget *b, GdkEvent *e, gpointer d)
{
libsaria::next();
}
GtkWidget *make_next_button()
{
return make_button(GTK_STOCK_MEDIA_NEXT,
on_click_next,
true);
}

View File

@ -11,6 +11,7 @@ static GtkWidget *make_buttons()
gtk_widget_show(buttons);
box_pack_end(buttons, make_volume_button(), FALSE, FALSE, 0);
box_pack_end(buttons, make_next_button(), FALSE, FALSE, 0);
box_pack_end(buttons, make_stop_button(), FALSE, FALSE, 0);
box_pack_end(buttons, make_pause_button(), FALSE, FALSE, 0);
box_pack_end(buttons, make_play_button(), FALSE, FALSE, 0);