summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunsuChoi <jsuya.choi@samsung.com>2020-01-28 16:36:33 +0100
committerXavi Artigas <xavierartigas@yahoo.es>2020-01-28 16:56:04 +0100
commit7e7496f25a37957ed2c249f6c7eab088c819ff5a (patch)
tree1c59ec7454dfd009f86b8c4dcc8ea171c47083b7
parent897f27eff407638f8b6979951eed32284737e6a0 (diff)
Efl.Player: Move autoplay/playback_loop from Efl.Ui.Vg_Animation
Summary: Move autoplay and playback_loop method from Efl.Ui.Vg_Animation/ and The playback_loop changed from looping because it conflict with the efl_ui_scrollable's symbol. Efl.Ui.Image and Efl.Ui.Image_Zoomable is needed implements about this method. So it temporarily set the @empty marker. ref T8476 Test Plan: elementary_test -to "Vector Graphics Animation" check to 'loop' Reviewers: Hermet, bu5hm4n, zmike, Jaehyun_Cho, jsuya Reviewed By: zmike Subscribers: cedric, #reviewers, #committers, woohyun, kimcinoo Tags: #efl Maniphest Tasks: T8476 Differential Revision: https://phab.enlightenment.org/D11212
-rw-r--r--src/bin/elementary/test_efl_gfx_vg_value_provider.c2
-rw-r--r--src/bin/elementary/test_efl_ui_vg_animation.c2
-rw-r--r--src/lib/efl/interfaces/efl_player.eo39
-rw-r--r--src/lib/elementary/efl_ui_image.eo2
-rw-r--r--src/lib/elementary/efl_ui_image_zoomable.c1
-rw-r--r--src/lib/elementary/efl_ui_image_zoomable.eo2
-rw-r--r--src/lib/elementary/efl_ui_vg_animation.c20
-rw-r--r--src/lib/elementary/efl_ui_vg_animation.eo40
-rw-r--r--src/lib/elementary/efl_ui_vg_animation_eo.legacy.c8
-rw-r--r--src/lib/elementary/efl_ui_vg_animation_private.h2
-rw-r--r--src/tests/elementary/efl_ui_test_vg_animation.c8
11 files changed, 66 insertions, 60 deletions
diff --git a/src/bin/elementary/test_efl_gfx_vg_value_provider.c b/src/bin/elementary/test_efl_gfx_vg_value_provider.c
index 5127bb0eb2..c6f3189908 100644
--- a/src/bin/elementary/test_efl_gfx_vg_value_provider.c
+++ b/src/bin/elementary/test_efl_gfx_vg_value_provider.c
@@ -159,7 +159,7 @@ static void
159check_changed_cb(void *data, const Efl_Event *event) 159check_changed_cb(void *data, const Efl_Event *event)
160{ 160{
161 Evas_Object *anim_view = data; 161 Evas_Object *anim_view = data;
162 efl_ui_vg_animation_looping_set(anim_view, efl_ui_selectable_selected_get(event->object)); 162 efl_player_playback_loop_set(anim_view, efl_ui_selectable_selected_get(event->object));
163} 163}
164 164
165static void 165static void
diff --git a/src/bin/elementary/test_efl_ui_vg_animation.c b/src/bin/elementary/test_efl_ui_vg_animation.c
index 5d943a795f..a54a816bf1 100644
--- a/src/bin/elementary/test_efl_ui_vg_animation.c
+++ b/src/bin/elementary/test_efl_ui_vg_animation.c
@@ -52,7 +52,7 @@ static void
52check_changed_cb(void *data, const Efl_Event *event) 52check_changed_cb(void *data, const Efl_Event *event)
53{ 53{
54 Evas_Object *anim_view = data; 54 Evas_Object *anim_view = data;
55 efl_ui_vg_animation_looping_set(anim_view, efl_ui_selectable_selected_get(event->object)); 55 efl_player_playback_loop_set(anim_view, efl_ui_selectable_selected_get(event->object));
56} 56}
57 57
58static void 58static void
diff --git a/src/lib/efl/interfaces/efl_player.eo b/src/lib/efl/interfaces/efl_player.eo
index 90717ff7a3..82411fa7f4 100644
--- a/src/lib/efl/interfaces/efl_player.eo
+++ b/src/lib/efl/interfaces/efl_player.eo
@@ -93,6 +93,45 @@ interface Efl.Player
93 speed: double; [[The play speed in the [0, infinity) range.]] 93 speed: double; [[The play speed in the [0, infinity) range.]]
94 } 94 }
95 } 95 }
96 @property autoplay {
97 [[When $true, playback will start as soon as the media is ready.
98
99 This means that the media file has been successfully loaded and the
100 object is visible.
101
102 If the object becomes invisible later on the playback is paused,
103 resuming when it is visible again.
104
105 Changing this property affects the next media being loaded,
106 so set it before setting the media file.
107
108 @since 1.24
109 ]]
110 set {
111 }
112 get {
113 }
114 values {
115 autoplay: bool; [[Auto play mode, Default is $false.]]
116 }
117 }
118 @property playback_loop {
119 [[Enable playback looping.
120
121 When $true, playback continues from the beginning when it reaches the last frame.
122 Otherwise, playback stops.
123 This works both when playing forward and backward.
124
125 @since 1.24
126 ]]
127 set {
128 }
129 get {
130 }
131 values {
132 looping: bool; [[Loop mode, Default is $false.]]
133 }
134 }
96 } 135 }
97 events { 136 events {
98 playing,changed: bool; [[Called when the playing state has changed. The event value reflects the current state. @since 1.24]] 137 playing,changed: bool; [[Called when the playing state has changed. The event value reflects the current state. @since 1.24]]
diff --git a/src/lib/elementary/efl_ui_image.eo b/src/lib/elementary/efl_ui_image.eo
index 0cabaa0290..f358500a57 100644
--- a/src/lib/elementary/efl_ui_image.eo
+++ b/src/lib/elementary/efl_ui_image.eo
@@ -105,6 +105,8 @@ class Efl.Ui.Image extends Efl.Ui.Widget implements Efl.Input.Clickable, Efl.Ui.
105 Efl.Player.playback_position { get; set; } 105 Efl.Player.playback_position { get; set; }
106 Efl.Player.playback_progress { get; set; } 106 Efl.Player.playback_progress { get; set; }
107 Efl.Player.playback_speed { get; set; } 107 Efl.Player.playback_speed { get; set; }
108 @empty Efl.Player.autoplay { set; get; }
109 @empty Efl.Player.playback_loop { set; get; }
108 Efl.Layout.Signal.signal_emit; 110 Efl.Layout.Signal.signal_emit;
109 Efl.Layout.Signal.message_send; 111 Efl.Layout.Signal.message_send;
110 Efl.Layout.Signal.signal_callback_add; 112 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 7d4f5d072a..478dbb4117 100644
--- a/src/lib/elementary/efl_ui_image_zoomable.c
+++ b/src/lib/elementary/efl_ui_image_zoomable.c
@@ -3171,7 +3171,6 @@ _efl_ui_image_zoomable_efl_player_playback_progress_set(Eo *obj EINA_UNUSED, Efl
3171 sd->cur_frame = 0; 3171 sd->cur_frame = 0;
3172} 3172}
3173 3173
3174
3175EOLIAN static void 3174EOLIAN static void
3176_efl_ui_image_zoomable_class_constructor(Efl_Class *klass EINA_UNUSED) 3175_efl_ui_image_zoomable_class_constructor(Efl_Class *klass EINA_UNUSED)
3177{ 3176{
diff --git a/src/lib/elementary/efl_ui_image_zoomable.eo b/src/lib/elementary/efl_ui_image_zoomable.eo
index e27eb82c13..64dc7a57b7 100644
--- a/src/lib/elementary/efl_ui_image_zoomable.eo
+++ b/src/lib/elementary/efl_ui_image_zoomable.eo
@@ -52,6 +52,8 @@ class Efl.Ui.Image_Zoomable extends Efl.Ui.Image implements Efl.Ui.Zoom
52 Efl.Player.playback_position { get; set; } 52 Efl.Player.playback_position { get; set; }
53 Efl.Player.playback_progress { get; set; } 53 Efl.Player.playback_progress { get; set; }
54 Efl.Player.playback_speed { get; set; } 54 Efl.Player.playback_speed { get; set; }
55 @empty Efl.Player.autoplay { set; get; }
56 @empty Efl.Player.playback_loop { set; get; }
55 Efl.Ui.Zoom.zoom_animation { set; get; } 57 Efl.Ui.Zoom.zoom_animation { set; get; }
56 Efl.Ui.Zoom.zoom_level { set; get; } 58 Efl.Ui.Zoom.zoom_level { set; get; }
57 Efl.Ui.Zoom.zoom_mode { set; get; } 59 Efl.Ui.Zoom.zoom_mode { set; get; }
diff --git a/src/lib/elementary/efl_ui_vg_animation.c b/src/lib/elementary/efl_ui_vg_animation.c
index e723a922a4..83f666fdd0 100644
--- a/src/lib/elementary/efl_ui_vg_animation.c
+++ b/src/lib/elementary/efl_ui_vg_animation.c
@@ -217,7 +217,7 @@ _transit_cb(Elm_Transit_Effect *effect, Elm_Transit *transit, double progress)
217 217
218 evas_object_vg_animated_frame_set(pd->vg, update_frame); 218 evas_object_vg_animated_frame_set(pd->vg, update_frame);
219 219
220 if (pd->looping) 220 if (pd->loop)
221 { 221 {
222 int repeat_times = elm_transit_current_repeat_times_get(pd->transit); 222 int repeat_times = elm_transit_current_repeat_times_get(pd->transit);
223 if (pd->repeat_times != repeat_times) 223 if (pd->repeat_times != repeat_times)
@@ -327,7 +327,7 @@ _ready_play(Eo *obj, Efl_Ui_Vg_Animation_Data *pd)
327 double speed = pd->playback_speed < 0 ? pd->playback_speed * -1 : pd->playback_speed; 327 double speed = pd->playback_speed < 0 ? pd->playback_speed * -1 : pd->playback_speed;
328 Elm_Transit *transit = elm_transit_add(); 328 Elm_Transit *transit = elm_transit_add();
329 elm_transit_object_add(transit, pd->vg); 329 elm_transit_object_add(transit, pd->vg);
330 if (pd->looping) elm_transit_repeat_times_set(transit, -1); 330 if (pd->loop) elm_transit_repeat_times_set(transit, -1);
331 elm_transit_effect_add(transit, _transit_cb, obj, _transit_del_cb); 331 elm_transit_effect_add(transit, _transit_cb, obj, _transit_del_cb);
332 elm_transit_progress_value_set(transit, pd->progress); 332 elm_transit_progress_value_set(transit, pd->progress);
333 elm_transit_objects_final_state_keep_set(transit, EINA_TRUE); 333 elm_transit_objects_final_state_keep_set(transit, EINA_TRUE);
@@ -462,25 +462,25 @@ _efl_ui_vg_animation_efl_gfx_view_view_size_get(const Eo *obj EINA_UNUSED,
462} 462}
463 463
464EOLIAN static void 464EOLIAN static void
465_efl_ui_vg_animation_looping_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, Eina_Bool looping) 465_efl_ui_vg_animation_efl_player_playback_loop_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, Eina_Bool loop)
466{ 466{
467 if (pd->looping == looping) return; 467 if (pd->loop == loop) return;
468 pd->looping = looping; 468 pd->loop = loop;
469 if (pd->transit) 469 if (pd->transit)
470 { 470 {
471 if (looping) elm_transit_repeat_times_set(pd->transit, -1); 471 if (loop) elm_transit_repeat_times_set(pd->transit, -1);
472 else elm_transit_repeat_times_set(pd->transit, 0); 472 else elm_transit_repeat_times_set(pd->transit, 0);
473 } 473 }
474} 474}
475 475
476EOLIAN static Eina_Bool 476EOLIAN static Eina_Bool
477_efl_ui_vg_animation_looping_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd) 477_efl_ui_vg_animation_efl_player_playback_loop_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
478{ 478{
479 return pd->looping; 479 return pd->loop;
480} 480}
481 481
482EOLIAN static void 482EOLIAN static void
483_efl_ui_vg_animation_autoplay_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, 483_efl_ui_vg_animation_efl_player_autoplay_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd,
484 Eina_Bool autoplay) 484 Eina_Bool autoplay)
485{ 485{
486 pd->autoplay = autoplay; 486 pd->autoplay = autoplay;
@@ -488,7 +488,7 @@ _efl_ui_vg_animation_autoplay_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data
488} 488}
489 489
490EOLIAN static Eina_Bool 490EOLIAN static Eina_Bool
491_efl_ui_vg_animation_autoplay_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd) 491_efl_ui_vg_animation_efl_player_autoplay_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
492{ 492{
493 return pd->autoplay; 493 return pd->autoplay;
494} 494}
diff --git a/src/lib/elementary/efl_ui_vg_animation.eo b/src/lib/elementary/efl_ui_vg_animation.eo
index 9c44a93665..d87055a83b 100644
--- a/src/lib/elementary/efl_ui_vg_animation.eo
+++ b/src/lib/elementary/efl_ui_vg_animation.eo
@@ -25,44 +25,6 @@ class @beta Efl.Ui.Vg_Animation extends Efl.Ui.Widget implements Efl.Gfx.View, E
25 ]] 25 ]]
26 event_c_prefix: efl_ui_vg_animation; 26 event_c_prefix: efl_ui_vg_animation;
27 methods { 27 methods {
28 @property autoplay {
29 [[Animation will be started automatically when it's possible.
30
31 If @.autoplay is $true, animation will be started when it's readied.
32 The condition of $auto play is when vg animation opened file successfully,
33 yet to play it plus when the object is visible.
34 If vg animation is disabled, invisible,
35 it turns to pause state then resume animation when it's visible again.
36
37 $true Enable auto play mode, disable otherwise.
38
39 Warning: This auto play will be only affected to the next animation source.
40 So must be called before setting animation file.
41 ]]
42 set {
43 }
44 get {
45 }
46 values {
47 autoplay: bool(false); [[Auto play mode.]]
48 }
49 }
50 @property looping {
51 [[Turn on/off animation looping.
52
53 When $true, animation is restarted when it reaches the last frame.
54 This works both when playing forward and backward.
55
56 $true Enable loop mode, disable otherwise.
57 ]]
58 set {
59 }
60 get {
61 }
62 values {
63 looping: bool; [[Loop mode, Default is $false.]]
64 }
65 }
66 @property frame { 28 @property frame {
67 [[Number of current frame. 29 [[Number of current frame.
68 30
@@ -203,5 +165,7 @@ class @beta Efl.Ui.Vg_Animation extends Efl.Ui.Widget implements Efl.Gfx.View, E
203 Efl.Playable.length { get; } 165 Efl.Playable.length { get; }
204 Efl.Playable.playable { get; } 166 Efl.Playable.playable { get; }
205 Efl.Playable.seekable { get; } 167 Efl.Playable.seekable { get; }
168 Efl.Player.autoplay { set; get; }
169 Efl.Player.playback_loop { set; get; }
206 } 170 }
207} 171}
diff --git a/src/lib/elementary/efl_ui_vg_animation_eo.legacy.c b/src/lib/elementary/efl_ui_vg_animation_eo.legacy.c
index 78c24cfe11..40b0b8fe81 100644
--- a/src/lib/elementary/efl_ui_vg_animation_eo.legacy.c
+++ b/src/lib/elementary/efl_ui_vg_animation_eo.legacy.c
@@ -2,25 +2,25 @@
2EAPI void 2EAPI void
3elm_animation_view_auto_play_set(Efl_Ui_Vg_Animation *obj, Eina_Bool auto_play) 3elm_animation_view_auto_play_set(Efl_Ui_Vg_Animation *obj, Eina_Bool auto_play)
4{ 4{
5 efl_ui_vg_animation_autoplay_set(obj, auto_play); 5 efl_player_autoplay_set(obj, auto_play);
6} 6}
7 7
8EAPI Eina_Bool 8EAPI Eina_Bool
9elm_animation_view_auto_play_get(const Efl_Ui_Vg_Animation *obj) 9elm_animation_view_auto_play_get(const Efl_Ui_Vg_Animation *obj)
10{ 10{
11 return efl_ui_vg_animation_autoplay_get(obj); 11 return efl_player_autoplay_get(obj);
12} 12}
13 13
14EAPI void 14EAPI void
15elm_animation_view_auto_repeat_set(Efl_Ui_Vg_Animation *obj, Eina_Bool autorepeat) 15elm_animation_view_auto_repeat_set(Efl_Ui_Vg_Animation *obj, Eina_Bool autorepeat)
16{ 16{
17 efl_ui_vg_animation_looping_set(obj, autorepeat); 17 efl_player_playback_loop_set(obj, autorepeat);
18} 18}
19 19
20EAPI Eina_Bool 20EAPI Eina_Bool
21elm_animation_view_auto_repeat_get(const Efl_Ui_Vg_Animation *obj) 21elm_animation_view_auto_repeat_get(const Efl_Ui_Vg_Animation *obj)
22{ 22{
23 return efl_ui_vg_animation_looping_get(obj); 23 return efl_player_playback_loop_get(obj);
24} 24}
25 25
26EAPI Eina_Bool 26EAPI Eina_Bool
diff --git a/src/lib/elementary/efl_ui_vg_animation_private.h b/src/lib/elementary/efl_ui_vg_animation_private.h
index 98304f39ad..6629e43c62 100644
--- a/src/lib/elementary/efl_ui_vg_animation_private.h
+++ b/src/lib/elementary/efl_ui_vg_animation_private.h
@@ -24,7 +24,7 @@ struct _Efl_Ui_Vg_Animation_Data
24 Eina_Bool playing_reverse : 1; 24 Eina_Bool playing_reverse : 1;
25 Eina_Bool autoplay : 1; 25 Eina_Bool autoplay : 1;
26 Eina_Bool autoplay_pause: 1; 26 Eina_Bool autoplay_pause: 1;
27 Eina_Bool looping : 1; 27 Eina_Bool loop : 1;
28 Eina_Bool playback_direction_changed : 1; 28 Eina_Bool playback_direction_changed : 1;
29}; 29};
30 30
diff --git a/src/tests/elementary/efl_ui_test_vg_animation.c b/src/tests/elementary/efl_ui_test_vg_animation.c
index 2da7d0fbde..2909ede100 100644
--- a/src/tests/elementary/efl_ui_test_vg_animation.c
+++ b/src/tests/elementary/efl_ui_test_vg_animation.c
@@ -50,12 +50,12 @@ EFL_START_TEST(vg_anim_playing_control)
50 ck_assert_int_eq(efl_ui_vg_animation_state_get(vg_anim), EFL_UI_VG_ANIMATION_STATE_STOPPED); 50 ck_assert_int_eq(efl_ui_vg_animation_state_get(vg_anim), EFL_UI_VG_ANIMATION_STATE_STOPPED);
51 51
52 // Auto repeat 52 // Auto repeat
53 efl_ui_vg_animation_looping_set(vg_anim, EINA_TRUE); 53 efl_player_playback_loop_set(vg_anim, EINA_TRUE);
54 ck_assert_int_eq(efl_ui_vg_animation_looping_get(vg_anim), EINA_TRUE); 54 ck_assert_int_eq(efl_player_playback_loop_get(vg_anim), EINA_TRUE);
55 55
56 // Auto play 56 // Auto play
57 efl_ui_vg_animation_autoplay_set(vg_anim, EINA_TRUE); 57 efl_player_autoplay_set(vg_anim, EINA_TRUE);
58 ck_assert_int_eq(efl_ui_vg_animation_autoplay_get(vg_anim), EINA_TRUE); 58 ck_assert_int_eq(efl_player_autoplay_get(vg_anim), EINA_TRUE);
59} 59}
60EFL_END_TEST 60EFL_END_TEST
61 61