Emotion: Migrate some more of emotion to Eo/efl.player.
authorTom Hacohen <tom@stosb.com>
Fri, 17 Apr 2015 15:08:56 +0000 (16:08 +0100)
committerTom Hacohen <tom@stosb.com>
Wed, 6 May 2015 17:22:22 +0000 (18:22 +0100)
src/lib/efl/interfaces/efl_player.eo
src/lib/emotion/emotion_object.eo
src/lib/emotion/emotion_smart.c

index 45928965773d2b3be19a2f95a6b272caa36e75d3..b1fab48d76b150564882138c1c795e032291054f 100644 (file)
@@ -105,5 +105,27 @@ interface Efl.Player {
                   bool mute; /*@ The mute state. True or false. */
              }
         }
+        length {
+             /**
+              * @brief Get the length of play for the media file.
+              *
+              * This function returns the length of the media file in seconds.
+              */
+             get {
+             }
+             values {
+                  double length; /*@ The length of the stream in seconds. */
+             }
+        }
+        seekable {
+             /**
+              * @brief Get whether the media file is seekable.
+              */
+             get {
+             }
+             values {
+                  bool seekable; /*@ True if seekable. */
+             }
+        }
    }
 }
index 3fe8fffbcc6e532202599966fee56624442cfa55..9749d1193a521314b34ec5ca78ce7e998250759e 100644 (file)
@@ -74,6 +74,8 @@ class Emotion.Object (Evas.Object_Smart, Efl.File, Efl.Player, Efl.Image) {
         Efl.Player.audio_volume.get;
         Efl.Player.audio_mute.set;
         Efl.Player.audio_mute.get;
+        Efl.Player.length.get;
+        Efl.Player.seekable.get;
         Efl.Image.load_size.get;
         Efl.Image.ratio.get;
         Efl.Image.smooth_scale.set;
@@ -104,11 +106,7 @@ class Emotion.Object (Evas.Object_Smart, Efl.File, Efl.Player, Efl.Image) {
 
 /* FIXME: Need to be added:
 EAPI double       emotion_object_buffer_size_get       (const Evas_Object *obj);
-EAPI Eina_Bool    emotion_object_seekable_get          (const Evas_Object *obj);
-EAPI double       emotion_object_play_length_get       (const Evas_Object *obj);
 EAPI const char  *emotion_object_progress_info_get     (const Evas_Object *obj);
-EAPI Eina_Bool    emotion_object_video_handled_get     (const Evas_Object *obj);
-EAPI Eina_Bool    emotion_object_audio_handled_get     (const Evas_Object *obj);
 
 Everything starting from (needs to be added):
 EAPI int          emotion_object_audio_channel_count   (const Evas_Object *obj);
index 4d8b4df7209847997575704050b09753009d74dc..8cf589903d4d8362206a4f0f66ac8fe984038bf4 100644 (file)
@@ -733,11 +733,8 @@ emotion_object_buffer_size_get(const Evas_Object *obj)
 EAPI Eina_Bool
 emotion_object_seekable_get(const Evas_Object *obj)
 {
-   Emotion_Object_Data *sd;
-
-   E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
-   if (!sd->engine_instance) return EINA_FALSE;
-   return emotion_engine_instance_seekable(sd->engine_instance);
+   Eina_Bool ret;
+   return eo_do_ret(obj, ret, efl_player_seekable_get());
 }
 
 EAPI Eina_Bool
@@ -763,12 +760,8 @@ emotion_object_audio_handled_get(const Evas_Object *obj)
 EAPI double
 emotion_object_play_length_get(const Evas_Object *obj)
 {
-   Emotion_Object_Data *sd;
-
-   E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0.0);
-   if (!sd->engine_instance) return 0.0;
-   sd->len = emotion_engine_instance_len_get(sd->engine_instance);
-   return sd->len;
+   double ret;
+   return eo_do_ret(obj, ret, efl_player_length_get());
 }
 
 EAPI void
@@ -1185,6 +1178,21 @@ _emotion_object_efl_player_progress_get(Eo *obj EINA_UNUSED, Emotion_Object_Data
    return sd->progress.stat;
 }
 
+EOLIAN static double
+_emotion_object_efl_player_length_get(Eo *obj EINA_UNUSED, Emotion_Object_Data *sd)
+{
+   if (!sd->engine_instance) return 0.0;
+   sd->len = emotion_engine_instance_len_get(sd->engine_instance);
+   return sd->len;
+}
+
+EOLIAN static Eina_Bool
+_emotion_object_efl_player_seekable_get(Eo *obj EINA_UNUSED, Emotion_Object_Data *sd)
+{
+   if (!sd->engine_instance) return EINA_FALSE;
+   return emotion_engine_instance_seekable(sd->engine_instance);
+}
+
 EAPI const char *
 emotion_object_ref_file_get(const Evas_Object *obj)
 {