summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/efl/interfaces/efl_player.eo6
-rw-r--r--src/lib/elementary/efl_ui_animation_view.c46
-rw-r--r--src/lib/elementary/efl_ui_animation_view.eo16
-rw-r--r--src/lib/elementary/efl_ui_animation_view_eo.legacy.c2
-rw-r--r--src/lib/elementary/efl_ui_image.c18
-rw-r--r--src/lib/elementary/efl_ui_image.eo2
-rw-r--r--src/lib/elementary/efl_ui_image_zoomable.c21
-rw-r--r--src/lib/elementary/efl_ui_image_zoomable.eo2
-rw-r--r--src/lib/emotion/efl_canvas_video.eo2
-rw-r--r--src/lib/emotion/emotion_smart.c7
10 files changed, 72 insertions, 50 deletions
diff --git a/src/lib/efl/interfaces/efl_player.eo b/src/lib/efl/interfaces/efl_player.eo
index afeb7c2d13..434482ab63 100644
--- a/src/lib/efl/interfaces/efl_player.eo
+++ b/src/lib/efl/interfaces/efl_player.eo
@@ -67,9 +67,11 @@ interface Efl.Player
67 @property playback_progress { 67 @property playback_progress {
68 [[How much of the file has been played. 68 [[How much of the file has been played.
69 69
70 This function gets the progress in playing the file, the 70 This function sets or gets the progress in playing the file, the
71 return value is in the [0, 1] range. 71 value is in the [0, 1] range.
72 ]] 72 ]]
73 set {
74 }
73 get { 75 get {
74 } 76 }
75 values { 77 values {
diff --git a/src/lib/elementary/efl_ui_animation_view.c b/src/lib/elementary/efl_ui_animation_view.c
index 2240624623..6669d53ff3 100644
--- a/src/lib/elementary/efl_ui_animation_view.c
+++ b/src/lib/elementary/efl_ui_animation_view.c
@@ -509,30 +509,9 @@ _playing_stop(Eo* obj, Efl_Ui_Animation_View_Data *pd)
509} 509}
510 510
511EOLIAN static void 511EOLIAN static void
512_efl_ui_animation_view_progress_set(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd, double progress)
513{
514 if (progress < 0) progress = 0;
515 else if (progress > 1) progress = 1;
516 if (pd->progress == progress) return;
517
518 pd->progress = progress;
519
520 if (pd->frame_cnt > 0)
521 evas_object_vg_animated_frame_set(pd->vg, (int) ((pd->frame_cnt - 1) * progress));
522
523 if (pd->transit)
524 {
525 if (pd->playing_reverse)
526 elm_transit_progress_value_set(pd->transit, 1 - progress);
527 else
528 elm_transit_progress_value_set(pd->transit, progress);
529 }
530}
531
532EOLIAN static void
533_efl_ui_animation_view_frame_set(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd, int frame_num) 512_efl_ui_animation_view_frame_set(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd, int frame_num)
534{ 513{
535 efl_ui_animation_view_progress_set(obj, (double) frame_num / (double) (evas_object_vg_animated_frame_count_get(pd->vg) - 1)); 514 efl_player_playback_progress_set(obj, (double) frame_num / (double) (evas_object_vg_animated_frame_count_get(pd->vg) - 1));
536} 515}
537 516
538EOLIAN static int 517EOLIAN static int
@@ -768,7 +747,7 @@ _efl_ui_animation_view_efl_player_playback_position_set(Eo *obj, Efl_Ui_Animatio
768 EINA_SAFETY_ON_TRUE_RETURN(sec < 0); 747 EINA_SAFETY_ON_TRUE_RETURN(sec < 0);
769 EINA_SAFETY_ON_TRUE_RETURN(sec > pd->frame_duration); 748 EINA_SAFETY_ON_TRUE_RETURN(sec > pd->frame_duration);
770 749
771 efl_ui_animation_view_progress_set(obj, pd->frame_duration != 0 ? sec / pd->frame_duration : 0); 750 efl_player_playback_progress_set(obj, pd->frame_duration != 0 ? sec / pd->frame_duration : 0);
772} 751}
773 752
774EOLIAN static double 753EOLIAN static double
@@ -784,6 +763,27 @@ _efl_ui_animation_view_efl_player_playback_progress_get(const Eo *obj EINA_UNUSE
784} 763}
785 764
786EOLIAN static void 765EOLIAN static void
766_efl_ui_animation_view_efl_player_playback_progress_set(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd, double progress)
767{
768 if (progress < 0) progress = 0;
769 else if (progress > 1) progress = 1;
770 if (pd->progress == progress) return;
771
772 pd->progress = progress;
773
774 if (pd->frame_cnt > 0)
775 evas_object_vg_animated_frame_set(pd->vg, (int) ((pd->frame_cnt - 1) * progress));
776
777 if (pd->transit)
778 {
779 if (pd->playing_reverse)
780 elm_transit_progress_value_set(pd->transit, 1 - progress);
781 else
782 elm_transit_progress_value_set(pd->transit, progress);
783 }
784}
785
786EOLIAN static void
787_efl_ui_animation_view_efl_player_playback_speed_set(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd, double speed) 787_efl_ui_animation_view_efl_player_playback_speed_set(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd, double speed)
788{ 788{
789 // pd->playback_direction_changed is used only during playback. 789 // pd->playback_direction_changed is used only during playback.
diff --git a/src/lib/elementary/efl_ui_animation_view.eo b/src/lib/elementary/efl_ui_animation_view.eo
index 1d7d0c23ae..c14b927e3c 100644
--- a/src/lib/elementary/efl_ui_animation_view.eo
+++ b/src/lib/elementary/efl_ui_animation_view.eo
@@ -75,20 +75,6 @@ class @beta Efl.Ui.Animation_View extends Efl.Ui.Widget implements Efl.Gfx.View,
75 frame_duration: double; [[duration time in the seconds]] 75 frame_duration: double; [[duration time in the seconds]]
76 } 76 }
77 } 77 }
78 @property progress {
79 [[Set current progress position of animation view object.
80
81 When you required to jump on a certain frame instantly,
82 you can change current position by using this API.
83
84 Warning: The range of progress is 0 ~ 1.
85 ]]
86 set {
87 }
88 values {
89 progress: double; [[Progress position. Value must be 0 ~ 1.]]
90 }
91 }
92 @property frame { 78 @property frame {
93 [[Number of current frame. 79 [[Number of current frame.
94 80
@@ -224,7 +210,7 @@ class @beta Efl.Ui.Animation_View extends Efl.Ui.Widget implements Efl.Gfx.View,
224 Efl.Player.playing { set; get; } 210 Efl.Player.playing { set; get; }
225 Efl.Player.paused { set; get; } 211 Efl.Player.paused { set; get; }
226 Efl.Player.playback_position { set; get; } 212 Efl.Player.playback_position { set; get; }
227 Efl.Player.playback_progress { get; } 213 Efl.Player.playback_progress { get; set; }
228 Efl.Player.playback_speed { set; get; } 214 Efl.Player.playback_speed { set; get; }
229 } 215 }
230 events { 216 events {
diff --git a/src/lib/elementary/efl_ui_animation_view_eo.legacy.c b/src/lib/elementary/efl_ui_animation_view_eo.legacy.c
index e213ebb6e9..b109e0ef5e 100644
--- a/src/lib/elementary/efl_ui_animation_view_eo.legacy.c
+++ b/src/lib/elementary/efl_ui_animation_view_eo.legacy.c
@@ -46,7 +46,7 @@ elm_animation_view_duration_time_get(const Efl_Ui_Animation_View *obj)
46EAPI void 46EAPI void
47elm_animation_view_progress_set(Efl_Ui_Animation_View *obj, double progress) 47elm_animation_view_progress_set(Efl_Ui_Animation_View *obj, double progress)
48{ 48{
49 efl_ui_animation_view_progress_set(obj, progress); 49 efl_player_playback_progress_set(obj, progress);
50} 50}
51 51
52EAPI double 52EAPI double
diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c
index 213d55edd2..2d9ce304fe 100644
--- a/src/lib/elementary/efl_ui_image.c
+++ b/src/lib/elementary/efl_ui_image.c
@@ -1753,7 +1753,7 @@ _efl_ui_image_animated_set_internal(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Bool an
1753 if (anim) 1753 if (anim)
1754 { 1754 {
1755 sd->frame_count = evas_object_image_animated_frame_count_get(sd->img); 1755 sd->frame_count = evas_object_image_animated_frame_count_get(sd->img);
1756 sd->cur_frame = 1; 1756 sd->cur_frame = 0;
1757 sd->frame_duration = 1757 sd->frame_duration =
1758 evas_object_image_animated_frame_duration_get 1758 evas_object_image_animated_frame_duration_get
1759 (sd->img, sd->cur_frame, 0); 1759 (sd->img, sd->cur_frame, 0);
@@ -1859,11 +1859,23 @@ _efl_ui_image_efl_player_playback_progress_get(const Eo *obj EINA_UNUSED, Efl_Ui
1859{ 1859{
1860 if (sd->edje) 1860 if (sd->edje)
1861 efl_player_playback_progress_get(sd->img); 1861 efl_player_playback_progress_get(sd->img);
1862 else if ((sd->frame_count > 0) && (sd->frame_duration > 0.0)) 1862 else if (sd->frame_count > 1)
1863 return (sd->cur_frame * sd->frame_duration) / sd->frame_count; 1863 return sd->cur_frame / (sd->frame_count - 1);
1864 return 0.0; 1864 return 0.0;
1865} 1865}
1866 1866
1867EOLIAN static void
1868_efl_ui_image_efl_player_playback_progress_set(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd, double progress)
1869{
1870 EINA_SAFETY_ON_TRUE_RETURN(progress > 1 || progress < 0);
1871 if (sd->edje)
1872 efl_player_playback_progress_set(sd->img, progress);
1873 else if (sd->frame_count > 1)
1874 sd->cur_frame = lround(progress * (sd->frame_count - 1));
1875 else
1876 sd->cur_frame = 0;
1877}
1878
1867static Eina_Bool 1879static Eina_Bool
1868_efl_ui_image_animated_paused_set_internal(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Bool paused) 1880_efl_ui_image_animated_paused_set_internal(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Bool paused)
1869{ 1881{
diff --git a/src/lib/elementary/efl_ui_image.eo b/src/lib/elementary/efl_ui_image.eo
index 207a264e70..0cabaa0290 100644
--- a/src/lib/elementary/efl_ui_image.eo
+++ b/src/lib/elementary/efl_ui_image.eo
@@ -103,7 +103,7 @@ class Efl.Ui.Image extends Efl.Ui.Widget implements Efl.Input.Clickable, Efl.Ui.
103 Efl.Player.playing { get; set; } 103 Efl.Player.playing { get; set; }
104 Efl.Player.paused { get; set; } 104 Efl.Player.paused { get; set; }
105 Efl.Player.playback_position { get; set; } 105 Efl.Player.playback_position { get; set; }
106 Efl.Player.playback_progress { get; } 106 Efl.Player.playback_progress { get; set; }
107 Efl.Player.playback_speed { get; set; } 107 Efl.Player.playback_speed { get; set; }
108 Efl.Layout.Signal.signal_emit; 108 Efl.Layout.Signal.signal_emit;
109 Efl.Layout.Signal.message_send; 109 Efl.Layout.Signal.message_send;
diff --git a/src/lib/elementary/efl_ui_image_zoomable.c b/src/lib/elementary/efl_ui_image_zoomable.c
index 19d2e0155b..62a146422f 100644
--- a/src/lib/elementary/efl_ui_image_zoomable.c
+++ b/src/lib/elementary/efl_ui_image_zoomable.c
@@ -3058,7 +3058,7 @@ _efl_ui_image_zoomable_animated_set_internal(Eo *obj EINA_UNUSED, Efl_Ui_Image_Z
3058 if (anim) 3058 if (anim)
3059 { 3059 {
3060 sd->frame_count = evas_object_image_animated_frame_count_get(sd->img); 3060 sd->frame_count = evas_object_image_animated_frame_count_get(sd->img);
3061 sd->cur_frame = 1; 3061 sd->cur_frame = 0;
3062 sd->frame_duration = 3062 sd->frame_duration =
3063 evas_object_image_animated_frame_duration_get 3063 evas_object_image_animated_frame_duration_get
3064 (sd->img, sd->cur_frame, 0); 3064 (sd->img, sd->cur_frame, 0);
@@ -3178,12 +3178,27 @@ _efl_ui_image_zoomable_efl_player_playback_progress_get(const Eo *obj EINA_UNUSE
3178{ 3178{
3179 if (sd->edje) 3179 if (sd->edje)
3180 efl_player_playback_progress_get(sd->edje); 3180 efl_player_playback_progress_get(sd->edje);
3181 else if ((sd->frame_count > 0) && (sd->frame_duration > 0.0)) 3181 else if (sd->frame_count > 1)
3182 return (sd->cur_frame * sd->frame_duration) / sd->frame_count; 3182 return sd->cur_frame / (sd->frame_count - 1);
3183 return 0.0; 3183 return 0.0;
3184} 3184}
3185 3185
3186EOLIAN static void 3186EOLIAN static void
3187_efl_ui_image_zoomable_efl_player_playback_progress_set(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd, double progress)
3188{
3189 EINA_SAFETY_ON_TRUE_RETURN(progress > 1 || progress < 0);
3190 if (sd->edje)
3191 {
3192 efl_player_playback_progress_set(sd->img, progress);
3193 }
3194 else if (sd->frame_count > 1)
3195 sd->cur_frame = lround(progress * (sd->frame_count - 1));
3196 else
3197 sd->cur_frame = 0;
3198}
3199
3200
3201EOLIAN static void
3187_efl_ui_image_zoomable_class_constructor(Efl_Class *klass EINA_UNUSED) 3202_efl_ui_image_zoomable_class_constructor(Efl_Class *klass EINA_UNUSED)
3188{ 3203{
3189 PHOTO_FILE_LOAD_ERROR_GENERIC = eina_error_msg_static_register("Generic load error"); 3204 PHOTO_FILE_LOAD_ERROR_GENERIC = eina_error_msg_static_register("Generic load error");
diff --git a/src/lib/elementary/efl_ui_image_zoomable.eo b/src/lib/elementary/efl_ui_image_zoomable.eo
index 5b097e1fab..4887128503 100644
--- a/src/lib/elementary/efl_ui_image_zoomable.eo
+++ b/src/lib/elementary/efl_ui_image_zoomable.eo
@@ -50,7 +50,7 @@ class Efl.Ui.Image_Zoomable extends Efl.Ui.Image implements Efl.Ui.Zoom
50 Efl.Player.playing { get; set; } 50 Efl.Player.playing { get; set; }
51 Efl.Player.paused { get; set; } 51 Efl.Player.paused { get; set; }
52 Efl.Player.playback_position { get; set; } 52 Efl.Player.playback_position { get; set; }
53 Efl.Player.playback_progress { get; } 53 Efl.Player.playback_progress { get; set; }
54 Efl.Player.playback_speed { get; set; } 54 Efl.Player.playback_speed { get; set; }
55 Efl.Ui.Zoom.zoom_animation { set; get; } 55 Efl.Ui.Zoom.zoom_animation { set; get; }
56 Efl.Ui.Zoom.zoom_level { set; get; } 56 Efl.Ui.Zoom.zoom_level { set; get; }
diff --git a/src/lib/emotion/efl_canvas_video.eo b/src/lib/emotion/efl_canvas_video.eo
index 162e0fcc27..0f2ffa7435 100644
--- a/src/lib/emotion/efl_canvas_video.eo
+++ b/src/lib/emotion/efl_canvas_video.eo
@@ -60,7 +60,7 @@ class @beta Efl.Canvas.Video extends Efl.Canvas.Group
60 Efl.Player.playing { get; set; } 60 Efl.Player.playing { get; set; }
61 Efl.Player.paused { get; set; } 61 Efl.Player.paused { get; set; }
62 Efl.Player.playback_position { get; set; } 62 Efl.Player.playback_position { get; set; }
63 Efl.Player.playback_progress { get; } 63 Efl.Player.playback_progress { get; set; }
64 Efl.Audio_Control.volume { get; set; } 64 Efl.Audio_Control.volume { get; set; }
65 Efl.Audio_Control.mute { get; set; } 65 Efl.Audio_Control.mute { get; set; }
66 Efl.Playable.length { get; } 66 Efl.Playable.length { get; }
diff --git a/src/lib/emotion/emotion_smart.c b/src/lib/emotion/emotion_smart.c
index a642386fbe..9f723e5bef 100644
--- a/src/lib/emotion/emotion_smart.c
+++ b/src/lib/emotion/emotion_smart.c
@@ -1217,6 +1217,13 @@ _efl_canvas_video_efl_player_playback_progress_get(const Eo *obj EINA_UNUSED, Ef
1217 return sd->progress.stat; 1217 return sd->progress.stat;
1218} 1218}
1219 1219
1220EOLIAN static void
1221_efl_canvas_video_efl_player_playback_progress_set(Eo *obj, Efl_Canvas_Video_Data *sd EINA_UNUSED, double progress)
1222{
1223 const char *info = emotion_object_progress_info_get((const Evas_Object*)obj);
1224 _emotion_progress_set(obj, (char*)info, progress);
1225}
1226
1220EOLIAN static double 1227EOLIAN static double
1221_efl_canvas_video_efl_playable_length_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd) 1228_efl_canvas_video_efl_playable_length_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd)
1222{ 1229{