elm_video: make emotion obj as a composite object.
authorAmitesh Singh <amitesh.sh@samsung.com>
Fri, 17 Jun 2016 04:55:41 +0000 (10:25 +0530)
committerAmitesh Singh <amitesh.sh@samsung.com>
Fri, 17 Jun 2016 04:59:19 +0000 (10:29 +0530)
There is no need to reimplement player interface APIs in elm video.
Thanks marcel for this idea.

src/lib/elementary/elm_video.c
src/lib/elementary/elm_video.eo

index 6ef84fc..47df805 100644 (file)
@@ -2,6 +2,7 @@
 # include "elementary_config.h"
 #endif
 
+#define EO_BASE_BETA
 #include <Emotion.h>
 
 #define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
@@ -267,6 +268,7 @@ _elm_video_evas_object_smart_add(Eo *obj, Elm_Video_Data *priv)
 
    evas_object_event_callback_add
      (obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_size_hints_changed, NULL);
+   eo_composite_attach(obj, priv->emotion);
 
    priv->timer = ecore_timer_add(20.0, _suspend_cb, obj);
 }
@@ -372,54 +374,6 @@ _elm_video_is_playing_get(Eo *obj EINA_UNUSED, Elm_Video_Data *sd)
    return emotion_object_play_get(sd->emotion);
 }
 
-EOLIAN static Eina_Bool
-_elm_video_efl_player_seekable_get(Eo *obj EINA_UNUSED, Elm_Video_Data *sd)
-{
-   return emotion_object_seekable_get(sd->emotion);
-}
-
-EOLIAN static Eina_Bool
-_elm_video_efl_player_audio_mute_get(Eo *obj EINA_UNUSED, Elm_Video_Data *sd)
-{
-   return emotion_object_audio_mute_get(sd->emotion);
-}
-
-EOLIAN static void
-_elm_video_efl_player_audio_mute_set(Eo *obj EINA_UNUSED, Elm_Video_Data *sd, Eina_Bool mute)
-{
-   emotion_object_audio_mute_set(sd->emotion, mute);
-}
-
-EOLIAN static double
-_elm_video_efl_player_audio_volume_get(Eo *obj EINA_UNUSED, Elm_Video_Data *sd)
-{
-   return emotion_object_audio_volume_get(sd->emotion);
-}
-
-EOLIAN static void
-_elm_video_efl_player_audio_volume_set(Eo *obj EINA_UNUSED, Elm_Video_Data *sd, double volume)
-{
-   emotion_object_audio_volume_set(sd->emotion, volume);
-}
-
-EOLIAN static double
-_elm_video_efl_player_position_get(Eo *obj EINA_UNUSED, Elm_Video_Data *sd)
-{
-   return emotion_object_position_get(sd->emotion);
-}
-
-EOLIAN static void
-_elm_video_efl_player_position_set(Eo *obj EINA_UNUSED, Elm_Video_Data *sd, double position)
-{
-   emotion_object_position_set(sd->emotion, position);
-}
-
-EOLIAN static double
-_elm_video_efl_player_length_get(Eo *obj EINA_UNUSED, Elm_Video_Data *sd)
-{
-   return emotion_object_play_length_get(sd->emotion);
-}
-
 EOLIAN static const char*
 _elm_video_title_get(Eo *obj EINA_UNUSED, Elm_Video_Data *sd)
 {
index 0a84352..8a88c36 100644 (file)
@@ -65,11 +65,6 @@ class Elm.Video (Elm.Layout, Efl.File,
       Eo.Base.constructor;
       Efl.File.file.set;
       Efl.File.file.get;
-      Efl.Player.audio_volume;
-      Efl.Player.audio_mute;
-      Efl.Player.position;
-      Efl.Player.seekable.get;
-      Efl.Player.length.get;
       Evas.Object.Smart.add;
       Evas.Object.Smart.del;
       Elm.Widget.focus_next_manager_is;