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:
parent
c1332133a9
commit
913b9f8630
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue