forked from enlightenment/efl
elm video: implement player interface
Reviewers: raster, cedric, jpeg, singh.amitesh Reviewed By: singh.amitesh Differential Revision: https://phab.enlightenment.org/D4021
This commit is contained in:
parent
62c5ebc784
commit
a1b0fb2c9f
|
@ -373,49 +373,49 @@ _elm_video_is_playing_get(Eo *obj EINA_UNUSED, Elm_Video_Data *sd)
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static Eina_Bool
|
EOLIAN static Eina_Bool
|
||||||
_elm_video_is_seekable_get(Eo *obj EINA_UNUSED, Elm_Video_Data *sd)
|
_elm_video_efl_player_seekable_get(Eo *obj EINA_UNUSED, Elm_Video_Data *sd)
|
||||||
{
|
{
|
||||||
return emotion_object_seekable_get(sd->emotion);
|
return emotion_object_seekable_get(sd->emotion);
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static Eina_Bool
|
EOLIAN static Eina_Bool
|
||||||
_elm_video_audio_mute_get(Eo *obj EINA_UNUSED, Elm_Video_Data *sd)
|
_elm_video_efl_player_audio_mute_get(Eo *obj EINA_UNUSED, Elm_Video_Data *sd)
|
||||||
{
|
{
|
||||||
return emotion_object_audio_mute_get(sd->emotion);
|
return emotion_object_audio_mute_get(sd->emotion);
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_elm_video_audio_mute_set(Eo *obj EINA_UNUSED, Elm_Video_Data *sd, Eina_Bool mute)
|
_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);
|
emotion_object_audio_mute_set(sd->emotion, mute);
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static double
|
EOLIAN static double
|
||||||
_elm_video_audio_level_get(Eo *obj EINA_UNUSED, Elm_Video_Data *sd)
|
_elm_video_efl_player_audio_volume_get(Eo *obj EINA_UNUSED, Elm_Video_Data *sd)
|
||||||
{
|
{
|
||||||
return emotion_object_audio_volume_get(sd->emotion);
|
return emotion_object_audio_volume_get(sd->emotion);
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_elm_video_audio_level_set(Eo *obj EINA_UNUSED, Elm_Video_Data *sd, double volume)
|
_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);
|
emotion_object_audio_volume_set(sd->emotion, volume);
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static double
|
EOLIAN static double
|
||||||
_elm_video_play_position_get(Eo *obj EINA_UNUSED, Elm_Video_Data *sd)
|
_elm_video_efl_player_position_get(Eo *obj EINA_UNUSED, Elm_Video_Data *sd)
|
||||||
{
|
{
|
||||||
return emotion_object_position_get(sd->emotion);
|
return emotion_object_position_get(sd->emotion);
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_elm_video_play_position_set(Eo *obj EINA_UNUSED, Elm_Video_Data *sd, double position)
|
_elm_video_efl_player_position_set(Eo *obj EINA_UNUSED, Elm_Video_Data *sd, double position)
|
||||||
{
|
{
|
||||||
emotion_object_position_set(sd->emotion, position);
|
emotion_object_position_set(sd->emotion, position);
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static double
|
EOLIAN static double
|
||||||
_elm_video_play_length_get(Eo *obj EINA_UNUSED, Elm_Video_Data *sd)
|
_elm_video_efl_player_length_get(Eo *obj EINA_UNUSED, Elm_Video_Data *sd)
|
||||||
{
|
{
|
||||||
return emotion_object_play_length_get(sd->emotion);
|
return emotion_object_play_length_get(sd->emotion);
|
||||||
}
|
}
|
||||||
|
@ -480,5 +480,52 @@ elm_video_file_get(Eo *obj, const char **filename)
|
||||||
efl_file_get((Eo *) obj, filename, NULL);
|
efl_file_get((Eo *) obj, filename, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
elm_video_audio_level_set(Evas_Object *obj, double volume)
|
||||||
|
{
|
||||||
|
efl_player_audio_volume_set(obj, volume);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI double
|
||||||
|
elm_video_audio_level_get(const Evas_Object *obj)
|
||||||
|
{
|
||||||
|
return efl_player_audio_volume_get(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
elm_video_audio_mute_set(Evas_Object *obj, Eina_Bool mute)
|
||||||
|
{
|
||||||
|
efl_player_audio_mute_set(obj, mute);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Eina_Bool
|
||||||
|
elm_video_audio_mute_get(const Evas_Object *obj)
|
||||||
|
{
|
||||||
|
return efl_player_audio_mute_get(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI double
|
||||||
|
elm_video_play_length_get(const Evas_Object *obj)
|
||||||
|
{
|
||||||
|
return efl_player_length_get(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Eina_Bool
|
||||||
|
elm_video_is_seekable_get(const Evas_Object *obj)
|
||||||
|
{
|
||||||
|
return efl_player_seekable_get(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
elm_video_play_position_set(Evas_Object *obj, double position)
|
||||||
|
{
|
||||||
|
efl_player_position_set(obj, position);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI double
|
||||||
|
elm_video_play_position_get(const Evas_Object *obj)
|
||||||
|
{
|
||||||
|
return efl_player_position_get(obj);
|
||||||
|
}
|
||||||
|
|
||||||
#include "elm_video.eo.c"
|
#include "elm_video.eo.c"
|
||||||
|
|
|
@ -1,19 +1,9 @@
|
||||||
class Elm.Video (Elm.Layout, Efl.File, Elm.Interface.Atspi_Widget_Action)
|
class Elm.Video (Elm.Layout, Efl.File,
|
||||||
|
Efl.Player, Elm.Interface.Atspi_Widget_Action)
|
||||||
{
|
{
|
||||||
legacy_prefix: elm_video;
|
legacy_prefix: elm_video;
|
||||||
eo_prefix: elm_obj_video;
|
eo_prefix: elm_obj_video;
|
||||||
methods {
|
methods {
|
||||||
@property audio_level {
|
|
||||||
set {
|
|
||||||
[[Set the audio level of an Elm_Video object.]]
|
|
||||||
}
|
|
||||||
get {
|
|
||||||
[[Get the audio level of the current video.]]
|
|
||||||
}
|
|
||||||
values {
|
|
||||||
volume: double; [[The audio level.]]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@property remember_position {
|
@property remember_position {
|
||||||
set {
|
set {
|
||||||
[[Set whether the object can remember the last played position.
|
[[Set whether the object can remember the last played position.
|
||||||
|
@ -33,31 +23,6 @@ class Elm.Video (Elm.Layout, Efl.File, Elm.Interface.Atspi_Widget_Action)
|
||||||
remember: bool; [[The value.]]
|
remember: bool; [[The value.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@property play_position {
|
|
||||||
set {
|
|
||||||
[[Set the current position (in seconds) to be played in the
|
|
||||||
Elm_Video object.]]
|
|
||||||
}
|
|
||||||
get {
|
|
||||||
[[Get the current position (in seconds) being played in the
|
|
||||||
Elm_Video object.]]
|
|
||||||
}
|
|
||||||
values {
|
|
||||||
position: double; [[The time (in seconds) since the beginning of
|
|
||||||
the media file.]]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@property audio_mute {
|
|
||||||
set {
|
|
||||||
[[Change the mute state of the Elm_Video object.]]
|
|
||||||
}
|
|
||||||
get {
|
|
||||||
[[Get whether audio is muted.]]
|
|
||||||
}
|
|
||||||
values {
|
|
||||||
mute: bool; [[The mute state.]]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@property is_playing {
|
@property is_playing {
|
||||||
get {
|
get {
|
||||||
[[Is the video actually playing.
|
[[Is the video actually playing.
|
||||||
|
@ -68,24 +33,12 @@ class Elm.Video (Elm.Layout, Efl.File, Elm.Interface.Atspi_Widget_Action)
|
||||||
return: bool;
|
return: bool;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@property play_length {
|
|
||||||
get {
|
|
||||||
[[Get the total playing time (in seconds) of the Elm_Video object.]]
|
|
||||||
return: double; [[The total duration (in seconds) of the media file.]]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@property emotion {
|
@property emotion {
|
||||||
get {
|
get {
|
||||||
[[Get the underlying Emotion object.]]
|
[[Get the underlying Emotion object.]]
|
||||||
return: Evas.Object; [[the underlying Emotion object.]]
|
return: Evas.Object; [[the underlying Emotion object.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@property is_seekable {
|
|
||||||
get {
|
|
||||||
[[Is it possible to seek inside the video.]]
|
|
||||||
return: bool; [[true if is possible to seek inside the video.]]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@property title {
|
@property title {
|
||||||
get {
|
get {
|
||||||
[[Get the title (for instance DVD title) from this emotion object.
|
[[Get the title (for instance DVD title) from this emotion object.
|
||||||
|
@ -112,6 +65,11 @@ class Elm.Video (Elm.Layout, Efl.File, Elm.Interface.Atspi_Widget_Action)
|
||||||
Eo.Base.constructor;
|
Eo.Base.constructor;
|
||||||
Efl.File.file.set;
|
Efl.File.file.set;
|
||||||
Efl.File.file.get;
|
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.add;
|
||||||
Evas.Object.Smart.del;
|
Evas.Object.Smart.del;
|
||||||
Elm.Widget.focus_next_manager_is;
|
Elm.Widget.focus_next_manager_is;
|
||||||
|
|
|
@ -60,4 +60,79 @@ EAPI Eina_Bool elm_video_file_set(Eo *obj, const char *filename);
|
||||||
*/
|
*/
|
||||||
EAPI void elm_video_file_get(Eo *obj, const char **filename);
|
EAPI void elm_video_file_get(Eo *obj, const char **filename);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Set the audio level of an Elm_Video object.
|
||||||
|
*
|
||||||
|
* @param[in] volume The audio level.
|
||||||
|
*
|
||||||
|
* @ingroup Elm_Video
|
||||||
|
*/
|
||||||
|
EAPI void elm_video_audio_level_set(Evas_Object *obj, double volume);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the audio level of the current video.
|
||||||
|
*
|
||||||
|
* @return The audio level.
|
||||||
|
*
|
||||||
|
* @ingroup Elm_Video
|
||||||
|
*/
|
||||||
|
EAPI double elm_video_audio_level_get(const Evas_Object *obj);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Change the mute state of the Elm_Video object.
|
||||||
|
*
|
||||||
|
* @param[in] mute The mute state.
|
||||||
|
*
|
||||||
|
* @ingroup Elm_Video
|
||||||
|
*/
|
||||||
|
EAPI void elm_video_audio_mute_set(Evas_Object *obj, Eina_Bool mute);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get whether audio is muted.
|
||||||
|
*
|
||||||
|
* @return The mute state.
|
||||||
|
*
|
||||||
|
* @ingroup Elm_Video
|
||||||
|
*/
|
||||||
|
EAPI Eina_Bool elm_video_audio_mute_get(const Evas_Object *obj);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the total playing time (in seconds) of the Elm_Video object.
|
||||||
|
*
|
||||||
|
* @return The total duration (in seconds) of the media file.
|
||||||
|
*
|
||||||
|
* @ingroup Elm_Video
|
||||||
|
*/
|
||||||
|
EAPI double elm_video_play_length_get(const Evas_Object *obj);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Is it possible to seek inside the video.
|
||||||
|
*
|
||||||
|
* @return true if is possible to seek inside the video.
|
||||||
|
*
|
||||||
|
* @ingroup Elm_Video
|
||||||
|
*/
|
||||||
|
EAPI Eina_Bool elm_video_is_seekable_get(const Evas_Object *obj);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Set the current position (in seconds) to be played in the Elm_Video
|
||||||
|
* object.
|
||||||
|
*
|
||||||
|
* @param[in] position The time (in seconds) since the beginning of the media
|
||||||
|
* file.
|
||||||
|
*
|
||||||
|
* @ingroup Elm_Video
|
||||||
|
*/
|
||||||
|
EAPI void elm_video_play_position_set(Evas_Object *obj, double position);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the current position (in seconds) being played in the Elm_Video
|
||||||
|
* object.
|
||||||
|
*
|
||||||
|
* @return The time (in seconds) since the beginning of the media file.
|
||||||
|
*
|
||||||
|
* @ingroup Elm_Video
|
||||||
|
*/
|
||||||
|
EAPI double elm_video_play_position_get(const Evas_Object *obj);
|
||||||
|
|
||||||
#include "elm_video.eo.legacy.h"
|
#include "elm_video.eo.legacy.h"
|
||||||
|
|
Loading…
Reference in New Issue