Ocarina: Seek using progress bar

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
Bryan Schumaker 2012-03-22 20:59:53 -04:00
parent 595806ec0f
commit 0061e0bec6
1 changed files with 7 additions and 0 deletions

View File

@ -43,6 +43,11 @@ static void update_progress()
gtk_range_set_value(GTK_RANGE(track_progress), pos);
}
static void slider_changed(GtkWidget *w, GtkScrollType s, gdouble v, gpointer d)
{
libsaria::audio::seek_to(v);
}
static void on_click_play(GtkWidget *b, GdkEvent *e, gpointer d)
{
libsaria::audio::play();
@ -62,6 +67,8 @@ static GtkWidget *make_controls()
pos_label = gtk_label_new("");
track_progress = gtk_hscale_new_with_range(0, 1, 1000000000);
g_signal_connect(track_progress, "change-value",
G_CALLBACK(slider_changed), NULL);
dur_label = gtk_label_new("");
gtk_scale_set_draw_value(GTK_SCALE(track_progress), FALSE);