Merge remote-tracking branch 'remotes/origin/upstream'
[framework/uifw/elementary.git] / src / lib / elm_video.h
1 /**
2  * @defgroup Video Video
3  *
4  * @addtogroup Video
5  * @{
6  *
7  * Elementary comes with two object that help design application that need
8 <<<<<<< HEAD
9  * to display video. The main one, Elm_Video, display a video by using Emotion.
10  * It does embedded the video inside an Edje object, so you can do some
11  * animation depending on the video state change. It does also implement a
12  * ressource management policy to remove this burden from the application writer.
13  *
14  * The second one, Elm_Player is a video player that need to be linked with and Elm_Video.
15  * It take care of updating its content according to Emotion event and provide a
16  * way to theme itself. It also does automatically raise the priority of the
17  * linked Elm_Video so it will use the video decoder if available. It also does
18  * activate the remember function on the linked Elm_Video object.
19 =======
20  * to display video. 
21  *
22  * The first one, Elm_Video, display a video by using Emotion.
23  * It embeds the video inside an Edje object, so you can do some
24  * animation depending on the video state change. It also implements a
25  * resource management policy to remove this burden from the application.
26  *
27  * The second one, 
28  * Elm_Player is a video player that need to be linked with an Elm_Video. 
29  * It take care of updating its content according to Emotion event and provide a
30  * way to theme itself. It also automatically raises the priority of the
31  * linked Elm_Video so it will use the video decoder, if available. It also
32  * activates the "remember" function on the linked Elm_Video object.
33 >>>>>>> remotes/origin/upstream
34  *
35  * Signals that you can add callback for are :
36  *
37  * "forward,clicked" - the user clicked the forward button.
38  * "info,clicked" - the user clicked the info button.
39  * "next,clicked" - the user clicked the next button.
40  * "pause,clicked" - the user clicked the pause button.
41  * "play,clicked" - the user clicked the play button.
42  * "prev,clicked" - the user clicked the prev button.
43  * "rewind,clicked" - the user clicked the rewind button.
44  * "stop,clicked" - the user clicked the stop button.
45  *
46 <<<<<<< HEAD
47  * Default contents parts of the player widget that you can use for are:
48 =======
49  * Default content parts of the player widget that you can use for are:
50 >>>>>>> remotes/origin/upstream
51  * @li "video" - A video of the player
52  *
53  */
54
55 /**
56  * @brief Add a new Elm_Player object to the given parent Elementary (container) object.
57  *
58  * @param parent The parent object
59  * @return a new player widget handle or @c NULL, on errors.
60  *
61  * This function inserts a new player widget on the canvas.
62  *
63  * @see elm_object_part_content_set()
64  *
65  * @ingroup Video
66  */
67 EAPI Evas_Object         *elm_player_add(Evas_Object *parent);
68
69 /**
70  * @brief Add a new Elm_Video object to the given parent Elementary (container) object.
71  *
72  * @param parent The parent object
73  * @return a new video widget handle or @c NULL, on errors.
74  *
75  * This function inserts a new video widget on the canvas.
76  *
77  * @see elm_video_file_set()
78 <<<<<<< HEAD
79  * @see elm_video_uri_set()
80 =======
81 >>>>>>> remotes/origin/upstream
82  *
83  * @ingroup Video
84  */
85 EAPI Evas_Object         *elm_video_add(Evas_Object *parent);
86
87 /**
88 <<<<<<< HEAD
89  * @brief Define the file that will be the video source.
90  *
91  * @param video The video object to define the file for.
92  * @param filename The file to target.
93  *
94  * This function will explicitly define a filename as a source
95  * for the video of the Elm_Video object.
96  *
97  * @see elm_video_uri_set()
98  * @see elm_video_add()
99  * @see elm_player_add()
100  *
101  * @ingroup Video
102  */
103 EAPI void                 elm_video_file_set(Evas_Object *video, const char *filename);
104
105 /**
106  * @brief Define the uri that will be the video source.
107  *
108  * @param video The video object to define the file for.
109  * @param uri The uri to target.
110  *
111  * This function will define an uri as a source for the video of the
112  * Elm_Video object. URI could be remote source of video, like http:// or local source
113  * like for example WebCam who are most of the time v4l2:// (but that depend and
114  * you should use Emotion API to request and list the available Webcam on your system).
115  *
116  * @see elm_video_file_set()
117 =======
118  * @brief Define the file or URI that will be the video source.
119  *
120  * @param video The video object to define the file or URI for the video
121  * of the Elm_Video object. 
122  *
123  * @param filename The file or URI to target.
124  * Local files can be specified using file:// or by using full file paths.
125  * URI could be remote source of video, like http:// or local source like 
126  * WebCam (v4l2://). (You can use Emotion API to request and list 
127  * the available Webcam on your system).
128  *
129  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise
130  *
131  * This function will explicitly define a file or URI as a source
132  * for the video of the Elm_Video object.
133  *
134 >>>>>>> remotes/origin/upstream
135  * @see elm_video_add()
136  * @see elm_player_add()
137  *
138  * @ingroup Video
139  */
140 <<<<<<< HEAD
141 EAPI void                 elm_video_uri_set(Evas_Object *video, const char *uri);
142 =======
143 EAPI Eina_Bool            elm_video_file_set(Evas_Object *video, const char *filename);
144 >>>>>>> remotes/origin/upstream
145
146 /**
147  * @brief Get the underlying Emotion object.
148  *
149  * @param video The video object to proceed the request on.
150  * @return the underlying Emotion object.
151  *
152  * @ingroup Video
153  */
154 EAPI Evas_Object         *elm_video_emotion_get(const Evas_Object *video);
155
156 /**
157  * @brief Start to play the video
158  *
159  * @param video The video object to proceed the request on.
160  *
161  * Start to play the video and cancel all suspend state.
162  *
163  * @ingroup Video
164  */
165 EAPI void                 elm_video_play(Evas_Object *video);
166
167 /**
168  * @brief Pause the video
169  *
170  * @param video The video object to proceed the request on.
171  *
172  * Pause the video and start a timer to trigger suspend mode.
173  *
174  * @ingroup Video
175  */
176 EAPI void                 elm_video_pause(Evas_Object *video);
177
178 /**
179  * @brief Stop the video
180  *
181  * @param video The video object to proceed the request on.
182  *
183  * Stop the video and put the emotion in deep sleep mode.
184  *
185  * @ingroup Video
186  */
187 EAPI void                 elm_video_stop(Evas_Object *video);
188
189 /**
190  * @brief Is the video actually playing.
191  *
192  * @param video The video object to proceed the request on.
193  * @return EINA_TRUE if the video is actually playing.
194  *
195  * You should consider watching event on the object instead of polling
196  * the object state.
197  *
198  * @ingroup Video
199  */
200 <<<<<<< HEAD
201 EAPI Eina_Bool            elm_video_is_playing(const Evas_Object *video);
202 =======
203 EAPI Eina_Bool            elm_video_is_playing_get(const Evas_Object *video);
204 >>>>>>> remotes/origin/upstream
205
206 /**
207  * @brief Is it possible to seek inside the video.
208  *
209  * @param video The video object to proceed the request on.
210  * @return EINA_TRUE if is possible to seek inside the video.
211  *
212  * @ingroup Video
213  */
214 <<<<<<< HEAD
215 EAPI Eina_Bool            elm_video_is_seekable(const Evas_Object *video);
216 =======
217 EAPI Eina_Bool            elm_video_is_seekable_get(const Evas_Object *video);
218 >>>>>>> remotes/origin/upstream
219
220 /**
221  * @brief Is the audio muted.
222  *
223  * @param video The video object to proceed the request on.
224  * @return EINA_TRUE if the audio is muted.
225  *
226  * @ingroup Video
227  */
228 EAPI Eina_Bool            elm_video_audio_mute_get(const Evas_Object *video);
229
230 /**
231  * @brief Change the mute state of the Elm_Video object.
232  *
233  * @param video The video object to proceed the request on.
234  * @param mute The new mute state.
235  *
236  * @ingroup Video
237  */
238 EAPI void                 elm_video_audio_mute_set(Evas_Object *video, Eina_Bool mute);
239
240 /**
241  * @brief Get the audio level of the current video.
242  *
243  * @param video The video object to proceed the request on.
244  * @return the current audio level.
245  *
246  * @ingroup Video
247  */
248 EAPI double               elm_video_audio_level_get(const Evas_Object *video);
249
250 /**
251 <<<<<<< HEAD
252  * @brief Set the audio level of anElm_Video object.
253 =======
254  * @brief Set the audio level of an Elm_Video object.
255 >>>>>>> remotes/origin/upstream
256  *
257  * @param video The video object to proceed the request on.
258  * @param volume The new audio volume.
259  *
260  * @ingroup Video
261  */
262 EAPI void                 elm_video_audio_level_set(Evas_Object *video, double volume);
263
264 <<<<<<< HEAD
265 EAPI double               elm_video_play_position_get(const Evas_Object *video);
266 EAPI void                 elm_video_play_position_set(Evas_Object *video, double position);
267 EAPI double               elm_video_play_length_get(const Evas_Object *video);
268 EAPI void                 elm_video_remember_position_set(Evas_Object *video, Eina_Bool remember);
269 EAPI Eina_Bool            elm_video_remember_position_get(const Evas_Object *video);
270 =======
271 /**
272  * @brief Get the current position (in seconds) being played in the 
273  * Elm_Video object.
274  *
275  * @param video The video object.
276  * @return the time(in seconds) since the beginning of the media file.
277  *
278  * @ingroup Video
279  */
280 EAPI double               elm_video_play_position_get(const Evas_Object *video);
281
282 /**
283  * @brief Set the current position (in seconds) to be played in the 
284  * Elm_Video object.
285  *
286  * @param video The video object.
287  * @param position the time(in seconds) since the beginning of the media file.
288  *
289  * @ingroup Video
290  */
291 EAPI void                 elm_video_play_position_set(Evas_Object *video, double position);
292 /**
293  * @brief Get the total playing time (in seconds) of the Elm_Video object.
294  *
295  * @param video The video object.
296  * @return the total duration(in seconds) of the media file.
297  *
298  * @ingroup Video
299  */
300 EAPI double               elm_video_play_length_get(const Evas_Object *video);
301
302 /**
303  * @brief Set whether the object can remember the last played position.
304  *
305  * @param video The video object.
306  * @param remember the last played position of the Elm_Video object.
307  *
308  * @note This API only serves as indication. System support is required.
309  *
310  * @ingroup Video
311  */
312 EAPI void                 elm_video_remember_position_set(Evas_Object *video, Eina_Bool remember);
313
314 /**
315  * @brief Set whether the object can remember the last played position.
316  *
317  * @param video The video object.
318  * @return whether the object remembers the last played position (EINA_TRUE) 
319  * or not.
320  *
321  * @note This API only serves as indication. System support is required.
322  *
323  * @ingroup Video
324  */
325 EAPI Eina_Bool            elm_video_remember_position_get(const Evas_Object *video);
326
327 /**
328  * @brief Get the title (for ex. DVD title) from this emotion object.
329  *
330  * @param video The Elm_Video object.
331  * @return A string containing the title.
332  *
333  * This function is only useful when playing a DVD.
334  *
335  * @note Don't change or free the string returned by this function.
336  *
337  * @ingroup Video
338  */
339 >>>>>>> remotes/origin/upstream
340 EAPI const char          *elm_video_title_get(const Evas_Object *video);
341 /**
342  * @}
343  */