Functions
Creation and initialization functions

Functions

EMOTION_API Evas_Objectemotion_object_add (Evas *evas)
 Add an emotion object to the canvas. More...
 
EMOTION_API Eina_Bool emotion_object_file_set (Evas_Object *obj, const char *filename)
 Set the file to be played in the Emotion object. More...
 
EMOTION_API const char * emotion_object_file_get (const Evas_Object *obj)
 Get the filename of the file associated with the emotion object. More...
 

Detailed Description

Function Documentation

◆ emotion_object_add()

EMOTION_API Evas_Object * emotion_object_add ( Evas evas)

Add an emotion object to the canvas.

Parameters
evasThe canvas where the object will be added to.
Returns
The emotion object just created.

This function creates an emotion object and adds it to the specified evas. The returned object can be manipulated as any other Evas object, using the default object manipulation functions - evas_object_*.

After creating the object with this function, it's still necessary to initialize it with emotion_object_init(), and if an audio file is going to be played with this object instead of a video, use emotion_object_video_mute_set().

The next step is to open the desired file with emotion_object_file_set(), and start playing it with emotion_object_play_set().

See also
emotion_object_init()
emotion_object_video_mute_set()
emotion_object_file_set()
emotion_object_play_set()
Examples
emotion_basic_example.c, emotion_signals_example.c, and emotion_test_main.c.

References EINA_SAFETY_ON_FALSE_RETURN_VAL, and EVAS_CANVAS_CLASS.

◆ emotion_object_file_set()

EMOTION_API Eina_Bool emotion_object_file_set ( Evas_Object obj,
const char *  filename 
)

Set the file to be played in the Emotion object.

Parameters
objThe emotion object where the file is being loaded.
filenamePath to the file to be loaded. It can be absolute or relative path.
Returns
EINA_TRUE if the new file could be loaded successfully, and EINA_FALSE if the file could not be loaded. This happens when the filename is could not be found, when the module couldn't open the file, when no module is initialized in this object, or when the filename is the same as the one previously set.

This function sets the file to be used with this emotion object. If the object already has another file set, this file will be unset and unloaded, and the new file will be loaded to this emotion object. The seek position will be set to 0, and the emotion object will be paused, instead of playing.

If there was already a filename set, and it's the same as the one being set now, this function does nothing and returns EINA_FALSE.

Use NULL as argument to filename if you want to unload the current file but don't want to load anything else.

See also
emotion_object_init()
emotion_object_play_set()
emotion_object_file_get()
Examples
emotion_basic_example.c, emotion_signals_example.c, and emotion_test_main.c.

◆ emotion_object_file_get()

EMOTION_API const char * emotion_object_file_get ( const Evas_Object obj)

Get the filename of the file associated with the emotion object.

Parameters
objThe emotion object from which the filename will be retrieved.
Returns
The path to the file loaded into this emotion object.

This function returns the path of the file loaded in this emotion object. If no object is loaded, it will return NULL.

Note
Don't free or change the string returned by this function in any way. If you want to unset it, use emotion_object_file_set(obj, NULL).
See also
emotion_object_file_set()
Examples
emotion_test_main.c.