Modules | Typedefs | Functions | Variables
API available for manipulating Emotion object.

How to create, initialize, manipulate and connect to signals of an Emotion object. More...

Modules

 Creation and initialization functions
 
 Audio control functions
 
 Video control functions
 
 Visualization control functions
 
 Miscellaneous information retrieval functions
 
 Video resource management
 
 Play control functions
 
 API available for accessing webcam
 

Typedefs

typedef struct _Emotion_Webcam Emotion_Webcam
 Webcam description.
 

Functions

EMOTION_API Eina_Bool emotion_init (void)
 Initialise Emotion library. More...
 
EMOTION_API Eina_Bool emotion_shutdown (void)
 Shutdown Emotion library. More...
 
EMOTION_API Eina_Bool emotion_object_video_handled_get (const Evas_Object *obj)
 
EMOTION_API Eina_Bool emotion_object_audio_handled_get (const Evas_Object *obj)
 
EMOTION_API void emotion_object_event_simple_send (Evas_Object *obj, Emotion_Event ev)
 Send an Emotion Event to an Evas object. More...
 
EMOTION_API int emotion_object_audio_channel_count (const Evas_Object *obj)
 
EMOTION_API const char * emotion_object_audio_channel_name_get (const Evas_Object *obj, int channel)
 
EMOTION_API void emotion_object_audio_channel_set (Evas_Object *obj, int channel)
 
EMOTION_API int emotion_object_audio_channel_get (const Evas_Object *obj)
 
EMOTION_API void emotion_object_spu_mute_set (Evas_Object *obj, Eina_Bool mute)
 
EMOTION_API Eina_Bool emotion_object_spu_mute_get (const Evas_Object *obj)
 
EMOTION_API int emotion_object_spu_channel_count (const Evas_Object *obj)
 
EMOTION_API const char * emotion_object_spu_channel_name_get (const Evas_Object *obj, int channel)
 
EMOTION_API void emotion_object_spu_channel_set (Evas_Object *obj, int channel)
 
EMOTION_API int emotion_object_spu_channel_get (const Evas_Object *obj)
 
EMOTION_API int emotion_object_chapter_count (const Evas_Object *obj)
 
EMOTION_API void emotion_object_chapter_set (Evas_Object *obj, int chapter)
 
EMOTION_API int emotion_object_chapter_get (const Evas_Object *obj)
 
EMOTION_API const char * emotion_object_chapter_name_get (const Evas_Object *obj, int chapter)
 
EMOTION_API void emotion_object_eject (Evas_Object *obj)
 
EMOTION_API const char * emotion_object_ref_file_get (const Evas_Object *obj)
 
EMOTION_API int emotion_object_ref_num_get (const Evas_Object *obj)
 
EMOTION_API int emotion_object_spu_button_count_get (const Evas_Object *obj)
 
EMOTION_API int emotion_object_spu_button_get (const Evas_Object *obj)
 
EMOTION_API Eina_Bool emotion_object_extension_may_play_fast_get (const char *file)
 Do we have a chance to play that file. More...
 
EMOTION_API Eina_Bool emotion_object_extension_may_play_get (const char *file)
 Do we have a chance to play that file. More...
 
EMOTION_API Evas_Objectemotion_object_image_get (const Evas_Object *obj)
 Get the actual image object that contains the pixels of the video stream. More...
 
EMOTION_API Evas_Objectemotion_file_meta_artwork_get (const Evas_Object *obj, const char *path, Emotion_Artwork_Info type)
 Get the album artwork from file meta data tags. More...
 

Variables

EMOTION_API int EMOTION_WEBCAM_UPDATE
 Ecore_Event triggered when a new webcam is plugged or unplugged.
 
EMOTION_API int EMOTION_WEBCAM_ADD
 Ecore_Event triggered when a new webcam is plugged in. More...
 
EMOTION_API int EMOTION_WEBCAM_DEL
 Ecore_Event triggered when a webcam is unplugged. More...
 

Detailed Description

How to create, initialize, manipulate and connect to signals of an Emotion object.

Emotion provides an Evas smart object that allows to play, control and display a video or audio file. The API is synchronous but not everything happens immediately. There are also some signals to report changed states.

