Commit 740ee8cb authored by Alexandre Perraud's avatar Alexandre Perraud

Add backward and forward video buttons

parent 717b92fc
......@@ -108,11 +108,9 @@ collections
}
}
part {
name: "swallow.button2";
type: RECT;
name: "swallow.backward_button";
type: SWALLOW;
description {
visible: 0;
state: "pause" 0.0;
rel1 {
relative: 0.2 0.0;
to: "hub_button";
......@@ -126,7 +124,7 @@ collections
}
}
part {
name: "swallow.play";
name: "swallow.play_button";
type: SWALLOW;
description {
state: "pause" 0.0;
......@@ -145,11 +143,9 @@ collections
}
}
part {
name: "swallow.button4";
type: RECT;
name: "swallow.forward_button";
type: SWALLOW;
description {
visible: 0;
state: "pause" 0.0;
rel1 {
relative: 0.6 0.0;
to: "hub_button";
......
......@@ -53,7 +53,7 @@ _on_slider_changed_cb(void *data, Evas_Object *obj, void *event_info)
}
static void
clicked_cb(void *data, Evas_Object *obj, void *event_info)
clicked_play_pause(void *data, Evas_Object *obj, void *event_info)
{
//TODO link with vlc state
videodata_s *vd = data;
......@@ -65,6 +65,20 @@ clicked_cb(void *data, Evas_Object *obj, void *event_info)
}
static void
clicked_backward(void *data, Evas_Object *obj, void *event_info)
{
//TODO backward action
LOGD("backward button");
}
static void
clicked_forward(void *data, Evas_Object *obj, void *event_info)
{
//TODO forward action
LOGD("forward button");
}
Evas_Object*
create_video_gui(Evas_Object *parent, const char* file_path)
{
......@@ -88,13 +102,25 @@ create_video_gui(Evas_Object *parent, const char* file_path)
elm_object_part_content_set(vd->layout, "swallow.visualization", vd->canvas);
//TODO vd->canvas = ??
//create play/pause image
//create play/pause button
vd->play_pause_button = elm_image_add(vd->layout);
elm_image_file_set(vd->play_pause_button, ICON_DIR"ic_play_circle_normal_o.png", NULL);
//attach to edje layout
elm_object_part_content_set(vd->layout, "swallow.play", vd->play_pause_button);
elm_object_part_content_set(vd->layout, "swallow.play_button", vd->play_pause_button);
//click callback
evas_object_smart_callback_add(vd->play_pause_button, "clicked", clicked_cb, vd);
evas_object_smart_callback_add(vd->play_pause_button, "clicked", clicked_play_pause, vd);
//create backward button
Evas_Object *backward_button = elm_image_add(vd->layout);
elm_image_file_set(backward_button, ICON_DIR"ic_backward_circle_normal_o.png", NULL);
elm_object_part_content_set(vd->layout, "swallow.backward_button", backward_button);
evas_object_smart_callback_add(backward_button, "clicked", clicked_backward, vd);
//create forward button
Evas_Object *forward_button = elm_image_add(vd->layout);
elm_image_file_set(forward_button, ICON_DIR"ic_forward_circle_normal_o.png", NULL);
elm_object_part_content_set(vd->layout, "swallow.forward_button", forward_button);
evas_object_smart_callback_add(forward_button, "clicked", clicked_forward, vd);
//progress slider
vd->progress_slider = elm_slider_add(vd->layout);
......
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