_slider_changed_cb(void *data, const Efl_Event *ev)
{
Evas_Object *anim_view = data;
- efl_ui_animation_view_progress_set(anim_view, efl_ui_range_value_get(ev->object));
+ efl_player_playback_progress_set(anim_view, efl_ui_range_value_get(ev->object));
}
static void
_slider_changed_cb(void *data, const Efl_Event *ev)
{
Evas_Object *anim_view = data;
- efl_ui_animation_view_progress_set(anim_view, efl_ui_range_value_get(ev->object));
+ efl_player_playback_progress_set(anim_view, efl_ui_range_value_get(ev->object));
}
static void
@property playback_progress {
[[How much of the file has been played.
- This function gets the progress in playing the file, the
- return value is in the [0, 1] range.
+ This function sets or gets the progress in playing the file, the
+ value is in the [0, 1] range.
]]
+ set {
+ }
get {
}
values {
}
EOLIAN static void
-_efl_ui_animation_view_progress_set(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd, double progress)
-{
- if (progress < 0) progress = 0;
- else if (progress > 1) progress = 1;
- if (pd->progress == progress) return;
-
- pd->progress = progress;
-
- if (pd->frame_cnt > 0)
- evas_object_vg_animated_frame_set(pd->vg, (int) ((pd->frame_cnt - 1) * progress));
-
- if (pd->transit)
- {
- if (pd->playing_reverse)
- elm_transit_progress_value_set(pd->transit, 1 - progress);
- else
- elm_transit_progress_value_set(pd->transit, progress);
- }
-}
-
-EOLIAN static void
_efl_ui_animation_view_frame_set(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd, int frame_num)
{
- efl_ui_animation_view_progress_set(obj, (double) frame_num / (double) (evas_object_vg_animated_frame_count_get(pd->vg) - 1));
+ efl_player_playback_progress_set(obj, (double) frame_num / (double) (evas_object_vg_animated_frame_count_get(pd->vg) - 1));
}
EOLIAN static int
EINA_SAFETY_ON_TRUE_RETURN(sec < 0);
EINA_SAFETY_ON_TRUE_RETURN(sec > pd->frame_duration);
- efl_ui_animation_view_progress_set(obj, pd->frame_duration != 0 ? sec / pd->frame_duration : 0);
+ efl_player_playback_progress_set(obj, pd->frame_duration != 0 ? sec / pd->frame_duration : 0);
}
EOLIAN static double
}
EOLIAN static void
+_efl_ui_animation_view_efl_player_playback_progress_set(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd, double progress)
+{
+ if (progress < 0) progress = 0;
+ else if (progress > 1) progress = 1;
+ if (pd->progress == progress) return;
+
+ pd->progress = progress;
+
+ if (pd->frame_cnt > 0)
+ evas_object_vg_animated_frame_set(pd->vg, (int) ((pd->frame_cnt - 1) * progress));
+
+ if (pd->transit)
+ {
+ if (pd->playing_reverse)
+ elm_transit_progress_value_set(pd->transit, 1 - progress);
+ else
+ elm_transit_progress_value_set(pd->transit, progress);
+ }
+}
+
+EOLIAN static void
_efl_ui_animation_view_efl_player_playback_speed_set(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd, double speed)
{
// pd->playback_direction_changed is used only during playback.
frame_duration: double; [[duration time in the seconds]]
}
}
- @property progress {
- [[Set current progress position of animation view object.
-
- When you required to jump on a certain frame instantly,
- you can change current position by using this API.
-
- Warning: The range of progress is 0 ~ 1.
- ]]
- set {
- }
- values {
- progress: double; [[Progress position. Value must be 0 ~ 1.]]
- }
- }
@property frame {
[[Number of current frame.
Efl.Player.playing { set; get; }
Efl.Player.paused { set; get; }
Efl.Player.playback_position { set; get; }
- Efl.Player.playback_progress { get; }
+ Efl.Player.playback_progress { get; set; }
Efl.Player.playback_speed { set; get; }
}
events {
EAPI void
elm_animation_view_progress_set(Efl_Ui_Animation_View *obj, double progress)
{
- efl_ui_animation_view_progress_set(obj, progress);
+ efl_player_playback_progress_set(obj, progress);
}
EAPI double
if (anim)
{
sd->frame_count = evas_object_image_animated_frame_count_get(sd->img);
- sd->cur_frame = 1;
+ sd->cur_frame = 0;
sd->frame_duration =
evas_object_image_animated_frame_duration_get
(sd->img, sd->cur_frame, 0);
{
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;
+ else if (sd->frame_count > 1)
+ return sd->cur_frame / (sd->frame_count - 1);
return 0.0;
}
+EOLIAN static void
+_efl_ui_image_efl_player_playback_progress_set(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd, double progress)
+{
+ EINA_SAFETY_ON_TRUE_RETURN(progress > 1 || progress < 0);
+ if (sd->edje)
+ efl_player_playback_progress_set(sd->img, progress);
+ else if (sd->frame_count > 1)
+ sd->cur_frame = lround(progress * (sd->frame_count - 1));
+ else
+ sd->cur_frame = 0;
+}
+
static Eina_Bool
_efl_ui_image_animated_paused_set_internal(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Bool paused)
{
Efl.Player.playing { get; set; }
Efl.Player.paused { get; set; }
Efl.Player.playback_position { get; set; }
- Efl.Player.playback_progress { get; }
+ Efl.Player.playback_progress { get; set; }
Efl.Player.playback_speed { get; set; }
Efl.Layout.Signal.signal_emit;
Efl.Layout.Signal.message_send;
if (anim)
{
sd->frame_count = evas_object_image_animated_frame_count_get(sd->img);
- sd->cur_frame = 1;
+ sd->cur_frame = 0;
sd->frame_duration =
evas_object_image_animated_frame_duration_get
(sd->img, sd->cur_frame, 0);
{
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;
+ else if (sd->frame_count > 1)
+ return sd->cur_frame / (sd->frame_count - 1);
return 0.0;
}
EOLIAN static void
+_efl_ui_image_zoomable_efl_player_playback_progress_set(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd, double progress)
+{
+ EINA_SAFETY_ON_TRUE_RETURN(progress > 1 || progress < 0);
+ if (sd->edje)
+ {
+ efl_player_playback_progress_set(sd->img, progress);
+ }
+ else if (sd->frame_count > 1)
+ sd->cur_frame = lround(progress * (sd->frame_count - 1));
+ else
+ sd->cur_frame = 0;
+}
+
+
+EOLIAN static void
_efl_ui_image_zoomable_class_constructor(Efl_Class *klass EINA_UNUSED)
{
PHOTO_FILE_LOAD_ERROR_GENERIC = eina_error_msg_static_register("Generic load error");
Efl.Player.playing { get; set; }
Efl.Player.paused { get; set; }
Efl.Player.playback_position { get; set; }
- Efl.Player.playback_progress { get; }
+ Efl.Player.playback_progress { get; set; }
Efl.Player.playback_speed { get; set; }
Efl.Ui.Zoom.zoom_animation { set; get; }
Efl.Ui.Zoom.zoom_level { set; get; }
Efl.Player.playing { get; set; }
Efl.Player.paused { get; set; }
Efl.Player.playback_position { get; set; }
- Efl.Player.playback_progress { get; }
+ Efl.Player.playback_progress { get; set; }
Efl.Audio_Control.volume { get; set; }
Efl.Audio_Control.mute { get; set; }
Efl.Playable.length { get; }
return sd->progress.stat;
}
+EOLIAN static void
+_efl_canvas_video_efl_player_playback_progress_set(Eo *obj, Efl_Canvas_Video_Data *sd EINA_UNUSED, double progress)
+{
+ const char *info = emotion_object_progress_info_get((const Evas_Object*)obj);
+ _emotion_progress_set(obj, (char*)info, progress);
+}
+
EOLIAN static double
_efl_canvas_video_efl_playable_length_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd)
{