4ce78ddd498c5e23e1d9b482fccbc6fdcecdb8d7
[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  * to display video. The main one, Elm_Video, display a video by using Emotion.
9  * It does embedded the video inside an Edje object, so you can do some
10  * animation depending on the video state change. It does also implement a
11  * ressource management policy to remove this burden from the application writer.
12  *
13  * The second one, Elm_Player is a video player that need to be linked with and Elm_Video.
14  * It take care of updating its content according to Emotion event and provide a
15  * way to theme itself. It also does automatically raise the priority of the
16  * linked Elm_Video so it will use the video decoder if available. It also does
17  * activate the remember function on the linked Elm_Video object.
18  *
19  * Signals that you can add callback for are :
20  *
21  * "forward,clicked" - the user clicked the forward button.
22  * "info,clicked" - the user clicked the info button.
23  * "next,clicked" - the user clicked the next button.
24  * "pause,clicked" - the user clicked the pause button.
25  * "play,clicked" - the user clicked the play button.
26  * "prev,clicked" - the user clicked the prev button.
27  * "rewind,clicked" - the user clicked the rewind button.
28  * "stop,clicked" - the user clicked the stop button.
29  *
30  * Default contents parts of the player widget that you can use for are:
31  * @li "video" - A video of the player
32  *
33  */
34
35 /**
36  * @brief Add a new Elm_Player object to the given parent Elementary (container) object.
37  *
38  * @param parent The parent object
39  * @return a new player widget handle or @c NULL, on errors.
40  *
41  * This function inserts a new player widget on the canvas.
42  *
43  * @see elm_object_part_content_set()
44  *
45  * @ingroup Video
46  */
47 EAPI Evas_Object         *elm_player_add(Evas_Object *parent);
48
49 /**
50  * @brief Link a Elm_Payer with an Elm_Video object.
51  *
52  * @param player the Elm_Player object.
53  * @param video The Elm_Video object.
54  *
55  * This mean that action on the player widget will affect the
56  * video object and the state of the video will be reflected in
57  * the player itself.
58  *
59  * @see elm_player_add()
60  * @see elm_video_add()
61  * @deprecated use elm_object_part_content_set() instead
62  *
63  * @ingroup Video
64  */
65 EINA_DEPRECATED EAPI void elm_player_video_set(Evas_Object *player, Evas_Object *video);
66
67 /**
68  * @brief Add a new Elm_Video object to the given parent Elementary (container) object.
69  *
70  * @param parent The parent object
71  * @return a new video widget handle or @c NULL, on errors.
72  *
73  * This function inserts a new video widget on the canvas.
74  *
75  * @see elm_video_file_set()
76  * @see elm_video_uri_set()
77  *
78  * @ingroup Video
79  */
80 EAPI Evas_Object         *elm_video_add(Evas_Object *parent);
81
82 /**
83  * @brief Define the file that will be the video source.
84  *
85  * @param video The video object to define the file for.
86  * @param filename The file to target.
87  *
88  * This function will explicitly define a filename as a source
89  * for the video of the Elm_Video object.
90  *
91  * @see elm_video_uri_set()
92  * @see elm_video_add()
93  * @see elm_player_add()
94  *
95  * @ingroup Video
96  */
97 EAPI void                 elm_video_file_set(Evas_Object *video, const char *filename);
98
99 /**
100  * @brief Define the uri that will be the video source.
101  *
102  * @param video The video object to define the file for.
103  * @param uri The uri to target.
104  *
105  * This function will define an uri as a source for the video of the
106  * Elm_Video object. URI could be remote source of video, like http:// or local source
107  * like for example WebCam who are most of the time v4l2:// (but that depend and
108  * you should use Emotion API to request and list the available Webcam on your system).
109  *
110  * @see elm_video_file_set()
111  * @see elm_video_add()
112  * @see elm_player_add()
113  *
114  * @ingroup Video
115  */
116 EAPI void                 elm_video_uri_set(Evas_Object *video, const char *uri);
117
118 /**
119  * @brief Get the underlying Emotion object.
120  *
121  * @param video The video object to proceed the request on.
122  * @return the underlying Emotion object.
123  *
124  * @ingroup Video
125  */
126 EAPI Evas_Object         *elm_video_emotion_get(const Evas_Object *video);
127
128 /**
129  * @brief Start to play the video
130  *
131  * @param video The video object to proceed the request on.
132  *
133  * Start to play the video and cancel all suspend state.
134  *
135  * @ingroup Video
136  */
137 EAPI void                 elm_video_play(Evas_Object *video);
138
139 /**
140  * @brief Pause the video
141  *
142  * @param video The video object to proceed the request on.
143  *
144  * Pause the video and start a timer to trigger suspend mode.
145  *
146  * @ingroup Video
147  */
148 EAPI void                 elm_video_pause(Evas_Object *video);
149
150 /**
151  * @brief Stop the video
152  *
153  * @param video The video object to proceed the request on.
154  *
155  * Stop the video and put the emotion in deep sleep mode.
156  *
157  * @ingroup Video
158  */
159 EAPI void                 elm_video_stop(Evas_Object *video);
160
161 /**
162  * @brief Is the video actually playing.
163  *
164  * @param video The video object to proceed the request on.
165  * @return EINA_TRUE if the video is actually playing.
166  *
167  * You should consider watching event on the object instead of polling
168  * the object state.
169  *
170  * @ingroup Video
171  */
172 EAPI Eina_Bool            elm_video_is_playing(const Evas_Object *video);
173
174 /**
175  * @brief Is it possible to seek inside the video.
176  *
177  * @param video The video object to proceed the request on.
178  * @return EINA_TRUE if is possible to seek inside the video.
179  *
180  * @ingroup Video
181  */
182 EAPI Eina_Bool            elm_video_is_seekable(const Evas_Object *video);
183
184 /**
185  * @brief Is the audio muted.
186  *
187  * @param video The video object to proceed the request on.
188  * @return EINA_TRUE if the audio is muted.
189  *
190  * @ingroup Video
191  */
192 EAPI Eina_Bool            elm_video_audio_mute_get(const Evas_Object *video);
193
194 /**
195  * @brief Change the mute state of the Elm_Video object.
196  *
197  * @param video The video object to proceed the request on.
198  * @param mute The new mute state.
199  *
200  * @ingroup Video
201  */
202 EAPI void                 elm_video_audio_mute_set(Evas_Object *video, Eina_Bool mute);
203
204 /**
205  * @brief Get the audio level of the current video.
206  *
207  * @param video The video object to proceed the request on.
208  * @return the current audio level.
209  *
210  * @ingroup Video
211  */
212 EAPI double               elm_video_audio_level_get(const Evas_Object *video);
213
214 /**
215  * @brief Set the audio level of anElm_Video object.
216  *
217  * @param video The video object to proceed the request on.
218  * @param volume The new audio volume.
219  *
220  * @ingroup Video
221  */
222 EAPI void                 elm_video_audio_level_set(Evas_Object *video, double volume);
223
224 EAPI double               elm_video_play_position_get(const Evas_Object *video);
225 EAPI void                 elm_video_play_position_set(Evas_Object *video, double position);
226 EAPI double               elm_video_play_length_get(const Evas_Object *video);
227 EAPI void                 elm_video_remember_position_set(Evas_Object *video, Eina_Bool remember);
228 EAPI Eina_Bool            elm_video_remember_position_get(const Evas_Object *video);
229 EAPI const char          *elm_video_title_get(const Evas_Object *video);
230 /**
231  * @}
232  */