summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-09-24 11:18:57 -0400
committerCedric Bail <cedric.bail@free.fr>2019-09-24 15:23:15 -0700
commit3d3cdc5955560726f0b9a8cef492274a1f7254a4 (patch)
treedb17c01b91b5a1d98367a2e168154fd1a0f4c974
parent89bee7a11a61d08cc758b061fd2f5e705d1f9029 (diff)
efl/player: rename 'play' property to 'pause'
this is a bit of an overhaul wherein the existing 'play' mechanics are all inverted. 'pause' is a state which stops playback but does not affect the playback_position property. this patch also includes implementations of Efl.Player::playing for a couple classes which (now) only implement pause, as this is a requirement for the objects to actually activate their animations test cases: * unit tests * all elm_test animation cases * elm_test video * rage Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D10114
-rw-r--r--src/bin/elementary/test_efl_anim_pause.c4
-rw-r--r--src/bin/elementary/test_efl_anim_repeat.c3
-rw-r--r--src/bin/elementary/test_evas_snapshot.c6
-rw-r--r--src/bin/elementary/test_gfx_filters.c2
-rw-r--r--src/bin/elementary/test_photocam.c12
-rw-r--r--src/lib/edje/edje_legacy.c4
-rw-r--r--src/lib/edje/edje_smart.c25
-rw-r--r--src/lib/edje/efl_canvas_layout.eo2
-rw-r--r--src/lib/efl/interfaces/efl_player.eo15
-rw-r--r--src/lib/elementary/efl_ui_image.c81
-rw-r--r--src/lib/elementary/efl_ui_image.eo3
-rw-r--r--src/lib/elementary/efl_ui_image_zoomable.c106
-rw-r--r--src/lib/elementary/efl_ui_image_zoomable.eo3
-rw-r--r--src/lib/elementary/efl_ui_image_zoomable_private.h1
-rw-r--r--src/lib/elementary/efl_ui_spotlight_manager_stack.c6
-rw-r--r--src/lib/elementary/efl_ui_video.c29
-rw-r--r--src/lib/elementary/efl_ui_video.eo2
-rw-r--r--src/lib/elementary/efl_ui_widget_image.h2
-rw-r--r--src/lib/emotion/efl_canvas_video.eo3
-rw-r--r--src/lib/emotion/emotion_smart.c73
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_player.c50
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_player.eo2
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_player_private.h1
-rw-r--r--src/lib/evas/canvas/evas_object_intercept.c2
24 files changed, 264 insertions, 173 deletions
diff --git a/src/bin/elementary/test_efl_anim_pause.c b/src/bin/elementary/test_efl_anim_pause.c
index 748599b..3730db3 100644
--- a/src/bin/elementary/test_efl_anim_pause.c
+++ b/src/bin/elementary/test_efl_anim_pause.c
@@ -82,13 +82,13 @@ _pause_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED
82 if (ad->is_anim_paused) 82 if (ad->is_anim_paused)
83 { 83 {
84 //Pause animation 84 //Pause animation
85 efl_player_play_set(ad->anim_obj, EINA_FALSE); 85 efl_player_paused_set(ad->anim_obj, EINA_TRUE);
86 elm_object_text_set(obj, "Resume Animation"); 86 elm_object_text_set(obj, "Resume Animation");
87 } 87 }
88 else 88 else
89 { 89 {
90 //Resume animation 90 //Resume animation
91 efl_player_play_set(ad->anim_obj, EINA_TRUE); 91 efl_player_paused_set(ad->anim_obj, EINA_FALSE);
92 elm_object_text_set(obj, "Pause Animation"); 92 elm_object_text_set(obj, "Pause Animation");
93 } 93 }
94} 94}
diff --git a/src/bin/elementary/test_efl_anim_repeat.c b/src/bin/elementary/test_efl_anim_repeat.c
index d853f9c..55bf98c 100644
--- a/src/bin/elementary/test_efl_anim_repeat.c
+++ b/src/bin/elementary/test_efl_anim_repeat.c
@@ -122,8 +122,7 @@ test_efl_anim_repeat(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
122 App_Data *ad = calloc(1, sizeof(App_Data)); 122 App_Data *ad = calloc(1, sizeof(App_Data));
123 if (!ad) return; 123 if (!ad) return;
124 124
125 Evas_Object *win = elm_win_add(NULL, "Efl Animation Repeat", ELM_WIN_BASIC); 125 Evas_Object *win = elm_win_util_standard_add(NULL, "Efl Animation Repeat");
126 elm_win_title_set(win, "Efl Animation Repeat");
127 elm_win_autodel_set(win, EINA_TRUE); 126 elm_win_autodel_set(win, EINA_TRUE);
128 evas_object_smart_callback_add(win, "delete,request", _win_del_cb, ad); 127 evas_object_smart_callback_add(win, "delete,request", _win_del_cb, ad);
129 128
diff --git a/src/bin/elementary/test_evas_snapshot.c b/src/bin/elementary/test_evas_snapshot.c
index ecfee19..f1395f2 100644
--- a/src/bin/elementary/test_evas_snapshot.c
+++ b/src/bin/elementary/test_evas_snapshot.c
@@ -47,7 +47,11 @@ _anim_toggle(void *data, const Efl_Event *ev EINA_UNUSED)
47 EINA_ITERATOR_FOREACH(it, o) 47 EINA_ITERATOR_FOREACH(it, o)
48 { 48 {
49 if (efl_isa(o, EFL_PLAYER_INTERFACE) && efl_playable_get(o)) 49 if (efl_isa(o, EFL_PLAYER_INTERFACE) && efl_playable_get(o))
50 efl_player_play_set(o, !efl_player_play_get(o)); 50 {
51 if (!efl_player_playing_get(o))
52 efl_player_playing_set(o, EINA_TRUE);
53 efl_player_paused_set(o, !efl_player_paused_get(o));
54 }
51 } 55 }
52 eina_iterator_free(it); 56 eina_iterator_free(it);
53} 57}
diff --git a/src/bin/elementary/test_gfx_filters.c b/src/bin/elementary/test_gfx_filters.c
index e7410c8..11ee74c 100644
--- a/src/bin/elementary/test_gfx_filters.c
+++ b/src/bin/elementary/test_gfx_filters.c
@@ -408,7 +408,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
408 efl_name_set(efl_added, images[k].src_name), 408 efl_name_set(efl_added, images[k].src_name),
409 elm_object_tooltip_text_set(efl_added, images[k].src_name)); 409 elm_object_tooltip_text_set(efl_added, images[k].src_name));
410 if (efl_playable_get(o)) 410 if (efl_playable_get(o))
411 efl_player_play_set(o, 1); 411 efl_player_playing_set(o, 1);
412 efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, _img_click, win); 412 efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, _img_click, win);
413 efl_pack(box2, o); 413 efl_pack(box2, o);
414 } 414 }
diff --git a/src/bin/elementary/test_photocam.c b/src/bin/elementary/test_photocam.c
index 70d6da2..c26be3a 100644
--- a/src/bin/elementary/test_photocam.c
+++ b/src/bin/elementary/test_photocam.c
@@ -153,7 +153,7 @@ my_bt_open(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
153 153
154 if (file && eina_str_has_extension(file, ".gif") 154 if (file && eina_str_has_extension(file, ".gif")
155 && efl_playable_get(ph)) 155 && efl_playable_get(ph))
156 efl_player_play_set(ph, EINA_TRUE); 156 efl_player_playing_set(ph, EINA_TRUE);
157} 157}
158 158
159static void 159static void
@@ -754,11 +754,11 @@ test_photocam_icon(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
754static void 754static void
755_zoomable_clicked_cb(void *data EINA_UNUSED, const Efl_Event *ev) 755_zoomable_clicked_cb(void *data EINA_UNUSED, const Efl_Event *ev)
756{ 756{
757 Eina_Bool play; 757 Eina_Bool paused;
758 758
759 play = !efl_player_play_get(ev->object); 759 paused = efl_player_paused_get(ev->object);
760 printf("image clicked! play = %d\n", play); 760 printf("image clicked! paused = %d\n", paused);
761 efl_player_play_set(ev->object, play); 761 efl_player_paused_set(ev->object, !paused);
762} 762}
763 763
764static void 764static void
@@ -832,7 +832,7 @@ test_image_zoomable_animated(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE
832 if (efl_playable_get(zoomable)) 832 if (efl_playable_get(zoomable))
833 { 833 {
834 printf("animation is available for this image.\n"); 834 printf("animation is available for this image.\n");
835 efl_player_play_set(zoomable, EINA_TRUE); 835 efl_player_playing_set(zoomable, EINA_TRUE);
836 } 836 }
837 837
838 rect = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win, 838 rect = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win,
diff --git a/src/lib/edje/edje_legacy.c b/src/lib/edje/edje_legacy.c
index edcc185..5f04ead 100644
--- a/src/lib/edje/edje_legacy.c
+++ b/src/lib/edje/edje_legacy.c
@@ -1202,13 +1202,13 @@ edje_object_calc_force(Edje_Object *obj)
1202EAPI void 1202EAPI void
1203edje_object_play_set(Evas_Object *obj, Eina_Bool play) 1203edje_object_play_set(Evas_Object *obj, Eina_Bool play)
1204{ 1204{
1205 efl_player_play_set(obj, play); 1205 efl_player_paused_set(obj, !play);
1206} 1206}
1207 1207
1208EAPI Eina_Bool 1208EAPI Eina_Bool
1209edje_object_play_get(const Evas_Object *obj) 1209edje_object_play_get(const Evas_Object *obj)
1210{ 1210{
1211 return efl_player_play_get(obj); 1211 return !efl_player_paused_get(obj);
1212} 1212}
1213 1213
1214EAPI void 1214EAPI void
diff --git a/src/lib/edje/edje_smart.c b/src/lib/edje/edje_smart.c
index 7acf644..c0b37db 100644
--- a/src/lib/edje/edje_smart.c
+++ b/src/lib/edje/edje_smart.c
@@ -543,28 +543,26 @@ _efl_canvas_layout_efl_playable_playable_get(const Eo *obj EINA_UNUSED, Edje *pd
543 return EINA_TRUE; 543 return EINA_TRUE;
544} 544}
545 545
546EOLIAN void 546EOLIAN Eina_Bool
547_efl_canvas_layout_efl_player_play_set(Eo *obj EINA_UNUSED, Edje *ed, Eina_Bool play) 547_efl_canvas_layout_efl_player_paused_set(Eo *obj EINA_UNUSED, Edje *ed, Eina_Bool paused)
548{ 548{
549 double t; 549 double t;
550 Eina_List *l; 550 Eina_List *l;
551 Edje_Running_Program *runp; 551 Edje_Running_Program *runp;
552 unsigned short i; 552 unsigned short i;
553 553
554 if (!ed) return; 554 if (!ed) return EINA_FALSE;
555 if (ed->delete_me) return; 555 if (ed->delete_me) return EINA_FALSE;
556 if (play) 556 paused = !!paused;
557 if (ed->paused == paused) return EINA_TRUE;
558 if (!paused)
557 { 559 {
558 if (!ed->paused) return;
559 ed->paused = EINA_FALSE;
560 t = ecore_time_get() - ed->paused_at; 560 t = ecore_time_get() - ed->paused_at;
561 EINA_LIST_FOREACH(ed->actions, l, runp) 561 EINA_LIST_FOREACH(ed->actions, l, runp)
562 runp->start_time += t; 562 runp->start_time += t;
563 } 563 }
564 else 564 else
565 { 565 {
566 if (ed->paused) return;
567 ed->paused = EINA_TRUE;
568 ed->paused_at = ecore_time_get(); 566 ed->paused_at = ecore_time_get();
569 } 567 }
570 568
@@ -576,18 +574,17 @@ _efl_canvas_layout_efl_player_play_set(Eo *obj EINA_UNUSED, Edje *ed, Eina_Bool
576 ((rp->type == EDJE_RP_TYPE_SWALLOW) && 574 ((rp->type == EDJE_RP_TYPE_SWALLOW) &&
577 (rp->typedata.swallow)) && 575 (rp->typedata.swallow)) &&
578 (rp->typedata.swallow->swallowed_object)) 576 (rp->typedata.swallow->swallowed_object))
579 edje_object_play_set(rp->typedata.swallow->swallowed_object, play); 577 efl_player_paused_set(rp->typedata.swallow->swallowed_object, paused);
580 } 578 }
579 return EINA_TRUE;
581} 580}
582 581
583EOLIAN Eina_Bool 582EOLIAN Eina_Bool
584_efl_canvas_layout_efl_player_play_get(const Eo *obj EINA_UNUSED, Edje *ed) 583_efl_canvas_layout_efl_player_paused_get(const Eo *obj EINA_UNUSED, Edje *ed)
585{ 584{
586 if (!ed) return EINA_FALSE; 585 if (!ed) return EINA_FALSE;
587 if (ed->delete_me) return EINA_FALSE; 586 if (ed->delete_me) return EINA_FALSE;
588 if (ed->paused) return EINA_FALSE; 587 return ed->paused;
589
590 return EINA_TRUE;
591} 588}
592 589
593EOLIAN void 590EOLIAN void
diff --git a/src/lib/edje/efl_canvas_layout.eo b/src/lib/edje/efl_canvas_layout.eo
index 0f7a185..5a9f0ac 100644
--- a/src/lib/edje/efl_canvas_layout.eo
+++ b/src/lib/edje/efl_canvas_layout.eo
@@ -127,7 +127,7 @@ class @beta Efl.Canvas.Layout extends Efl.Canvas.Group implements Efl.File, Efl.
127 Efl.Part.part_get; [[Returns @Efl.Canvas.Layout_Part]] 127 Efl.Part.part_get; [[Returns @Efl.Canvas.Layout_Part]]
128 Efl.Observer.update; 128 Efl.Observer.update;
129 Efl.Playable.playable { get; } 129 Efl.Playable.playable { get; }
130 Efl.Player.play { get; set; } 130 Efl.Player.paused { get; set; }
131 Efl.Player.play_speed { get; set; } 131 Efl.Player.play_speed { get; set; }
132 } 132 }
133} 133}
diff --git a/src/lib/efl/interfaces/efl_player.eo b/src/lib/efl/interfaces/efl_player.eo
index 619fcd5..bf100a2 100644
--- a/src/lib/efl/interfaces/efl_player.eo
+++ b/src/lib/efl/interfaces/efl_player.eo
@@ -23,19 +23,22 @@ interface @beta Efl.Player
23 playing: bool; [[$true if playing, $false otherwise.]] 23 playing: bool; [[$true if playing, $false otherwise.]]
24 } 24 }
25 } 25 }
26 @property play { 26 @property paused {
27 [[Playback state of the media file. 27 [[Pause state of the media file.
28
29 This property sets the pause state of the media. Re-setting the current
30 pause state has no effect.
28 31
29 This property sets the currently playback state of the 32 If @.playing is set to $true, this property can be used to pause and resume
30 video. Using this function to play or pause the video 33 playback of the media without changing its @.progress property.
31 doesn't alter it's current position.
32 ]] 34 ]]
33 set { 35 set {
36 return: bool(false); [[If $true, the property change has succeeded.]]
34 } 37 }
35 get { 38 get {
36 } 39 }
37 values { 40 values {
38 play: bool; [[$true if playing, $false otherwise.]] 41 paused: bool; [[$true if paused, $false otherwise.]]
39 } 42 }
40 } 43 }
41 @property playback_position { 44 @property playback_position {
diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c
index bbeffb2..3047787 100644
--- a/src/lib/elementary/efl_ui_image.c
+++ b/src/lib/elementary/efl_ui_image.c
@@ -871,6 +871,8 @@ _efl_ui_image_efl_object_constructor(Eo *obj, Efl_Ui_Image_Data *pd)
871 871
872 pd->scale_type = EFL_GFX_IMAGE_SCALE_METHOD_FIT; 872 pd->scale_type = EFL_GFX_IMAGE_SCALE_METHOD_FIT;
873 pd->self = obj; 873 pd->self = obj;
874 /* legacy elm_image starts paused */
875 pd->paused = elm_widget_is_legacy(obj);
874 876
875 return obj; 877 return obj;
876} 878}
@@ -930,8 +932,11 @@ _efl_ui_image_efl_file_load(Eo *obj, Efl_Ui_Image_Data *sd)
930 if (sd->anim) 932 if (sd->anim)
931 { 933 {
932 ELM_SAFE_FREE(sd->anim_timer, ecore_timer_del); 934 ELM_SAFE_FREE(sd->anim_timer, ecore_timer_del);
933 sd->play = EINA_FALSE; 935 sd->paused = elm_widget_is_legacy(obj);
934 sd->anim = EINA_FALSE; 936 sd->anim = EINA_FALSE;
937 sd->frame_count = -1;
938 sd->cur_frame = -1;
939 sd->frame_duration = -1;
935 } 940 }
936 941
937 if (file && _efl_ui_image_is_remote(file)) 942 if (file && _efl_ui_image_is_remote(file))
@@ -967,8 +972,11 @@ _efl_ui_image_efl_file_unload(Eo *obj, Efl_Ui_Image_Data *sd)
967 if (sd->anim) 972 if (sd->anim)
968 { 973 {
969 ELM_SAFE_FREE(sd->anim_timer, ecore_timer_del); 974 ELM_SAFE_FREE(sd->anim_timer, ecore_timer_del);
970 sd->play = EINA_FALSE; 975 sd->paused = elm_widget_is_legacy(obj);
971 sd->anim = EINA_FALSE; 976 sd->anim = EINA_FALSE;
977 sd->frame_count = -1;
978 sd->cur_frame = -1;
979 sd->frame_duration = -1;
972 } 980 }
973 981
974 if (sd->prev_img) 982 if (sd->prev_img)
@@ -1727,21 +1735,21 @@ _efl_ui_image_efl_playable_playable_get(const Eo *obj, Efl_Ui_Image_Data *sd)
1727 return evas_object_image_animated_get(elm_image_object_get(obj)); 1735 return evas_object_image_animated_get(elm_image_object_get(obj));
1728} 1736}
1729 1737
1730static void 1738static Eina_Bool
1731_efl_ui_image_animated_set_internal(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Bool anim) 1739_efl_ui_image_animated_set_internal(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Bool anim)
1732{ 1740{
1733 anim = !!anim; 1741 anim = !!anim;
1734 if (sd->anim == anim) return; 1742 if (sd->anim == anim) return EINA_TRUE;
1735
1736 sd->anim = anim;
1737 1743
1738 if (sd->edje) 1744 if (sd->edje)
1739 { 1745 {
1740 edje_object_animation_set(sd->img, anim); 1746 edje_object_animation_set(sd->img, anim);
1741 return; 1747 sd->anim = anim;
1748 return EINA_TRUE;
1742 } 1749 }
1743 sd->img = elm_image_object_get(obj); 1750 sd->img = elm_image_object_get(obj);
1744 if (!evas_object_image_animated_get(sd->img)) return; 1751 if (!evas_object_image_animated_get(sd->img)) return EINA_FALSE;
1752 sd->anim = anim;
1745 1753
1746 if (anim) 1754 if (anim)
1747 { 1755 {
@@ -1751,13 +1759,18 @@ _efl_ui_image_animated_set_internal(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Bool an
1751 evas_object_image_animated_frame_duration_get 1759 evas_object_image_animated_frame_duration_get
1752 (sd->img, sd->cur_frame, 0); 1760 (sd->img, sd->cur_frame, 0);
1753 evas_object_image_animated_frame_set(sd->img, sd->cur_frame); 1761 evas_object_image_animated_frame_set(sd->img, sd->cur_frame);
1762 if (!sd->paused)//legacy
1763 sd->anim_timer = ecore_timer_add
1764 (sd->frame_duration, _efl_ui_image_animate_cb, obj);
1754 } 1765 }
1755 else 1766 else
1756 { 1767 {
1757 sd->frame_count = -1; 1768 sd->frame_count = -1;
1758 sd->cur_frame = -1; 1769 sd->cur_frame = -1;
1759 sd->frame_duration = -1; 1770 sd->frame_duration = -1;
1771 ELM_SAFE_FREE(sd->anim_timer, ecore_timer_del);
1760 } 1772 }
1773 return EINA_TRUE;
1761} 1774}
1762 1775
1763static Eina_Bool 1776static Eina_Bool
@@ -1784,18 +1797,31 @@ elm_image_animated_get(const Evas_Object *obj)
1784 return _efl_ui_image_animated_get_internal(obj, sd); 1797 return _efl_ui_image_animated_get_internal(obj, sd);
1785} 1798}
1786 1799
1787static void 1800EOLIAN static Eina_Bool
1788_efl_ui_image_animated_play_set_internal(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Bool play) 1801_efl_ui_image_efl_player_playing_set(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Bool playing)
1802{
1803 return _efl_ui_image_animated_set_internal(obj, sd, playing);
1804}
1805
1806EOLIAN static Eina_Bool
1807_efl_ui_image_efl_player_playing_get(const Eo *obj, Efl_Ui_Image_Data *sd)
1789{ 1808{
1790 if (!sd->anim) return; 1809 return _efl_ui_image_animated_get_internal(obj, sd);
1791 if (sd->play == play) return; 1810}
1792 sd->play = play; 1811
1812static Eina_Bool
1813_efl_ui_image_animated_paused_set_internal(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Bool paused)
1814{
1815 paused = !!paused;
1816 if (!sd->anim) return EINA_FALSE;
1817 if (sd->paused == paused) return EINA_TRUE;
1818 sd->paused = paused;
1793 if (sd->edje) 1819 if (sd->edje)
1794 { 1820 {
1795 edje_object_play_set(sd->img, play); 1821 edje_object_play_set(sd->img, !paused);
1796 return; 1822 return EINA_TRUE;
1797 } 1823 }
1798 if (play) 1824 if (!paused)
1799 { 1825 {
1800 sd->anim_timer = ecore_timer_add 1826 sd->anim_timer = ecore_timer_add
1801 (sd->frame_duration, _efl_ui_image_animate_cb, obj); 1827 (sd->frame_duration, _efl_ui_image_animate_cb, obj);
@@ -1804,14 +1830,15 @@ _efl_ui_image_animated_play_set_internal(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Bo
1804 { 1830 {
1805 ELM_SAFE_FREE(sd->anim_timer, ecore_timer_del); 1831 ELM_SAFE_FREE(sd->anim_timer, ecore_timer_del);
1806 } 1832 }
1833 return EINA_TRUE;
1807} 1834}
1808 1835
1809static Eina_Bool 1836static Eina_Bool
1810_efl_ui_image_animated_play_get_internal(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd) 1837_efl_ui_image_animated_paused_get_internal(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
1811{ 1838{
1812 if (sd->edje) 1839 if (sd->edje)
1813 return edje_object_play_get(sd->img); 1840 return !edje_object_play_get(sd->img);
1814 return sd->play; 1841 return sd->paused;
1815} 1842}
1816 1843
1817EAPI void 1844EAPI void
@@ -1819,7 +1846,7 @@ elm_image_animated_play_set(Elm_Image *obj, Eina_Bool play)
1819{ 1846{
1820 Efl_Ui_Image_Data *sd = efl_data_scope_get(obj, MY_CLASS); 1847 Efl_Ui_Image_Data *sd = efl_data_scope_get(obj, MY_CLASS);
1821 if (!sd) return; 1848 if (!sd) return;
1822 _efl_ui_image_animated_play_set_internal(obj, sd, play); 1849 _efl_ui_image_animated_paused_set_internal(obj, sd, !play);
1823} 1850}
1824 1851
1825EAPI Eina_Bool 1852EAPI Eina_Bool
@@ -1827,21 +1854,19 @@ elm_image_animated_play_get(const Elm_Image *obj)
1827{ 1854{
1828 Efl_Ui_Image_Data *sd = efl_data_scope_get(obj, MY_CLASS); 1855 Efl_Ui_Image_Data *sd = efl_data_scope_get(obj, MY_CLASS);
1829 if (!sd) return EINA_FALSE; 1856 if (!sd) return EINA_FALSE;
1830 return _efl_ui_image_animated_play_get_internal(obj, sd); 1857 return _efl_ui_image_animated_paused_get_internal(obj, sd);
1831} 1858}
1832 1859
1833EOLIAN static void 1860EOLIAN static Eina_Bool
1834_efl_ui_image_efl_player_play_set(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Bool play) 1861_efl_ui_image_efl_player_paused_set(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Bool paused)
1835{ 1862{
1836 if (play && !_efl_ui_image_animated_get_internal(obj, sd)) 1863 return _efl_ui_image_animated_paused_set_internal(obj, sd, paused);
1837 _efl_ui_image_animated_set_internal(obj, sd, play);
1838 _efl_ui_image_animated_play_set_internal(obj, sd, play);
1839} 1864}
1840 1865
1841EOLIAN static Eina_Bool 1866EOLIAN static Eina_Bool
1842_efl_ui_image_efl_player_play_get(const Eo *obj, Efl_Ui_Image_Data *sd) 1867_efl_ui_image_efl_player_paused_get(const Eo *obj, Efl_Ui_Image_Data *sd)
1843{ 1868{
1844 return _efl_ui_image_animated_play_get_internal(obj, sd); 1869 return _efl_ui_image_animated_paused_get_internal(obj, sd);
1845} 1870}
1846 1871
1847EOLIAN static void 1872EOLIAN static void
diff --git a/src/lib/elementary/efl_ui_image.eo b/src/lib/elementary/efl_ui_image.eo
index 2103545..6ea6b27 100644
--- a/src/lib/elementary/efl_ui_image.eo
+++ b/src/lib/elementary/efl_ui_image.eo
@@ -98,7 +98,8 @@ class Efl.Ui.Image extends Efl.Ui.Widget implements Efl.Input.Clickable, Efl.Ui.
98 Efl.Gfx.Image.content_hint { get; set; } 98 Efl.Gfx.Image.content_hint { get; set; }
99 Efl.Gfx.Image.image_load_error { get; } 99 Efl.Gfx.Image.image_load_error { get; }
100 Efl.Playable.playable { get; } 100 Efl.Playable.playable { get; }
101 Efl.Player.play { get; set; } 101 Efl.Player.playing { get; set; }
102 Efl.Player.paused { get; set; }
102 Efl.Layout.Signal.signal_emit; 103 Efl.Layout.Signal.signal_emit;
103 Efl.Layout.Signal.message_send; 104 Efl.Layout.Signal.message_send;
104 Efl.Layout.Signal.signal_callback_add; 105 Efl.Layout.Signal.signal_callback_add;
diff --git a/src/lib/elementary/efl_ui_image_zoomable.c b/src/lib/elementary/efl_ui_image_zoomable.c
index 0549a67..129619a 100644
--- a/src/lib/elementary/efl_ui_image_zoomable.c
+++ b/src/lib/elementary/efl_ui_image_zoomable.c
@@ -3017,22 +3017,43 @@ _efl_ui_image_zoomable_animated_get_internal(const Eo *obj EINA_UNUSED, Efl_Ui_I
3017 return sd->anim; 3017 return sd->anim;
3018} 3018}
3019 3019
3020static void 3020static Eina_Bool
3021_efl_ui_image_zoomable_animate_cb(void *data)
3022{
3023 EFL_UI_IMAGE_ZOOMABLE_DATA_GET(data, sd);
3024 _grid_clear_all(data);
3025
3026 if (!sd->anim) return ECORE_CALLBACK_CANCEL;
3027
3028 sd->cur_frame++;
3029 if ((sd->frame_count > 0) && (sd->cur_frame > sd->frame_count))
3030 sd->cur_frame = sd->cur_frame % sd->frame_count;
3031
3032 evas_object_image_animated_frame_set(sd->img, sd->cur_frame);
3033 sd->frame_duration = evas_object_image_animated_frame_duration_get
3034 (sd->img, sd->cur_frame, 0);
3035
3036 if (sd->frame_duration > 0)
3037 ecore_timer_interval_set(sd->anim_timer, sd->frame_duration);
3038
3039 return ECORE_CALLBACK_RENEW;
3040}
3041
3042static Eina_Bool
3021_efl_ui_image_zoomable_animated_set_internal(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd, Eina_Bool anim) 3043_efl_ui_image_zoomable_animated_set_internal(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd, Eina_Bool anim)
3022{ 3044{
3023 anim = !!anim; 3045 anim = !!anim;
3024 if (sd->anim == anim) return; 3046 if (sd->anim == anim) return EINA_TRUE;
3025
3026 sd->anim = anim;
3027 3047
3028 if (sd->edje) 3048 if (sd->edje)
3029 { 3049 {
3050 sd->anim = anim;
3030 edje_object_animation_set(sd->edje, anim); 3051 edje_object_animation_set(sd->edje, anim);
3031 return; 3052 return EINA_TRUE;
3032 } 3053 }
3033 3054
3034 if (!evas_object_image_animated_get(sd->img)) return; 3055 if (!evas_object_image_animated_get(sd->img)) return EINA_FALSE;
3035 3056 sd->anim = anim;
3036 if (anim) 3057 if (anim)
3037 { 3058 {
3038 sd->frame_count = evas_object_image_animated_frame_count_get(sd->img); 3059 sd->frame_count = evas_object_image_animated_frame_count_get(sd->img);
@@ -3041,49 +3062,33 @@ _efl_ui_image_zoomable_animated_set_internal(Eo *obj EINA_UNUSED, Efl_Ui_Image_Z
3041 evas_object_image_animated_frame_duration_get 3062 evas_object_image_animated_frame_duration_get
3042 (sd->img, sd->cur_frame, 0); 3063 (sd->img, sd->cur_frame, 0);
3043 evas_object_image_animated_frame_set(sd->img, sd->cur_frame); 3064 evas_object_image_animated_frame_set(sd->img, sd->cur_frame);
3065 if (!sd->paused)//legacy
3066 sd->anim_timer = ecore_timer_add
3067 (sd->frame_duration, _efl_ui_image_zoomable_animate_cb, obj);
3044 } 3068 }
3045 else 3069 else
3046 { 3070 {
3047 sd->frame_count = -1; 3071 sd->frame_count = -1;
3048 sd->cur_frame = -1; 3072 sd->cur_frame = -1;
3049 sd->frame_duration = -1; 3073 sd->frame_duration = -1;
3074 ELM_SAFE_FREE(sd->anim_timer, ecore_timer_del);
3050 } 3075 }
3076 return EINA_TRUE;
3051} 3077}
3052 3078
3053static Eina_Bool 3079static Eina_Bool
3054_efl_ui_image_zoomable_animate_cb(void *data) 3080_efl_ui_image_zoomable_animated_paused_set_internal(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd, Eina_Bool paused)
3055{
3056 EFL_UI_IMAGE_ZOOMABLE_DATA_GET(data, sd);
3057 _grid_clear_all(data);
3058
3059 if (!sd->anim) return ECORE_CALLBACK_CANCEL;
3060
3061 sd->cur_frame++;
3062 if ((sd->frame_count > 0) && (sd->cur_frame > sd->frame_count))
3063 sd->cur_frame = sd->cur_frame % sd->frame_count;
3064
3065 evas_object_image_animated_frame_set(sd->img, sd->cur_frame);
3066 sd->frame_duration = evas_object_image_animated_frame_duration_get
3067 (sd->img, sd->cur_frame, 0);
3068
3069 if (sd->frame_duration > 0)
3070 ecore_timer_interval_set(sd->anim_timer, sd->frame_duration);
3071
3072 return ECORE_CALLBACK_RENEW;
3073}
3074
3075static void
3076_efl_ui_image_zoomable_animated_play_set_internal(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd, Eina_Bool play)
3077{ 3081{
3078 if (!sd->anim) return; 3082 paused = !!paused;
3079 if (sd->play == play) return; 3083 if (!sd->anim) return EINA_FALSE;
3080 sd->play = play; 3084 if (sd->paused == paused) return EINA_TRUE;
3085 sd->paused = paused;
3081 if (sd->edje) 3086 if (sd->edje)
3082 { 3087 {
3083 edje_object_play_set(sd->edje, play); 3088 edje_object_play_set(sd->edje, !paused);
3084 return; 3089 return EINA_TRUE;
3085 } 3090 }
3086 if (play) 3091 if (!paused)
3087 { 3092 {
3088 sd->anim_timer = ecore_timer_add 3093 sd->anim_timer = ecore_timer_add
3089 (sd->frame_duration, _efl_ui_image_zoomable_animate_cb, obj); 3094 (sd->frame_duration, _efl_ui_image_zoomable_animate_cb, obj);
@@ -3092,30 +3097,33 @@ _efl_ui_image_zoomable_animated_play_set_internal(Eo *obj, Efl_Ui_Image_Zoomable
3092 { 3097 {
3093 ELM_SAFE_FREE(sd->anim_timer, ecore_timer_del); 3098 ELM_SAFE_FREE(sd->anim_timer, ecore_timer_del);
3094 } 3099 }
3100 return EINA_TRUE;
3095} 3101}
3096 3102
3097EOLIAN static void 3103EOLIAN static Eina_Bool
3098_efl_ui_image_zoomable_efl_player_play_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd, Eina_Bool play) 3104_efl_ui_image_zoomable_efl_player_playing_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd, Eina_Bool playing)
3099{ 3105{
3100 evas_object_image_preload(sd->img, EINA_FALSE); 3106 return _efl_ui_image_zoomable_animated_set_internal(obj, sd, playing);
3101 if (play && !_efl_ui_image_zoomable_animated_get_internal(obj, sd)) 3107}
3102 _efl_ui_image_zoomable_animated_set_internal(obj, sd, play);
3103 3108
3104 _efl_ui_image_zoomable_animated_play_set_internal(obj, sd, play); 3109EOLIAN static Eina_Bool
3110_efl_ui_image_zoomable_efl_player_paused_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd, Eina_Bool paused)
3111{
3112 return _efl_ui_image_zoomable_animated_paused_set_internal(obj, sd, paused);
3105} 3113}
3106 3114
3107static Eina_Bool 3115EOLIAN static Eina_Bool
3108_efl_ui_image_zoomable_animated_play_get_internal(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd) 3116_efl_ui_image_zoomable_efl_player_playing_get(const Eo *obj, Efl_Ui_Image_Zoomable_Data *sd)
3109{ 3117{
3110 if (sd->edje) 3118 return _efl_ui_image_zoomable_animated_get_internal(obj, sd);
3111 return edje_object_play_get(sd->edje);
3112 return sd->play;
3113} 3119}
3114 3120
3115EOLIAN static Eina_Bool 3121EOLIAN static Eina_Bool
3116_efl_ui_image_zoomable_efl_player_play_get(const Eo *obj, Efl_Ui_Image_Zoomable_Data *sd) 3122_efl_ui_image_zoomable_efl_player_paused_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd)
3117{ 3123{
3118 return _efl_ui_image_zoomable_animated_play_get_internal(obj, sd); 3124 if (sd->edje)
3125 return !edje_object_play_get(sd->edje);
3126 return sd->paused;
3119} 3127}
3120 3128
3121EOLIAN static void 3129EOLIAN static void
diff --git a/src/lib/elementary/efl_ui_image_zoomable.eo b/src/lib/elementary/efl_ui_image_zoomable.eo
index 1157cbd..bed8b36 100644
--- a/src/lib/elementary/efl_ui_image_zoomable.eo
+++ b/src/lib/elementary/efl_ui_image_zoomable.eo
@@ -44,7 +44,8 @@ class @beta Efl.Ui.Image_Zoomable extends Efl.Ui.Image implements Efl.Ui.Zoom
44 Efl.Gfx.Image.image_size { get; } 44 Efl.Gfx.Image.image_size { get; }
45 Efl.Ui.Image.icon { set; get; } 45 Efl.Ui.Image.icon { set; get; }
46 Efl.Playable.playable { get; } 46 Efl.Playable.playable { get; }
47 Efl.Player.play { get; set; } 47 Efl.Player.playing { get; set; }
48 Efl.Player.paused { get; set; }
48 Efl.Ui.Zoom.zoom_animation { set; get; } 49 Efl.Ui.Zoom.zoom_animation { set; get; }
49 Efl.Ui.Zoom.zoom_level { set; get; } 50 Efl.Ui.Zoom.zoom_level { set; get; }
50 Efl.Ui.Zoom.zoom_mode { set; get; } 51 Efl.Ui.Zoom.zoom_mode { set; get; }
diff --git a/src/lib/elementary/efl_ui_image_zoomable_private.h b/src/lib/elementary/efl_ui_image_zoomable_private.h
index d8b95eb..f2833c8 100644
--- a/src/lib/elementary/efl_ui_image_zoomable_private.h
+++ b/src/lib/elementary/efl_ui_image_zoomable_private.h
@@ -140,7 +140,6 @@ struct _Efl_Ui_Image_Zoomable_Data
140 Eina_Bool on_hold : 1; 140 Eina_Bool on_hold : 1;
141 Eina_Bool paused : 1; 141 Eina_Bool paused : 1;
142 Eina_Bool orientation_changed : 1; 142 Eina_Bool orientation_changed : 1;
143 Eina_Bool play : 1;
144 Eina_Bool anim : 1; 143 Eina_Bool anim : 1;
145 Eina_Bool freeze_want : 1; 144 Eina_Bool freeze_want : 1;
146 Eina_Bool show_item: 1; 145 Eina_Bool show_item: 1;
diff --git a/src/lib/elementary/efl_ui_spotlight_manager_stack.c b/src/lib/elementary/efl_ui_spotlight_manager_stack.c
index 9d92034..e93c820 100644
--- a/src/lib/elementary/efl_ui_spotlight_manager_stack.c
+++ b/src/lib/elementary/efl_ui_spotlight_manager_stack.c
@@ -23,7 +23,7 @@ _geom_sync(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Stack_Data *pd)
23{ 23{
24 Eina_Array *array = eina_array_new(2); 24 Eina_Array *array = eina_array_new(2);
25 Eina_Rect group_pos = efl_gfx_entity_geometry_get(pd->group); 25 Eina_Rect group_pos = efl_gfx_entity_geometry_get(pd->group);
26 if (efl_player_play_get(pd->hide)) 26 if (efl_player_playing_get(pd->hide))
27 { 27 {
28 //we are currently in animation, sync the geometry of the targets 28 //we are currently in animation, sync the geometry of the targets
29 eina_array_push(array, efl_animation_player_target_get(pd->hide)); 29 eina_array_push(array, efl_animation_player_target_get(pd->hide));
@@ -132,7 +132,7 @@ _efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_bind(Eo *obj, Efl_Ui_Sp
132 132
133 pd->show = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, obj); 133 pd->show = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, obj);
134 efl_animation_player_animation_set(pd->show, show_anim); 134 efl_animation_player_animation_set(pd->show, show_anim);
135 efl_player_play_set(pd->show, EINA_FALSE); 135 efl_player_playing_set(pd->show, EINA_FALSE);
136 efl_event_callback_array_add(pd->show, _anim_show_event_cb(), obj); 136 efl_event_callback_array_add(pd->show, _anim_show_event_cb(), obj);
137 137
138 //Default Hide Animation 138 //Default Hide Animation
@@ -143,7 +143,7 @@ _efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_bind(Eo *obj, Efl_Ui_Sp
143 143
144 pd->hide = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, obj); 144 pd->hide = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, obj);
145 efl_animation_player_animation_set(pd->hide, hide_anim); 145 efl_animation_player_animation_set(pd->hide, hide_anim);
146 efl_player_play_set(pd->hide, EINA_FALSE); 146 efl_player_playing_set(pd->hide, EINA_FALSE);
147 efl_event_callback_array_add(pd->hide, _anim_hide_event_cb(), obj); 147 efl_event_callback_array_add(pd->hide, _anim_hide_event_cb(), obj);
148 148
149 for (int i = 0; i < efl_content_count(spotlight) ; ++i) { 149 for (int i = 0; i < efl_content_count(spotlight) ; ++i) {
diff --git a/src/lib/elementary/efl_ui_video.c b/src/lib/elementary/efl_ui_video.c
index e5bf59b..172e912 100644
--- a/src/lib/elementary/efl_ui_video.c
+++ b/src/lib/elementary/efl_ui_video.c
@@ -95,7 +95,7 @@ _key_action_move(Evas_Object *obj, const char *params)
95static Eina_Bool 95static Eina_Bool
96_key_action_play(Evas_Object *obj, const char *params EINA_UNUSED) 96_key_action_play(Evas_Object *obj, const char *params EINA_UNUSED)
97{ 97{
98 if (efl_player_play_get(obj)) 98 if (!efl_player_paused_get(obj))
99 elm_video_pause(obj); 99 elm_video_pause(obj);
100 else 100 else
101 elm_video_play(obj); 101 elm_video_play(obj);
@@ -327,15 +327,17 @@ _efl_ui_video_emotion_get(const Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *sd)
327 return sd->emotion; 327 return sd->emotion;
328} 328}
329 329
330EOLIAN static void 330EOLIAN static Eina_Bool
331_efl_ui_video_efl_player_play_set(Eo *obj, Efl_Ui_Video_Data *sd, Eina_Bool play) 331_efl_ui_video_efl_player_paused_set(Eo *obj, Efl_Ui_Video_Data *sd, Eina_Bool paused)
332{ 332{
333 if (emotion_object_play_get(sd->emotion) == !!play) return; 333 paused = !!paused;
334 /* can't pause if we're stopped */
335 if (sd->stop) return EINA_FALSE;
336 if (emotion_object_play_get(sd->emotion) == !paused) return EINA_TRUE;
334 337
335 if (play) 338 if (!paused)
336 { 339 {
337 ELM_SAFE_FREE(sd->timer, ecore_timer_del); 340 ELM_SAFE_FREE(sd->timer, ecore_timer_del);
338 sd->stop = EINA_FALSE;
339 emotion_object_play_set(sd->emotion, EINA_TRUE); 341 emotion_object_play_set(sd->emotion, EINA_TRUE);
340 342
341 if(elm_widget_is_legacy(obj)) 343 if(elm_widget_is_legacy(obj))
@@ -356,6 +358,7 @@ _efl_ui_video_efl_player_play_set(Eo *obj, Efl_Ui_Video_Data *sd, Eina_Bool play
356 else 358 else
357 elm_layout_signal_emit(obj, "efl,video,pause", "efl"); 359 elm_layout_signal_emit(obj, "efl,video,pause", "efl");
358 } 360 }
361 return EINA_TRUE;
359} 362}
360 363
361/* FIXME: stop should go into hibernate state directly. 364/* FIXME: stop should go into hibernate state directly.
@@ -397,9 +400,10 @@ _efl_ui_video_efl_player_playing_get(const Eo *obj EINA_UNUSED, Efl_Ui_Video_Dat
397} 400}
398 401
399EOLIAN static Eina_Bool 402EOLIAN static Eina_Bool
400_efl_ui_video_efl_player_play_get(const Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *sd) 403_efl_ui_video_efl_player_paused_get(const Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *sd)
401{ 404{
402 return emotion_object_play_get(sd->emotion); 405 /* pause is when !playing and !stopped */
406 return !emotion_object_play_get(sd->emotion) && !sd->stop;
403} 407}
404 408
405EOLIAN static const char* 409EOLIAN static const char*
@@ -533,13 +537,16 @@ elm_video_play_position_get(const Evas_Object *obj)
533EAPI Eina_Bool 537EAPI Eina_Bool
534elm_video_is_playing_get(Evas_Object *obj) 538elm_video_is_playing_get(Evas_Object *obj)
535{ 539{
536 return efl_player_play_get(obj); 540 return efl_player_playing_get(obj) && !efl_player_paused_get(obj);
537} 541}
538 542
539EAPI void 543EAPI void
540elm_video_play(Evas_Object *obj) 544elm_video_play(Evas_Object *obj)
541{ 545{
542 efl_player_play_set(obj, EINA_TRUE); 546 if (efl_player_playing_get(obj))
547 efl_player_paused_set(obj, EINA_FALSE);
548 else
549 efl_player_playing_set(obj, EINA_TRUE);
543} 550}
544 551
545EAPI void 552EAPI void
@@ -551,7 +558,7 @@ elm_video_stop(Evas_Object *obj)
551EAPI void 558EAPI void
552elm_video_pause(Evas_Object *obj) 559elm_video_pause(Evas_Object *obj)
553{ 560{
554 efl_player_play_set(obj, EINA_FALSE); 561 efl_player_paused_set(obj, EINA_TRUE);
555} 562}
556 563
557#include "efl_ui_video_legacy_eo.c" 564#include "efl_ui_video_legacy_eo.c"
diff --git a/src/lib/elementary/efl_ui_video.eo b/src/lib/elementary/efl_ui_video.eo
index 77a550c..d585a0c 100644
--- a/src/lib/elementary/efl_ui_video.eo
+++ b/src/lib/elementary/efl_ui_video.eo
@@ -44,6 +44,6 @@ class @beta Efl.Ui.Video extends Efl.Ui.Layout_Base
44 Efl.Ui.Widget.widget_input_event_handler; 44 Efl.Ui.Widget.widget_input_event_handler;
45 Efl.Access.Widget.Action.elm_actions { get; } 45 Efl.Access.Widget.Action.elm_actions { get; }
46 Efl.Player.playing { get; set; } 46 Efl.Player.playing { get; set; }
47 Efl.Player.play { get; set; } 47 Efl.Player.paused { get; set; }
48 } 48 }
49} 49}
diff --git a/src/lib/elementary/efl_ui_widget_image.h b/src/lib/elementary/efl_ui_widget_image.h
index 7c775f0..ad31ef3 100644
--- a/src/lib/elementary/efl_ui_widget_image.h
+++ b/src/lib/elementary/efl_ui_widget_image.h
@@ -96,7 +96,7 @@ struct _Efl_Ui_Image_Data
96 Eina_Bool edit : 1; 96 Eina_Bool edit : 1;
97 Eina_Bool edje : 1; 97 Eina_Bool edje : 1;
98 Eina_Bool anim : 1; 98 Eina_Bool anim : 1;
99 Eina_Bool play : 1; 99 Eina_Bool paused : 1;
100 Eina_Bool async_enable : 1; 100 Eina_Bool async_enable : 1;
101 Eina_Bool scale_up : 1; 101 Eina_Bool scale_up : 1;
102 Eina_Bool scale_down : 1; 102 Eina_Bool scale_down : 1;
diff --git a/src/lib/emotion/efl_canvas_video.eo b/src/lib/emotion/efl_canvas_video.eo
index d8bb286..21bb8a3 100644
--- a/src/lib/emotion/efl_canvas_video.eo
+++ b/src/lib/emotion/efl_canvas_video.eo
@@ -57,7 +57,8 @@ class @beta Efl.Canvas.Video extends Efl.Canvas.Group
57 Efl.File.unload; 57 Efl.File.unload;
58 Efl.File.file { set; } 58 Efl.File.file { set; }
59 Efl.File.loaded { get; } 59 Efl.File.loaded { get; }
60 Efl.Player.play { get; set; } 60 Efl.Player.playing { get; set; }
61 Efl.Player.paused { get; set; }
61 Efl.Player.playback_position { get; set; } 62 Efl.Player.playback_position { get; set; }
62 Efl.Player.progress { get; } 63 Efl.Player.progress { get; }
63 Efl.Audio_Control.volume { get; set; } 64 Efl.Audio_Control.volume { get; set; }
diff --git a/src/lib/emotion/emotion_smart.c b/src/lib/emotion/emotion_smart.c
index e5183ea..5569e54 100644
--- a/src/lib/emotion/emotion_smart.c
+++ b/src/lib/emotion/emotion_smart.c
@@ -116,6 +116,7 @@ struct _Efl_Canvas_Video_Data
116 116
117 Eina_Bool open : 1; 117 Eina_Bool open : 1;
118 Eina_Bool play : 1; 118 Eina_Bool play : 1;
119 Eina_Bool pause : 1;
119 Eina_Bool remember_play : 1; 120 Eina_Bool remember_play : 1;
120 Eina_Bool seek : 1; 121 Eina_Bool seek : 1;
121 Eina_Bool seeking : 1; 122 Eina_Bool seeking : 1;
@@ -645,40 +646,85 @@ emotion_object_keep_aspect_get(const Evas_Object *obj)
645EAPI void 646EAPI void
646emotion_object_play_set(Evas_Object *obj, Eina_Bool play) 647emotion_object_play_set(Evas_Object *obj, Eina_Bool play)
647{ 648{
648 efl_player_play_set(obj, play); 649 /* avoid calling playback_position_set(0) for legacy */
650 if (play)
651 efl_player_playing_set(obj, EINA_TRUE);
652 efl_player_paused_set(obj, !play);
649} 653}
650 654
651EOLIAN static void 655EOLIAN static Eina_Bool
652_efl_canvas_video_efl_player_play_set(Eo *obj, Efl_Canvas_Video_Data *sd, Eina_Bool play) 656_efl_canvas_video_efl_player_playing_set(Eo *obj, Efl_Canvas_Video_Data *sd, Eina_Bool play)
653{ 657{
658 play = !!play;
654 DBG("play=" FMT_UCHAR ", was=" FMT_UCHAR, play, sd->play); 659 DBG("play=" FMT_UCHAR ", was=" FMT_UCHAR, play, sd->play);
655 if (!sd->engine_instance) return; 660 if (!sd->engine_instance) return EINA_FALSE;
661 /* always unset pause if playing is false */
662 if (!play) sd->pause = EINA_FALSE;
656 if (!sd->open) 663 if (!sd->open)
657 { 664 {
658 sd->remember_play = play; 665 sd->remember_play = play;
659 return; 666 return EINA_TRUE;
660 } 667 }
661 if (play == sd->play) return; 668 if (play == sd->play) return EINA_TRUE;
662 sd->play = play; 669 sd->play = play;
663 sd->remember_play = play; 670 sd->remember_play = play;
664 if (sd->state != EMOTION_WAKEUP) emotion_object_suspend_set(obj, EMOTION_WAKEUP); 671 if (sd->state != EMOTION_WAKEUP) emotion_object_suspend_set(obj, EMOTION_WAKEUP);
665 if (sd->play) emotion_engine_instance_play(sd->engine_instance, sd->pos); 672 if (sd->play) emotion_engine_instance_play(sd->engine_instance, 0.0);
666 else emotion_engine_instance_stop(sd->engine_instance); 673 else
674 {
675 emotion_engine_instance_stop(sd->engine_instance);
676 efl_player_playback_position_set(obj, 0.0);
677 }
678 return EINA_TRUE;
679}
680
681EOLIAN static Eina_Bool
682_efl_canvas_video_efl_player_paused_set(Eo *obj, Efl_Canvas_Video_Data *sd, Eina_Bool paused)
683{
684 paused = !!paused;
685 DBG("paused=" FMT_UCHAR ", was=" FMT_UCHAR, paused, sd->pause);
686 if (!sd->engine_instance) return EINA_FALSE;
687 if (!sd->open)
688 {
689 /* queue pause */
690 if (sd->remember_play)
691 sd->pause = paused;
692 return sd->remember_play;
693 }
694 if (!sd->play) return EINA_FALSE;
695 if (paused == sd->pause) return EINA_TRUE;
696 sd->pause = paused;
697 if (sd->pause)
698 emotion_engine_instance_stop(sd->engine_instance);
699 else
700 {
701 if (sd->state != EMOTION_WAKEUP) emotion_object_suspend_set(obj, EMOTION_WAKEUP);
702 emotion_engine_instance_play(sd->engine_instance, sd->pos);
703 }
704 return EINA_TRUE;
667} 705}
668 706
669EAPI Eina_Bool 707EAPI Eina_Bool
670emotion_object_play_get(const Evas_Object *obj) 708emotion_object_play_get(const Evas_Object *obj)
671{ 709{
672 return efl_player_play_get(obj); 710 return efl_player_playing_get(obj) && !efl_player_paused_get(obj);
673} 711}
674 712
675EOLIAN static Eina_Bool 713EOLIAN static Eina_Bool
676_efl_canvas_video_efl_player_play_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd) 714_efl_canvas_video_efl_player_playing_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd)
677{ 715{
678 if (!sd->engine_instance) return EINA_FALSE; 716 if (!sd->engine_instance) return EINA_FALSE;
679 return sd->play; 717 return sd->play;
680} 718}
681 719
720EOLIAN static Eina_Bool
721_efl_canvas_video_efl_player_paused_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd)
722{
723 if (!sd->engine_instance) return EINA_FALSE;
724 if (!sd->play) return EINA_FALSE;
725 return sd->pause;
726}
727
682EAPI void 728EAPI void
683emotion_object_position_set(Evas_Object *obj, double sec) 729emotion_object_position_set(Evas_Object *obj, double sec)
684{ 730{
@@ -1632,7 +1678,12 @@ _emotion_open_done(Evas_Object *obj)
1632 if (!EINA_DBL_EQ(sd->remember_jump, 0.0)) 1678 if (!EINA_DBL_EQ(sd->remember_jump, 0.0))
1633 emotion_object_position_set(obj, sd->remember_jump); 1679 emotion_object_position_set(obj, sd->remember_jump);
1634 if (sd->remember_play != sd->play) 1680 if (sd->remember_play != sd->play)
1635 emotion_object_play_set(obj, sd->remember_play); 1681 {
1682 if (sd->pause)
1683 sd->play = sd->remember_play;
1684 else
1685 emotion_object_play_set(obj, sd->remember_play);
1686 }
1636 efl_event_callback_call(obj, EFL_CANVAS_VIDEO_EVENT_OPEN_DONE, NULL); 1687 efl_event_callback_call(obj, EFL_CANVAS_VIDEO_EVENT_OPEN_DONE, NULL);
1637 evas_object_smart_callback_call(obj, "open_done", NULL); 1688 evas_object_smart_callback_call(obj, "open_done", NULL);
1638} 1689}
diff --git a/src/lib/evas/canvas/efl_canvas_animation_player.c b/src/lib/evas/canvas/efl_canvas_animation_player.c
index 981ece8..45c3be5 100644
--- a/src/lib/evas/canvas/efl_canvas_animation_player.c
+++ b/src/lib/evas/canvas/efl_canvas_animation_player.c
@@ -222,35 +222,25 @@ _player_stop(Eo *eo_obj, Efl_Canvas_Animation_Player_Data *pd, Efl_Canvas_Animat
222 //Reset the state of the target to the initial state 222 //Reset the state of the target to the initial state
223 efl_gfx_mapping_reset(efl_animation_player_target_get(eo_obj)); 223 efl_gfx_mapping_reset(efl_animation_player_target_get(eo_obj));
224 224
225 Eina_Bool play = efl_player_play_get(eo_obj); 225 if (efl_animation_final_state_keep_get(anim))
226 if (play)
227 { 226 {
228 efl_player_play_set(eo_obj, EINA_FALSE); 227 if (_is_final_state(anim, pd->progress))
229 if (efl_animation_final_state_keep_get(anim))
230 { 228 {
231 if (_is_final_state(anim, pd->progress)) 229 /* Keep the final state only if efl_player_playing_set(EINA_FALSE) is called at
232 { 230 * the end of _animator_cb. */
233 /* Keep the final state only if efl_player_stop is called at 231 efl_animation_apply(anim, pd->progress,
234 * the end of _animator_cb. */ 232 efl_animation_player_target_get(eo_obj));
235 efl_animation_apply(anim, pd->progress,
236 efl_animation_player_target_get(eo_obj));
237 }
238 else
239 {
240 pd->progress = 0.0;
241 }
242 } 233 }
243 else 234 else
244 { 235 {
245 pd->progress = 0.0; 236 pd->progress = 0.0;
246 } 237 }
247 efl_event_callback_call(eo_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, NULL);
248 } 238 }
249 else 239 else
250 { 240 {
251 pd->progress = 0.0; 241 pd->progress = 0.0;
252 } 242 }
253 243 efl_event_callback_call(eo_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, NULL);
254 if (pd->auto_del) efl_del(eo_obj); 244 if (pd->auto_del) efl_del(eo_obj);
255} 245}
256 246
@@ -266,6 +256,8 @@ _efl_canvas_animation_player_efl_player_playing_set(Eo *eo_obj, Efl_Canvas_Anima
266 pd->is_play = !!playing; 256 pd->is_play = !!playing;
267 if (!playing) 257 if (!playing)
268 { 258 {
259 if (!pd->is_play) return EINA_TRUE;
260 pd->is_paused = EINA_FALSE;
269 _player_stop(eo_obj, pd, anim); 261 _player_stop(eo_obj, pd, anim);
270 return EINA_TRUE; 262 return EINA_TRUE;
271 } 263 }
@@ -290,19 +282,20 @@ _efl_canvas_animation_player_efl_player_playing_get(const Eo *eo_obj EINA_UNUSED
290 return pd->is_play; 282 return pd->is_play;
291} 283}
292 284
293EOLIAN static void 285EOLIAN static Eina_Bool
294_efl_canvas_animation_player_efl_player_play_set(Eo *eo_obj, 286_efl_canvas_animation_player_efl_player_paused_set(Eo *eo_obj,
295 Efl_Canvas_Animation_Player_Data *pd, 287 Efl_Canvas_Animation_Player_Data *pd,
296 Eina_Bool play) 288 Eina_Bool paused)
297{ 289{
298 if (efl_player_play_get(eo_obj) == !!play) 290 paused = !!paused;
299 return; 291 /* can't pause if not playing */
300 292 if (!pd->is_play) return EINA_FALSE;
301 pd->is_play = play; 293 if (pd->is_paused == paused) return EINA_TRUE;
302 if (play) 294 pd->is_paused = paused;
295 if (!paused)
303 { 296 {
304 //TODO: check this case is correct. 297 //TODO: check this case is correct.
305 if (pd->start_delay_timer) return; 298 if (pd->start_delay_timer) return EINA_FALSE;
306 299
307 pd->time.prev = ecore_loop_time_get(); 300 pd->time.prev = ecore_loop_time_get();
308 pd->animator = ecore_evas_animator_add(pd->target, _animator_cb, eo_obj); 301 pd->animator = ecore_evas_animator_add(pd->target, _animator_cb, eo_obj);
@@ -316,13 +309,14 @@ _efl_canvas_animation_player_efl_player_play_set(Eo *eo_obj,
316 ecore_animator_del(pd->animator); 309 ecore_animator_del(pd->animator);
317 pd->animator = NULL; 310 pd->animator = NULL;
318 } 311 }
312 return EINA_TRUE;
319} 313}
320 314
321EOLIAN static Eina_Bool 315EOLIAN static Eina_Bool
322_efl_canvas_animation_player_efl_player_play_get(const Eo *eo_obj EINA_UNUSED, 316_efl_canvas_animation_player_efl_player_paused_get(const Eo *eo_obj EINA_UNUSED,
323 Efl_Canvas_Animation_Player_Data *pd) 317 Efl_Canvas_Animation_Player_Data *pd)
324{ 318{
325 return pd->is_play; 319 return pd->is_paused;
326} 320}
327 321
328EOLIAN static Eina_Bool 322EOLIAN static Eina_Bool
diff --git a/src/lib/evas/canvas/efl_canvas_animation_player.eo b/src/lib/evas/canvas/efl_canvas_animation_player.eo
index 57e13f1..4bcdf60 100644
--- a/src/lib/evas/canvas/efl_canvas_animation_player.eo
+++ b/src/lib/evas/canvas/efl_canvas_animation_player.eo
@@ -36,7 +36,7 @@ class @beta Efl.Canvas.Animation_Player extends Efl.Object implements Efl.Player
36 Efl.Object.constructor; 36 Efl.Object.constructor;
37 Efl.Object.destructor; 37 Efl.Object.destructor;
38 Efl.Player.playing { get; set; } 38 Efl.Player.playing { get; set; }
39 Efl.Player.play { get; set; } 39 Efl.Player.paused { get; set; }
40 Efl.Playable.playable { get; } 40 Efl.Playable.playable { get; }
41 Efl.Player.playback_position { get; set; } 41 Efl.Player.playback_position { get; set; }
42 Efl.Player.progress { get;} 42 Efl.Player.progress { get;}
diff --git a/src/lib/evas/canvas/efl_canvas_animation_player_private.h b/src/lib/evas/canvas/efl_canvas_animation_player_private.h
index f0128aa..aff74db 100644
--- a/src/lib/evas/canvas/efl_canvas_animation_player_private.h
+++ b/src/lib/evas/canvas/efl_canvas_animation_player_private.h
@@ -41,6 +41,7 @@ typedef struct _Efl_Canvas_Animation_Player_Data
41 41
42 Eina_Bool auto_del : 1; 42 Eina_Bool auto_del : 1;
43 Eina_Bool is_play : 1; 43 Eina_Bool is_play : 1;
44 Eina_Bool is_paused : 1;
44 Eina_Bool keep_final_state : 1; 45 Eina_Bool keep_final_state : 1;
45 Eina_Bool is_direction_forward : 1; 46 Eina_Bool is_direction_forward : 1;
46} Efl_Canvas_Animation_Player_Data; 47} Efl_Canvas_Animation_Player_Data;
diff --git a/src/lib/evas/canvas/evas_object_intercept.c b/src/lib/evas/canvas/evas_object_intercept.c
index 5729493..9911a5b 100644
--- a/src/lib/evas/canvas/evas_object_intercept.c
+++ b/src/lib/evas/canvas/evas_object_intercept.c
@@ -107,7 +107,7 @@ _evas_object_intercept_call_internal(Evas_Object *eo_obj,
107 /* If show is called during hide animation is running, then the 107 /* If show is called during hide animation is running, then the
108 * current hide animation is cancelled and show operation is 108 * current hide animation is cancelled and show operation is
109 * proceeded. */ 109 * proceeded. */
110 if ((!obj->anim_player) || (!efl_player_play_get(obj->anim_player))) 110 if ((!obj->anim_player) || (!efl_player_playing_get(obj->anim_player)))
111 return 1; 111 return 1;
112 } 112 }
113 if (!obj->interceptors) return 0; 113 if (!obj->interceptors) return 0;