Commit 89ce61ba authored by Luis de Bethencourt's avatar Luis de Bethencourt

ui: press '>' to play next uri in the list

parent 4932f2bb
......@@ -17,6 +17,8 @@ right - seek 10 seconds foward
9 - turn volume up
0 - turn volume down
> - play next
c - show/hide visual controls
v - toggle subtitles
......
......@@ -635,6 +635,9 @@ void
engine_open_uri (GstEngine * engine, gchar * uri)
{
/* Need to set back to Ready state so Playbin2 loads uri */
engine->uri = uri;
g_print ("Open uri: %s\n", next_uri);
gst_element_set_state (engine->player, GST_STATE_READY);
g_object_set (G_OBJECT (engine->player), "uri", uri, NULL);
......
......@@ -267,6 +267,13 @@ event_cb (ClutterStage * stage, ClutterEvent * event, UserInterface * ui)
break;
}
case CLUTTER_greater:
{
interface_play_next (ui);
break;
}
default:
{
handled = FALSE;
......@@ -1021,6 +1028,21 @@ interface_load_uri (UserInterface * ui, gchar * uri)
return TRUE;
}
void
interface_play_next (UserInterface * ui)
{
GList * next;
gchar * next_uri;
next = g_list_find (ui->uri_list, ui->engine->uri);
next = g_list_next (next);
next_uri = next->data;
engine_open_uri (ui->engine, next_uri);
interface_load_uri (ui, next_uri);
engine_play (ui->engine);
}
void
interface_start (UserInterface * ui, gchar * uri)
{
......
......@@ -92,6 +92,8 @@ struct _UserInterface
gchar *video_stream_toggle_png, *audio_stream_toggle_png;
gchar *duration_str;
GList *uri_list;
ClutterColor stage_color, control_color1, control_color2;
ClutterActor *stage;
......@@ -115,6 +117,7 @@ struct _UserInterface
// Declaration of non-static functions
void interface_init (UserInterface * ui);
gboolean interface_load_uri (UserInterface * ui, gchar * uri);
void interface_play_next (UserInterface * ui);
void interface_start (UserInterface * ui, gchar * uri);
gboolean interface_update_controls (UserInterface * ui);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment