Commit 900aeb5f authored by Luis de Bethencourt's avatar Luis de Bethencourt

ui: press '<' to play previous uri in the list

parent a16ce014
...@@ -17,6 +17,7 @@ right - seek 10 seconds foward ...@@ -17,6 +17,7 @@ right - seek 10 seconds foward
9 - turn volume up 9 - turn volume up
0 - turn volume down 0 - turn volume down
< - play previous
> - play next > - play next
c - show/hide visual controls c - show/hide visual controls
......
...@@ -267,10 +267,15 @@ event_cb (ClutterStage * stage, ClutterEvent * event, UserInterface * ui) ...@@ -267,10 +267,15 @@ event_cb (ClutterStage * stage, ClutterEvent * event, UserInterface * ui)
break; break;
} }
case CLUTTER_less:
{
interface_play_prev (ui);
break;
}
case CLUTTER_greater: case CLUTTER_greater:
{ {
interface_play_next (ui); interface_play_next (ui);
break; break;
} }
...@@ -1060,6 +1065,26 @@ interface_play_next (UserInterface * ui) ...@@ -1060,6 +1065,26 @@ interface_play_next (UserInterface * ui)
} }
} }
void
interface_play_prev (UserInterface * ui)
{
GList * prev;
gchar * prev_uri;
prev = g_list_find (ui->uri_list, ui->engine->uri);
g_print ("1. prev = %s", prev->data);
prev = g_list_previous (prev);
g_print ("2. prev = %s", prev->data);
if (prev != NULL) {
prev_uri = prev->data;
engine_open_uri (ui->engine, prev_uri);
interface_load_uri (ui, prev_uri);
engine_play (ui->engine);
}
}
void void
interface_start (UserInterface * ui, gchar * uri) interface_start (UserInterface * ui, gchar * uri)
{ {
......
...@@ -118,6 +118,7 @@ struct _UserInterface ...@@ -118,6 +118,7 @@ struct _UserInterface
void interface_init (UserInterface * ui); void interface_init (UserInterface * ui);
gboolean interface_load_uri (UserInterface * ui, gchar * uri); gboolean interface_load_uri (UserInterface * ui, gchar * uri);
void interface_play_next (UserInterface * ui); void interface_play_next (UserInterface * ui);
void interface_play_prev (UserInterface * ui);
void interface_start (UserInterface * ui, gchar * uri); void interface_start (UserInterface * ui, gchar * uri);
gboolean interface_update_controls (UserInterface * ui); 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