Emotion: Migrate some more of emotion to Eo/efl.player.

This commit is contained in:
Tom Hacohen 2015-04-17 16:08:56 +01:00
parent e8c4c3c258
commit acd4ace06c
3 changed files with 43 additions and 15 deletions

View 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. */
}
}
}
}

View 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);

View 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)
{