2
* @page emotion_examples Emotion Examples
4
* Here is a page with some Emotion examples explained:
6
* @li @ref emotion_basic_example_c
7
* @li @ref emotion_signals_example.c "Emotion signals"
8
* @li @ref emotion_test_main.c "emotion_test - full API usage"
13
* @page emotion_basic_example_c Emotion - Basic library usage
15
* This example shows how to setup a simple Emotion object, make it start
16
* playing and register a callback that tells when the playback started. See @ref
17
* emotion_basic_example.c "the full code here".
19
* @dontinclude emotion_basic_example.c
21
* We start this example by including some header files that will be necessary
22
* to work with Emotion, and to display some debug messages:
26
* Then a callback will be declared, to be called when the object starts its
31
* Some basic setup of our canvas, window and background is necessary before
32
* displaying our object on it. This setup also includes reading the file to be
33
* opened from the program's argument list. Since this is not directly related
34
* to Emotion itself, we are just displaying the code for this without an
37
* @until evas_object_show(bg);
39
* Finally, we start the Emotion part. First we have to create the object in
40
* this canvas, and initialize it:
42
* @until emotion_object_init
44
* Notice that we didn't specify which module will be used, so emotion will use
45
* the first module found. There's no guarantee of the order that the modules
46
* will be found, so if you need to use one of them specifically, please be
47
* explicit in the second argument of the function emotion_object_init().
49
* Now the callback can be registered to this object. It's a normal Evas smart
50
* object callback, so we add it with evas_object_smart_callback_add():
54
* The object itself is ready for use, but we need to load a file to it. This is
55
* done by the following function:
59
* This object can play audio or video files. For the latter, the image must be
60
* displayed in our canvas, and that's why we need to add the object to the
61
* canvas. So, like any other Evas object in the canvas, we have to specify its
62
* position and size, and explicitly set its visibility. These are the position
63
* and dimension where the video will be displayed:
65
* @until evas_object_show
67
* Since the basic steps were done, we can now start playing our file. For this,
68
* we can just call the basic playback control function, and then we can go to
69
* the main loop and watch the audio/video playing:
71
* @until main_loop_begin
73
* The rest of the code doesn't contain anything special:
77
* This code just free the canvas, shutdown the library, and has an entry point
78
* for exiting on error.
83
* @example emotion_basic_example.c
84
* This example shows how to create and play an Emotion object. See @ref
85
* emotion_basic_example_c "the explanation here".
89
* @example emotion_signals_example.c
91
* This example shows that some of the information available from the emotion
92
* object, like the media file play length, aspect ratio, etc. can be not
93
* available just after setting the file to the emotion object.
95
* One callback is declared for each of the following signals, and some of the
96
* info about the file is displayed. Also notice that the order that these
97
* signals are emitted can change depending on the module being used. Following
98
* is the full source code of this example:
102
* @example emotion_test_main.c
103
* This example covers the entire emotion API. Use it as a reference.