diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h index 9f3b2ff518..b19e97c743 100644 --- a/src/lib/efl/Efl.h +++ b/src/lib/efl/Efl.h @@ -132,6 +132,7 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command; #include "interfaces/efl_part.eo.h" #include "interfaces/efl_playable.eo.h" #include "interfaces/efl_player.eo.h" +#include "interfaces/efl_audio_control.eo.h" #include "interfaces/efl_text.eo.h" #include "interfaces/efl_text_types.eot.h" #include "interfaces/efl_ui_i18n.eo.h" diff --git a/src/lib/efl/interfaces/efl_audio_control.eo b/src/lib/efl/interfaces/efl_audio_control.eo new file mode 100644 index 0000000000..6b728fb43f --- /dev/null +++ b/src/lib/efl/interfaces/efl_audio_control.eo @@ -0,0 +1,33 @@ +interface @beta Efl.Audio_Control extends Efl.Player +{ + [[Player interface for audio related properties]] + methods { + @property volume { + [[Control the audio volume. + + Controls the audio volume of the stream being played. This has + nothing to do with the system volume. This volume will be + multiplied by the system volume. e.g.: if the current volume + level is 0.5, and the system volume is 50%, it will be + 0.5 * 0.5 = 0.25. + ]] + set { + } + get { + } + values { + volume: double; [[The volume level]] + } + } + @property mute { + [[This property controls the audio mute state.]] + set { + } + get { + } + values { + mute: bool; [[The mute state. $true or $false.]] + } + } + } +} diff --git a/src/lib/efl/interfaces/efl_interfaces_main.c b/src/lib/efl/interfaces/efl_interfaces_main.c index 91b7ff1775..ead730689f 100644 --- a/src/lib/efl/interfaces/efl_interfaces_main.c +++ b/src/lib/efl/interfaces/efl_interfaces_main.c @@ -19,6 +19,7 @@ #include "interfaces/efl_part.eo.c" #include "interfaces/efl_playable.eo.c" #include "interfaces/efl_player.eo.c" +#include "interfaces/efl_audio_control.eo.c" #include "interfaces/efl_text.eo.c" #include "interfaces/efl_text_font.eo.c" #include "interfaces/efl_text_style.eo.c" diff --git a/src/lib/efl/interfaces/efl_player.eo b/src/lib/efl/interfaces/efl_player.eo index 19c80f84ba..1aecb53015 100644 --- a/src/lib/efl/interfaces/efl_player.eo +++ b/src/lib/efl/interfaces/efl_player.eo @@ -1,6 +1,7 @@ interface @beta Efl.Player { [[Efl media player interface]] + c_prefix: efl_player; methods { start { [[Start a playing playable object.]] @@ -74,33 +75,6 @@ interface @beta Efl.Player speed: double; [[The play speed in the [0, infinity) range.]] } } - @property volume { - [[Control the audio volume. - - Controls the audio volume of the stream being played. This has - nothing to do with the system volume. This volume will be - multiplied by the system volume. e.g.: if the current volume - level is 0.5, and the system volume is 50%, it will be - 0.5 * 0.5 = 0.25. - ]] - set { - } - get { - } - values { - volume: double; [[The volume level]] - } - } - @property mute { - [[This property controls the audio mute state.]] - set { - } - get { - } - values { - mute: bool; [[The mute state. $true or $false.]] - } - } @property length { [[Get the length of play for the media file.]] get { diff --git a/src/lib/efl/interfaces/meson.build b/src/lib/efl/interfaces/meson.build index f59d5bbb78..237142f326 100644 --- a/src/lib/efl/interfaces/meson.build +++ b/src/lib/efl/interfaces/meson.build @@ -42,6 +42,7 @@ pub_eo_files = [ 'efl_gfx_image_load_controller.eo', 'efl_part.eo', 'efl_player.eo', + 'efl_audio_control.eo', 'efl_text.eo', 'efl_text_font.eo', 'efl_text_style.eo', diff --git a/src/lib/elementary/efl_ui_video.c b/src/lib/elementary/efl_ui_video.c index dc3696a9af..b04ec11e35 100644 --- a/src/lib/elementary/efl_ui_video.c +++ b/src/lib/elementary/efl_ui_video.c @@ -474,25 +474,25 @@ elm_video_file_get(Eo *obj, const char **filename) EAPI void elm_video_audio_level_set(Evas_Object *obj, double volume) { - efl_player_volume_set(obj, volume); + efl_audio_control_volume_set(obj, volume); } EAPI double elm_video_audio_level_get(const Evas_Object *obj) { - return efl_player_volume_get(obj); + return efl_audio_control_volume_get(obj); } EAPI void elm_video_audio_mute_set(Evas_Object *obj, Eina_Bool mute) { - efl_player_mute_set(obj, mute); + efl_audio_control_mute_set(obj, mute); } EAPI Eina_Bool elm_video_audio_mute_get(const Evas_Object *obj) { - return efl_player_mute_get(obj); + return efl_audio_control_mute_get(obj); } EAPI double diff --git a/src/lib/emotion/efl_canvas_video.eo b/src/lib/emotion/efl_canvas_video.eo index 8ee9607f0e..345b14d69c 100644 --- a/src/lib/emotion/efl_canvas_video.eo +++ b/src/lib/emotion/efl_canvas_video.eo @@ -1,5 +1,5 @@ class @beta Efl.Canvas.Video extends Efl.Canvas.Group - implements Efl.File, Efl.Player, Efl.Gfx.Image, Efl.Gfx.Image_Load_Controller + implements Efl.File, Efl.Audio_Control, Efl.Gfx.Image, Efl.Gfx.Image_Load_Controller { [[Efl canvas video class]] methods { @@ -10,7 +10,7 @@ class @beta Efl.Canvas.Video extends Efl.Canvas.Group emotion object. Please don't use this function, consider using - @Efl.Player.mute instead. + @Efl.Audio_Control.mute instead. ]] set { } @@ -59,8 +59,8 @@ class @beta Efl.Canvas.Video extends Efl.Canvas.Group Efl.Player.play { get; set; } Efl.Player.pos { get; set; } Efl.Player.progress { get; } - Efl.Player.volume { get; set; } - Efl.Player.mute { get; set; } + Efl.Audio_Control.volume { get; set; } + Efl.Audio_Control.mute { get; set; } Efl.Player.length { get; } Efl.Player.seekable { get; } Efl.Gfx.Image_Load_Controller.load_size { get; } diff --git a/src/lib/emotion/emotion_smart.c b/src/lib/emotion/emotion_smart.c index a7a8fa8905..73c588bf81 100644 --- a/src/lib/emotion/emotion_smart.c +++ b/src/lib/emotion/emotion_smart.c @@ -830,11 +830,11 @@ emotion_object_event_simple_send(Evas_Object *obj, Emotion_Event ev) EAPI void emotion_object_audio_volume_set(Evas_Object *obj, double vol) { - efl_player_volume_set(obj, vol); + efl_audio_control_volume_set(obj, vol); } EOLIAN static void -_efl_canvas_video_efl_player_volume_set(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd, double vol) +_efl_canvas_video_efl_audio_control_volume_set(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd, double vol) { DBG("vol=%f", vol); if (!sd->engine_instance) return; @@ -844,11 +844,11 @@ _efl_canvas_video_efl_player_volume_set(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Da EAPI double emotion_object_audio_volume_get(const Evas_Object *obj) { - return efl_player_volume_get(obj); + return efl_audio_control_volume_get(obj); } EOLIAN static double -_efl_canvas_video_efl_player_volume_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd) +_efl_canvas_video_efl_audio_control_volume_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd) { if (!sd->engine_instance) return 0.0; return emotion_engine_instance_audio_channel_volume_get(sd->engine_instance); @@ -857,11 +857,11 @@ _efl_canvas_video_efl_player_volume_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Vi EAPI void emotion_object_audio_mute_set(Evas_Object *obj, Eina_Bool mute) { - efl_player_mute_set(obj, mute); + efl_audio_control_mute_set(obj, mute); } EOLIAN static void -_efl_canvas_video_efl_player_mute_set(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd, Eina_Bool mute) +_efl_canvas_video_efl_audio_control_mute_set(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd, Eina_Bool mute) { DBG("mute=" FMT_UCHAR, mute); if (!sd->engine_instance) return; @@ -871,11 +871,11 @@ _efl_canvas_video_efl_player_mute_set(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data EAPI Eina_Bool emotion_object_audio_mute_get(const Evas_Object *obj) { - return efl_player_mute_get(obj); + return efl_audio_control_mute_get(obj); } EOLIAN static Eina_Bool -_efl_canvas_video_efl_player_mute_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd) +_efl_canvas_video_efl_audio_control_mute_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd) { if (!sd->engine_instance) return EINA_FALSE; return emotion_engine_instance_audio_channel_mute_get(sd->engine_instance);