ocarina: Add a next() button
Users press this button to choose the next song.
This commit is contained in:
parent
e908f46c21
commit
fffb9875ac
|
@ -21,6 +21,7 @@ GtkWidget *make_pause_button();
|
||||||
GtkWidget *make_stop_button();
|
GtkWidget *make_stop_button();
|
||||||
GtkWidget *make_rewind_button();
|
GtkWidget *make_rewind_button();
|
||||||
GtkWidget *make_forward_button();
|
GtkWidget *make_forward_button();
|
||||||
|
GtkWidget *make_next_button();
|
||||||
|
|
||||||
GtkWidget *make_open_button();
|
GtkWidget *make_open_button();
|
||||||
GtkWidget *make_volume_button();
|
GtkWidget *make_volume_button();
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#include <ocarina/button.h>
|
#include <ocarina/button.h>
|
||||||
|
#include <libsaria/controls.h>
|
||||||
#include <libsaria/audio.h>
|
#include <libsaria/audio.h>
|
||||||
|
|
||||||
static list<GtkWidget *> play_buttons;
|
static list<GtkWidget *> play_buttons;
|
||||||
|
@ -97,3 +98,15 @@ GtkWidget *make_forward_button()
|
||||||
on_click_forward,
|
on_click_forward,
|
||||||
true);
|
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);
|
||||||
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ static GtkWidget *make_buttons()
|
||||||
gtk_widget_show(buttons);
|
gtk_widget_show(buttons);
|
||||||
|
|
||||||
box_pack_end(buttons, make_volume_button(), FALSE, FALSE, 0);
|
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_stop_button(), FALSE, FALSE, 0);
|
||||||
box_pack_end(buttons, make_pause_button(), FALSE, FALSE, 0);
|
box_pack_end(buttons, make_pause_button(), FALSE, FALSE, 0);
|
||||||
box_pack_end(buttons, make_play_button(), FALSE, FALSE, 0);
|
box_pack_end(buttons, make_play_button(), FALSE, FALSE, 0);
|
||||||
|
|
Loading…
Reference in New Issue