efl

Форк
0
/
emotion_examples.dox 
104 строки · 3.6 Кб
1
/**
2
 * @page emotion_examples Emotion Examples
3
 *
4
 * Here is a page with some Emotion examples explained:
5
 *
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"
9
 *
10
 */
11

12
/**
13
 * @page emotion_basic_example_c Emotion - Basic library usage
14
 *
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".
18
 *
19
 * @dontinclude emotion_basic_example.c
20
 *
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:
23
 *
24
 * @until stdio.h
25
 *
26
 * Then a callback will be declared, to be called when the object starts its
27
 * playback:
28
 *
29
 * @until }
30
 *
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
35
 * explanation for it:
36
 *
37
 * @until evas_object_show(bg);
38
 *
39
 * Finally, we start the Emotion part. First we have to create the object in
40
 * this canvas, and initialize it:
41
 *
42
 * @until emotion_object_init
43
 *
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().
48
 *
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():
51
 *
52
 * @until NULL
53
 *
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:
56
 *
57
 * @until file_set
58
 *
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:
64
 *
65
 * @until evas_object_show
66
 *
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:
70
 *
71
 * @until main_loop_begin
72
 *
73
 * The rest of the code doesn't contain anything special:
74
 *
75
 * @until }
76
 *
77
 * This code just free the canvas, shutdown the library, and has an entry point
78
 * for exiting on error.
79
 */
80

81

82
/**
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".
86
 */
87

88
/**
89
 * @example emotion_signals_example.c
90
 *
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.
94
 *
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:
99
 */
100

101
/**
102
 * @example emotion_test_main.c
103
 * This example covers the entire emotion API. Use it as a reference.
104
 */
105

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.