efl_ui/image: implement efl.player::playback_progress method

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10120
This commit is contained in:
Mike Blumenkrantz 2019-09-24 15:30:11 -04:00 committed by Cedric Bail
parent e4ce41d6a6
commit 5555c8e879
4 changed files with 22 additions and 0 deletions

View File

@ -1833,6 +1833,16 @@ _efl_ui_image_efl_player_playback_position_get(const Eo *obj EINA_UNUSED, Efl_Ui
return 0.0;
}
EOLIAN static double
_efl_ui_image_efl_player_playback_progress_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
{
if (sd->edje)
efl_player_playback_progress_get(sd->img);
else if ((sd->frame_count > 0) && (sd->frame_duration > 0.0))
return (sd->cur_frame * sd->frame_duration) / sd->frame_count;
return 0.0;
}
static Eina_Bool
_efl_ui_image_animated_paused_set_internal(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Bool paused)
{

View File

@ -101,6 +101,7 @@ class Efl.Ui.Image extends Efl.Ui.Widget implements Efl.Input.Clickable, Efl.Ui.
Efl.Player.playing { get; set; }
Efl.Player.paused { get; set; }
Efl.Player.playback_position { get; set; }
Efl.Player.playback_progress { get; }
Efl.Layout.Signal.signal_emit;
Efl.Layout.Signal.message_send;
Efl.Layout.Signal.signal_callback_add;

View File

@ -3150,6 +3150,16 @@ _efl_ui_image_zoomable_efl_player_playback_position_get(const Eo *obj EINA_UNUSE
return 0.0;
}
EOLIAN static double
_efl_ui_image_zoomable_efl_player_playback_progress_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd)
{
if (sd->edje)
efl_player_playback_progress_get(sd->edje);
else if ((sd->frame_count > 0) && (sd->frame_duration > 0.0))
return (sd->cur_frame * sd->frame_duration) / sd->frame_count;
return 0.0;
}
EOLIAN static void
_efl_ui_image_zoomable_class_constructor(Efl_Class *klass EINA_UNUSED)
{

View File

@ -47,6 +47,7 @@ class @beta Efl.Ui.Image_Zoomable extends Efl.Ui.Image implements Efl.Ui.Zoom
Efl.Player.playing { get; set; }
Efl.Player.paused { get; set; }
Efl.Player.playback_position { get; set; }
Efl.Player.playback_progress { get; }
Efl.Ui.Zoom.zoom_animation { set; get; }
Efl.Ui.Zoom.zoom_level { set; get; }
Efl.Ui.Zoom.zoom_mode { set; get; }