Functions | |
EMOTION_API void | emotion_object_border_set (Evas_Object *obj, int l, int r, int t, int b) |
Set borders for the emotion object. More... | |
EMOTION_API void | emotion_object_border_get (const Evas_Object *obj, int *l, int *r, int *t, int *b) |
Get the borders set for the emotion object. More... | |
EMOTION_API void | emotion_object_bg_color_set (Evas_Object *obj, int r, int g, int b, int a) |
Set a color for the background rectangle of this emotion object. More... | |
EMOTION_API void | emotion_object_bg_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a) |
Get the background color set for the emotion object. More... | |
EMOTION_API void | emotion_object_keep_aspect_set (Evas_Object *obj, Emotion_Aspect a) |
Set whether emotion should keep the aspect ratio of the video. More... | |
EMOTION_API Emotion_Aspect | emotion_object_keep_aspect_get (const Evas_Object *obj) |
Get the current emotion aspect ratio policy. More... | |
EMOTION_API double | emotion_object_ratio_get (const Evas_Object *obj) |
Retrieve the video aspect ratio of the media file loaded. More... | |
EMOTION_API void | emotion_object_size_get (const Evas_Object *obj, int *iw, int *ih) |
Retrieve the video size of the loaded file. More... | |
EMOTION_API void | emotion_object_smooth_scale_set (Evas_Object *obj, Eina_Bool smooth) |
Sets whether to use of high-quality image scaling algorithm of the given video object. More... | |
EMOTION_API Eina_Bool | emotion_object_smooth_scale_get (const Evas_Object *obj) |
Gets whether the high-quality image scaling algorithm of the given video object is used. More... | |
EMOTION_API void | emotion_object_video_mute_set (Evas_Object *obj, Eina_Bool mute) |
Set the mute video option for this object. More... | |
EMOTION_API Eina_Bool | emotion_object_video_mute_get (const Evas_Object *obj) |
Get the mute video option of this object. More... | |
EMOTION_API void | emotion_object_video_subtitle_file_set (Evas_Object *obj, const char *filepath) |
Set the video's subtitle file path. More... | |
EMOTION_API const char * | emotion_object_video_subtitle_file_get (const Evas_Object *obj) |
Get the video's subtitle file path. More... | |
EMOTION_API int | emotion_object_video_channel_count (const Evas_Object *obj) |
Get the number of available video channel. More... | |
EMOTION_API const char * | emotion_object_video_channel_name_get (const Evas_Object *obj, int channel) |
Get the name of a given video channel. More... | |
EMOTION_API void | emotion_object_video_channel_set (Evas_Object *obj, int channel) |
Set the channel for a given video object. More... | |
EMOTION_API int | emotion_object_video_channel_get (const Evas_Object *obj) |
Get the channel for a given video object. More... | |
EMOTION_API void emotion_object_border_set | ( | Evas_Object * | obj, |
int | l, | ||
int | r, | ||
int | t, | ||
int | b | ||
) |
Set borders for the emotion object.
obj | The emotion object where borders are being set. |
l | The left border. |
r | The right border. |
t | The top border. |
b | The bottom border. |
This function sets borders for the emotion video object (just when a video is present). When positive values are given to one of the parameters, a border will be added to the respective position of the object, representing that size on the original video size. However, if the video is scaled up or down (i.e. the emotion object size is different from the video size), the borders will be scaled respectively too.
If a negative value is given to one of the parameters, instead of a border, that respective side of the video will be cropped.
It's possible to set a color for the added borders (default is transparent) with emotion_object_bg_color_set(). By default, an Emotion object doesn't have any border.
References EMOTION_ASPECT_CUSTOM, and evas_object_geometry_get().
EMOTION_API void emotion_object_border_get | ( | const Evas_Object * | obj, |
int * | l, | ||
int * | r, | ||
int * | t, | ||
int * | b | ||
) |
Get the borders set for the emotion object.
obj | The emotion object from which the borders are being retrieved. |
l | The left border. |
r | The right border. |
t | The top border. |
b | The bottom border. |
EMOTION_API void emotion_object_bg_color_set | ( | Evas_Object * | obj, |
int | r, | ||
int | g, | ||
int | b, | ||
int | a | ||
) |
Set a color for the background rectangle of this emotion object.
obj | The emotion object where the background color is being set. |
r | Red component of the color. |
g | Green component of the color. |
b | Blue component of the color. |
a | Alpha channel of the color. |
This is useful when a border is added to any side of the Emotion object. The area between the edge of the video and the edge of the object will be filled with the specified color.
The default color is 0, 0, 0, 0 (transparent).
References evas_object_color_set().
EMOTION_API void emotion_object_bg_color_get | ( | const Evas_Object * | obj, |
int * | r, | ||
int * | g, | ||
int * | b, | ||
int * | a | ||
) |
Get the background color set for the emotion object.
obj | The emotion object from which the background color is being retrieved. |
r | Red component of the color. |
g | Green component of the color. |
b | Blue component of the color. |
a | AAlpha channel of the color. |
References evas_object_color_get().
EMOTION_API void emotion_object_keep_aspect_set | ( | Evas_Object * | obj, |
Emotion_Aspect | a | ||
) |
Set whether emotion should keep the aspect ratio of the video.
obj | The emotion object where to set the aspect. |
a | The aspect ratio policy. |
Instead of manually calculating the required border to set with emotion_object_border_set(), and using this to fix the aspect ratio of the video when the emotion object has a different aspect, it's possible to just set the policy to be used.
The options are:
References evas_object_geometry_get().
EMOTION_API Emotion_Aspect emotion_object_keep_aspect_get | ( | const Evas_Object * | obj | ) |
Get the current emotion aspect ratio policy.
obj | The emotion object from which we are fetching the aspect ratio policy. |
References EMOTION_ASPECT_KEEP_NONE.
EMOTION_API double emotion_object_ratio_get | ( | const Evas_Object * | obj | ) |
Retrieve the video aspect ratio of the media file loaded.
obj | The emotion object which the video aspect ratio will be retrieved from. |
This function returns the video aspect ratio (width / height) of the file loaded. It can be used to adapt the size of the emotion object in the canvas, so the aspect won't be changed (by wrongly resizing the object). Or to crop the video correctly, if necessary.
The described behavior can be applied like following. Consider a given emotion object that we want to position inside an area, which we will represent by w
and h
. Since we want to position this object either stretching, or filling the entire area but overflowing the video, or just adjust the video to fit inside the area without keeping the aspect ratio, we must compare the video aspect ratio with the area aspect ratio:
Now, if we want to make the video fit inside the area, the following code would do it:
And for keeping the aspect ratio but making the video fill the entire area, overflowing the content which can't fit inside it, we would do:
Finally, by just resizing the video to the video area, we would have the video stretched:
The following diagram exemplifies what would happen to the video, respectively, in each case:
EMOTION_API void emotion_object_size_get | ( | const Evas_Object * | obj, |
int * | iw, | ||
int * | ih | ||
) |
Retrieve the video size of the loaded file.
obj | The object from which we are retrieving the video size. |
iw | A pointer to a variable where the width will be stored. |
ih | A pointer to a variable where the height will be stored. |
This function returns the reported size of the loaded video file. If a file that doesn't contain a video channel is loaded, then this size can be ignored.
The value reported by this function should be consistent with the aspect ratio returned by emotion_object_ratio_get(), but sometimes the information stored in the file is wrong. So use the ratio size reported by emotion_object_ratio_get(), since it is more likely going to be accurate.
NULL
for iw
or ih
if you don't need one of these values.EMOTION_API void emotion_object_smooth_scale_set | ( | Evas_Object * | obj, |
Eina_Bool | smooth | ||
) |
Sets whether to use of high-quality image scaling algorithm of the given video object.
When enabled, a higher quality video scaling algorithm is used when scaling videos to sizes other than the source video. This gives better results but is more computationally expensive.
obj | The given video object. |
smooth | Whether to use smooth scale or not. |
EMOTION_API Eina_Bool emotion_object_smooth_scale_get | ( | const Evas_Object * | obj | ) |
Gets whether the high-quality image scaling algorithm of the given video object is used.
obj | The given video object. |
EMOTION_API void emotion_object_video_mute_set | ( | Evas_Object * | obj, |
Eina_Bool | mute | ||
) |
Set the mute video option for this object.
obj | The object which we are setting the mute video option. |
mute | Whether the video should be muted (EINA_TRUE ) or not (EINA_FALSE ). |
This function sets the mute video option for this emotion object. The current module used for this object can use this information to avoid decoding the video portion of the loaded media file.
References DBG.
EMOTION_API Eina_Bool emotion_object_video_mute_get | ( | const Evas_Object * | obj | ) |
Get the mute video option of this object.
obj | The object which we are retrieving the mute video option from. |
EINA_TRUE
) or not (EINA_FALSE
).This function returns the mute video option from this emotion object. It can be set with emotion_object_video_mute_set().
References EINA_FALSE.
EMOTION_API void emotion_object_video_subtitle_file_set | ( | Evas_Object * | obj, |
const char * | filepath | ||
) |
Set the video's subtitle file path.
obj | The object which we are setting a subtitle file path. |
filepath | The subtitle file path. |
This function sets a video's subtitle file path(i.e an .srt file) for supported subtitle formats consult the backend's documentation.
References DBG.
EMOTION_API const char * emotion_object_video_subtitle_file_get | ( | const Evas_Object * | obj | ) |
Get the video's subtitle file path.
obj | The object which we are retrieving the subtitle file path from. |
This function returns the video's subtitle file path, if not previously set or in error NULL is returned.
EMOTION_API int emotion_object_video_channel_count | ( | const Evas_Object * | obj | ) |
Get the number of available video channel.
obj | The object which we are retrieving the channel count from |
EMOTION_API const char * emotion_object_video_channel_name_get | ( | const Evas_Object * | obj, |
int | channel | ||
) |
Get the name of a given video channel.
obj | The object which we are retrieving the channel name from |
channel | the channel number |
EMOTION_API void emotion_object_video_channel_set | ( | Evas_Object * | obj, |
int | channel | ||
) |
Set the channel for a given video object.
obj | The target object which we are setting the channel |
channel | the channel number to be setted. |
References DBG.
EMOTION_API int emotion_object_video_channel_get | ( | const Evas_Object * | obj | ) |
Get the channel for a given video object.
obj | The target object which we are getting the channel |