diff --git a/src/lib/elementary/efl_ui_animation_view.c b/src/lib/elementary/efl_ui_animation_view.c index 82aba0f3c4..074ebfdf8d 100644 --- a/src/lib/elementary/efl_ui_animation_view.c +++ b/src/lib/elementary/efl_ui_animation_view.c @@ -468,6 +468,37 @@ _efl_ui_animation_view_play(Eo *obj, Efl_Ui_Animation_View_Data *pd) return EINA_TRUE; } +Eina_Bool _efl_ui_animation_view_play_sector(Eo *obj, Efl_Ui_Animation_View_Data *pd, const char *start, const char *end) +{ + int start_frame = 0; + int end_frame = evas_object_vg_animated_frame_count_get(pd->vg) - 1; + + if (start && end) + { + efl_gfx_frame_controller_sector_get(pd->vg, start, &start_frame, NULL); + efl_gfx_frame_controller_sector_get(pd->vg, end, &end_frame, NULL); + } + else + { + if (start) + { + efl_gfx_frame_controller_sector_get(pd->vg, start, &start_frame, &end_frame); + } + else if (end) + { + efl_gfx_frame_controller_sector_get(pd->vg, end, &end_frame, NULL); + } + } + + efl_ui_animation_view_min_frame_set(obj, start_frame); + if (start_frame < end_frame) + efl_ui_animation_view_max_frame_set(obj, end_frame); + + if (!efl_ui_animation_view_play(obj)) + return EINA_FALSE; + return EINA_TRUE; +} + EOLIAN static Eina_Bool _efl_ui_animation_view_stop(Eo *obj, Efl_Ui_Animation_View_Data *pd) { diff --git a/src/lib/elementary/efl_ui_animation_view.eo b/src/lib/elementary/efl_ui_animation_view.eo index 2d090bbee7..f06c9b1ce2 100644 --- a/src/lib/elementary/efl_ui_animation_view.eo +++ b/src/lib/elementary/efl_ui_animation_view.eo @@ -135,6 +135,25 @@ class @beta Efl.Ui.Animation_View extends Efl.Ui.Widget implements Efl.Gfx.View, return: bool; [[$true when it's successful. $false otherwise.]] } + play_sector { + [[Play animation of sector one time instantly when it's available. + + If end sector is NULL, only start sector is referenced. + If both the start and end sectors are valid, + Play is played and stoped at starting point of each sector. + + If start is null and end is valid, playback starts from 0 frame to the start frame of the end sector. + If both sectors start and end are invalid. Play from 0 frame to the last frame of animation view object. + + Note: This method use to @.min_frame, @.max_frame (@.min_progress, @.max_progress) internally. + So if you have changed the min or max frame(progress) it can be changed to the sector frame. + ]] + params { + @in start: string; [[ The name of start sector ]] + @in end: string; [[ The name of end sector ]] + } + return: bool; [[$true when it's successful. $false otherwise.]] + } play_back { [[Play back animation one time instantly when it's available.