//Duration Text
- snprintf(buf, sizeof(buf), "Duration: %1.2fs", efl_ui_vg_animation_duration_time_get(anim_view));
+ snprintf(buf, sizeof(buf), "Duration(Length): %1.2fs", efl_playable_length_get(anim_view));
efl_add(EFL_UI_TEXTBOX_CLASS, box_sub,
efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0),
efl_gfx_hint_fill_set(efl_added, EINA_FALSE, EINA_FALSE),
//Duration Text
- snprintf(buf, sizeof(buf), "Duration: %1.2fs", efl_ui_vg_animation_duration_time_get(anim_view));
+ snprintf(buf, sizeof(buf), "Duration(Length): %1.2fs", efl_playable_length_get(anim_view));
efl_add(EFL_UI_TEXTBOX_CLASS, box2,
efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0),
efl_gfx_hint_fill_set(efl_added, EINA_FALSE, EINA_FALSE),
return (int) ((double) (evas_object_vg_animated_frame_count_get(pd->vg) - 1) * progress);
}
-EOLIAN static double
-_efl_ui_vg_animation_duration_time_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
-{
- return pd->frame_duration;
-}
-
EOLIAN static Eina_Size2D
_efl_ui_vg_animation_default_view_size_get(const Eo *obj EINA_UNUSED,
Efl_Ui_Vg_Animation_Data *pd EINA_UNUSED)
return pd->playback_speed;
}
+EOLIAN static double
+_efl_ui_vg_animation_efl_playable_length_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
+{
+ return pd->frame_duration;
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_vg_animation_efl_playable_playable_get(const Eo *obj, Efl_Ui_Vg_Animation_Data *pd EINA_UNUSED)
+{
+ if (!efl_file_loaded_get(obj)) return EINA_FALSE;
+ return EINA_TRUE;
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_vg_animation_efl_playable_seekable_get(const Eo *obj, Efl_Ui_Vg_Animation_Data *pd EINA_UNUSED)
+{
+ if (!efl_file_loaded_get(obj)) return EINA_FALSE;
+ return EINA_TRUE;
+}
+
EAPI Elm_Animation_View*
elm_animation_view_add(Evas_Object *parent)
{
Otherwise after finished animation or stopped forcibly by request.]]
}
-class @beta Efl.Ui.Vg_Animation extends Efl.Ui.Widget implements Efl.Gfx.View, Efl.File, Efl.Player
+class @beta Efl.Ui.Vg_Animation extends Efl.Ui.Widget implements Efl.Gfx.View, Efl.File, Efl.Player, Efl.Playable
{
[[Elementary Vector Graphcis Animation class.
Vg Animation is designed to show and play animation of
autorepeat: bool; [[Loop mode, Default is $false.]]
}
}
- @property duration_time {
- [[Get the duration of animation in seconds.
-
- This API returns total duration time of current animation in the seconds.
- If current animation source isn't animatable, it returns zero.
- ]]
- get {
- }
- values {
- frame_duration: double; [[duration time in the seconds]]
- }
- }
@property frame {
[[Number of current frame.
Efl.Player.playback_position { set; get; }
Efl.Player.playback_progress { get; set; }
Efl.Player.playback_speed { set; get; }
+ Efl.Playable.length { get; }
+ Efl.Playable.playable { get; }
+ Efl.Playable.seekable { get; }
}
events {
play,start: void; [[Called when animation is just started]]
EAPI double
elm_animation_view_duration_time_get(const Efl_Ui_Vg_Animation *obj)
{
- return efl_ui_vg_animation_duration_time_get(obj);
+ return efl_playable_length_get(obj);
}
EAPI void