ocarina: Seek to different parts of the song by clicking

Button 1 seeks by 10 seconds either forward or backward, button 2 seeks
to an absolute position.  I initally wanted to switch the behavior of
these two buttons, but for now I'll just have to get used to the GTK
defaults.
This commit is contained in:
Bryan Schumaker 2011-11-06 20:26:11 -05:00
parent c1332133a9
commit 913b9f8630
1 changed files with 8 additions and 1 deletions

View File

@ -17,11 +17,18 @@ static gboolean update_progress(gpointer data)
return TRUE;
}
static void slider_changed(GtkWidget *slider, GtkScrollType scroll,
gdouble value, gpointer data)
{
libsaria::audio::seek_to(value);
}
static void make_scale()
{
progress = gtk_hscale_new_with_range(0, 1, 1);
progress = gtk_hscale_new_with_range(0, 1, 1000000000);
gtk_scale_set_draw_value(GTK_SCALE(progress), FALSE);
gtk_timeout_add(100, update_progress, NULL);
GTK_CONNECT(progress, "change-value", slider_changed, NULL);
}
static void make_progress()