Basically, once the object is created and initialized, a file will be set to it, and then it can be resized, moved, and controlled by other Evas object functions.

However, the decoding of the music and video occurs not in the Ecore main loop, but usually in another thread (this depends on the module being used). The synchronization between this other thread and the main loop not visible to the end user of the library. The user can just register callbacks to the available signals to receive information about the changed states, and can call other functions from the API to request more changes on the current loaded file.

There will be a delay between an API being called and it being really executed, since this request will be done in the main thread, and it needs to be sent to the decoding thread. For this reason, always call functions like emotion_object_size_get() or emotion_object_length_get() after some signal being sent, like "playback_started" or "open_done". This example demonstrates this behavior.

Available signals

The Evas_Object returned by emotion_object_add() has a number of signals that can be listened to using evas' smart callbacks mechanism. All signals have NULL as event info. The following is a list of interesting signals:

Emotion_Examples

The following examples exemplify the emotion usage. There's also the emotion_test binary that is distributed with this library and cover the entire API, but since it is too long and repetitive to be explained, its code is just displayed as another example.

Function Documentation

◆ emotion_init()

EMOTION_API Eina_Bool emotion_init ( void  )

Initialise Emotion library.

Initialise needed libraries like eina ecore eet Initialise needed modules like webcam

Examples
emotion_test_main.c.

◆ emotion_shutdown()

EMOTION_API Eina_Bool emotion_shutdown ( void  )

◆ emotion_object_event_simple_send()

EMOTION_API void emotion_object_event_simple_send ( Evas_Object obj,
Emotion_Event  ev 
)

Send an Emotion Event to an Evas object.

Parameters
objThe object target of the event.
evThe emotion event.
See also
Emotion_Event
Examples
emotion_test_main.c.

◆ emotion_object_extension_may_play_fast_get()

EMOTION_API Eina_Bool emotion_object_extension_may_play_fast_get ( const char *  file)

Do we have a chance to play that file.

Parameters
fileA stringshared filename that we want to know if Emotion can play.

This just actually look at the extension of the file, it doesn't check the mime-type nor if the file is actually sane. So this is just an hint for your application.

See also
emotion_object_extension_may_play_get()

References EINA_FALSE, and EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by emotion_object_extension_may_play_get().

◆ emotion_object_extension_may_play_get()

EMOTION_API Eina_Bool emotion_object_extension_may_play_get ( const char *  file)

Do we have a chance to play that file.

Parameters
fileA filename that we want to know if Emotion can play.

This just actually look at the extension of the file, it doesn't check the mime-type nor if the file is actually sane. So this is just an hint for your application.

See also
emotion_object_extension_may_play_fast_get()

References EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, eina_stringshare_add(), eina_stringshare_del(), and emotion_object_extension_may_play_fast_get().

◆ emotion_object_image_get()

EMOTION_API Evas_Object * emotion_object_image_get ( const Evas_Object obj)

Get the actual image object that contains the pixels of the video stream.

Parameters
objThe object which the query is being ran on.

This function is useful when you want to get a direct access to the pixels.

See also
emotion_object_image_get()

◆ emotion_file_meta_artwork_get()

EMOTION_API Evas_Object * emotion_file_meta_artwork_get ( const Evas_Object obj,
const char *  path,
Emotion_Artwork_Info  type 
)

Get the album artwork from file meta data tags.

Parameters
objThe evas object we are working with.
pathThe local path for the file.
typeThe metadata location type (GST_IMAGE_PREVIEW_IMAGE or GST_PREVIEW).
Since
1.19

References EVAS_LOAD_ERROR_NONE, evas_object_evas_get(), evas_object_image_add(), and evas_object_image_load_error_get().

Variable Documentation

◆ EMOTION_WEBCAM_ADD

EMOTION_API int EMOTION_WEBCAM_ADD
extern

Ecore_Event triggered when a new webcam is plugged in.

Since
1.8

◆ EMOTION_WEBCAM_DEL

EMOTION_API int EMOTION_WEBCAM_DEL
extern

Ecore_Event triggered when a webcam is unplugged.

Since
1.8