Creation and initialization functions

Functions

EAPI Evas_Objectemotion_object_add (Evas *evas)
 Add an emotion object to the canvas. More...
 
EAPI void emotion_object_module_option_set (Evas_Object *obj, const char *opt, const char *val)
 Set the specified option for the current module. More...
 
EAPI Eina_Bool emotion_object_init (Evas_Object *obj, const char *module_filename)
 Initializes an emotion object with the specified module. More...
 
EAPI Eina_Bool emotion_object_file_set (Evas_Object *obj, const char *filename)
 Set the file to be played in the Emotion object. More...
 
EAPI 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

EAPI 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, and emotion_signals_example.c.

References EAPI, and evas_object_smart_add().

EAPI void emotion_object_module_option_set ( Evas_Object obj,
const char *  opt,
const char *  val 
)

Set the specified option for the current module.

Parameters
objThe emotion object which the option is being set to.
optThe option that is being set. Currently supported optiosn: "video" and "audio".
valThe value of the option. Currently only supports "off" (?!?!?!)

This function allows one to mute the video or audio of the emotion object.

Note
Please don't use this function, consider using emotion_object_audio_mute_set() and emotion_object_video_mute_set() instead.
See also
emotion_object_audio_mute_set()
emotion_object_video_mute_set()

References EAPI, EINA_FALSE, and EINA_TRUE.

EAPI Eina_Bool emotion_object_init ( Evas_Object obj,
const char *  module_filename 
)

Initializes an emotion object with the specified module.

Parameters
objThe emotion object to be initialized.
module_filenameThe name of the module to be used (gstreamer or xine).
Returns
EINA_TRUE if the specified module was successfully initialized for this object, EINA_FALSE otherwise.

This function is required after creating the emotion object, in order to specify which module will be used with this object. Different objects can use different modules to play a media file. The current supported modules are gstreamer and xine.

To use any of them, you need to make sure that support for them was compiled correctly.

Note
It's possible to disable the build of a module with –disable-module_name.
See also
emotion_object_add()
emotion_object_file_set()
Examples:
emotion_basic_example.c, and emotion_signals_example.c.

References EAPI, ecore_animator_del(), EINA_FALSE, eina_stringshare_del(), EINA_TRUE, and emotion_object_file_set().

EAPI 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, and emotion_signals_example.c.

References EAPI, ecore_animator_del(), EINA_FALSE, EINA_TRUE, eio_file_cancel(), evas_object_image_data_set(), and evas_object_image_size_set().

Referenced by emotion_object_init().

EAPI 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()

References EAPI, EMOTION_ASPECT_CROP, EMOTION_ASPECT_CUSTOM, EMOTION_ASPECT_KEEP_BOTH, EMOTION_ASPECT_KEEP_HEIGHT, EMOTION_ASPECT_KEEP_NONE, EMOTION_ASPECT_KEEP_WIDTH, evas_object_clip_get(), evas_object_clip_set(), evas_object_clip_unset(), evas_object_color_set(), evas_object_del(), evas_object_evas_get(), evas_object_geometry_get(), evas_object_rectangle_add(), evas_object_show(), evas_object_smart_member_add(), and evas_object_visible_get().