equal
deleted
inserted
replaced
20 #include "trace.h" |
20 #include "trace.h" |
21 |
21 |
22 /*! |
22 /*! |
23 /class ExampleAppEngine |
23 /class ExampleAppEngine |
24 /brief Implements the playback engine and DLNA interface for the UI. |
24 /brief Implements the playback engine and DLNA interface for the UI. |
|
25 In general this class calls the private implementation functions for |
|
26 a minimal implementation required to enable media rendering on a |
|
27 DLNA rendering device. |
|
28 |
|
29 For a real application implementing this functionality, more robust |
|
30 error handling should be applied, this version mostly relies on the |
|
31 function calls to return succesfully. |
25 */ |
32 */ |
26 |
33 |
27 /*! |
34 /*! |
28 C++ constructor. |
35 C++ constructor. |
29 */ |
36 */ |
46 |
53 |
47 delete d_ptr; |
54 delete d_ptr; |
48 } |
55 } |
49 |
56 |
50 /*! |
57 /*! |
51 description |
58 Checks for connected IAP. |
52 |
|
53 /a |
|
54 /return |
|
55 */ |
59 */ |
56 void ExampleAppEngine::construct() |
60 void ExampleAppEngine::construct() |
57 { |
61 { |
58 FUNC_LOG |
62 FUNC_LOG |
59 |
63 |
62 d_ptr->construct(); |
66 d_ptr->construct(); |
63 } |
67 } |
64 } |
68 } |
65 |
69 |
66 /*! |
70 /*! |
67 description |
71 Returns the id of the currently connected IAP. |
68 |
|
69 /a |
|
70 /return |
|
71 */ |
72 */ |
72 int ExampleAppEngine::getIap() const |
73 int ExampleAppEngine::getIap() const |
73 { |
74 { |
74 FUNC_LOG |
75 FUNC_LOG |
75 |
76 |
82 |
83 |
83 return iap; |
84 return iap; |
84 } |
85 } |
85 |
86 |
86 /*! |
87 /*! |
87 description |
88 Returns the name of the currently connected IAP |
88 |
|
89 /a |
|
90 /return |
|
91 */ |
89 */ |
92 QString ExampleAppEngine::getIapName() const |
90 QString ExampleAppEngine::getIapName() const |
93 { |
91 { |
94 FUNC_LOG |
92 FUNC_LOG |
95 |
93 |
102 |
100 |
103 return iapName; |
101 return iapName; |
104 } |
102 } |
105 |
103 |
106 /*! |
104 /*! |
107 description |
105 Returns a boolean describing whether the selected renderer |
108 |
106 supports seek functionality. |
109 /a |
|
110 /return |
|
111 */ |
107 */ |
112 bool ExampleAppEngine::isSeekSupported() const |
108 bool ExampleAppEngine::isSeekSupported() const |
113 { |
109 { |
114 FUNC_LOG |
110 FUNC_LOG |
115 |
111 |
122 |
118 |
123 return isSupported; |
119 return isSupported; |
124 } |
120 } |
125 |
121 |
126 /*! |
122 /*! |
127 description |
123 Returns the playback state of the selected renderer. |
128 |
|
129 /a |
|
130 /return |
|
131 */ |
124 */ |
132 int ExampleAppEngine::getPlaybackState() const |
125 int ExampleAppEngine::getPlaybackState() const |
133 { |
126 { |
134 FUNC_LOG |
127 FUNC_LOG |
135 |
128 |
142 |
135 |
143 return state; |
136 return state; |
144 } |
137 } |
145 |
138 |
146 /*! |
139 /*! |
147 description |
140 Returns a boolean describing whether the selected renderer |
148 |
141 supports pause functionality. |
149 /a |
|
150 /return |
|
151 */ |
142 */ |
152 bool ExampleAppEngine::isPauseSupported() const |
143 bool ExampleAppEngine::isPauseSupported() const |
153 { |
144 { |
154 FUNC_LOG |
145 FUNC_LOG |
155 |
146 |
162 |
153 |
163 return isSupported; |
154 return isSupported; |
164 } |
155 } |
165 |
156 |
166 /*! |
157 /*! |
167 description |
158 Initiate renderer search. Each renderer found from the current |
168 |
159 IAP will cause a renderingDeviceFound() signal to be emitted |
169 /a |
|
170 /return |
|
171 */ |
160 */ |
172 void ExampleAppEngine::searchRenderingDevices() |
161 void ExampleAppEngine::searchRenderingDevices() |
173 { |
162 { |
174 FUNC_LOG |
163 FUNC_LOG |
175 |
164 |
178 d_ptr->searchRenderingDevices(); |
167 d_ptr->searchRenderingDevices(); |
179 } |
168 } |
180 } |
169 } |
181 |
170 |
182 /*! |
171 /*! |
183 description |
172 Prepares the renderer for accepting further commands. When this function |
184 |
173 returns, there should be a rendering session opened to the renderer whose |
185 /a |
174 uuid was passed in /a uuid. |
186 /return |
175 |
187 */ |
176 */ |
188 void ExampleAppEngine::prepareRenderingDevice(const QString &uuid) |
177 void ExampleAppEngine::prepareRenderingDevice(const QString &uuid) |
189 { |
178 { |
190 FUNC_LOG |
179 FUNC_LOG |
191 |
180 |
194 d_ptr->prepareRenderingDevice(uuid); |
183 d_ptr->prepareRenderingDevice(uuid); |
195 } |
184 } |
196 } |
185 } |
197 |
186 |
198 /*! |
187 /*! |
199 description |
188 Calls the private implementation of the engine, which will cause |
200 |
189 the /a file to be shared as a DLNA item on the local push server. |
201 /a |
190 When the file is ready to be shared, an initComplete() signal is |
202 /return |
191 emitted. |
203 */ |
192 */ |
204 int ExampleAppEngine::initFile(const QString& file) |
193 int ExampleAppEngine::initFile(const QString& file) |
205 { |
194 { |
206 FUNC_LOG |
195 FUNC_LOG |
207 |
196 |
214 |
203 |
215 return err; |
204 return err; |
216 } |
205 } |
217 |
206 |
218 /*! |
207 /*! |
219 description |
208 Issues the play() command to the renderer. |
220 |
|
221 /a |
|
222 /return |
|
223 */ |
209 */ |
224 void ExampleAppEngine::play() |
210 void ExampleAppEngine::play() |
225 { |
211 { |
226 FUNC_LOG |
212 FUNC_LOG |
227 |
213 |
230 d_ptr->play(); |
216 d_ptr->play(); |
231 } |
217 } |
232 } |
218 } |
233 |
219 |
234 /*! |
220 /*! |
235 description |
221 Issues the pause() command to the renderer. |
236 |
|
237 /a |
|
238 /return |
|
239 */ |
222 */ |
240 void ExampleAppEngine::pause() |
223 void ExampleAppEngine::pause() |
241 { |
224 { |
242 FUNC_LOG |
225 FUNC_LOG |
243 |
226 |
246 d_ptr->pause(); |
229 d_ptr->pause(); |
247 } |
230 } |
248 } |
231 } |
249 |
232 |
250 /*! |
233 /*! |
251 description |
234 Issues the stop() command to the renderer. |
252 |
|
253 /a |
|
254 /return |
|
255 */ |
235 */ |
256 void ExampleAppEngine::stop() |
236 void ExampleAppEngine::stop() |
257 { |
237 { |
258 FUNC_LOG |
238 FUNC_LOG |
259 |
239 |
262 d_ptr->stop(); |
242 d_ptr->stop(); |
263 } |
243 } |
264 } |
244 } |
265 |
245 |
266 /*! |
246 /*! |
267 description |
247 Issues the volumeUp() command to the renderer. |
268 |
|
269 /a |
|
270 /return |
|
271 */ |
248 */ |
272 void ExampleAppEngine::volumeUp() |
249 void ExampleAppEngine::volumeUp() |
273 { |
250 { |
274 FUNC_LOG |
251 FUNC_LOG |
275 |
252 |
278 d_ptr->volumeUp(); |
255 d_ptr->volumeUp(); |
279 } |
256 } |
280 } |
257 } |
281 |
258 |
282 /*! |
259 /*! |
283 description |
260 Issues the volumeDown() command to the renderer. |
284 |
|
285 /a |
|
286 /return |
|
287 */ |
261 */ |
288 void ExampleAppEngine::volumeDown() |
262 void ExampleAppEngine::volumeDown() |
289 { |
263 { |
290 FUNC_LOG |
264 FUNC_LOG |
291 |
265 |
294 d_ptr->volumeDown(); |
268 d_ptr->volumeDown(); |
295 } |
269 } |
296 } |
270 } |
297 |
271 |
298 /*! |
272 /*! |
299 description |
273 Issues the rew() command to the renderer. |
300 |
|
301 /a |
|
302 /return |
|
303 */ |
274 */ |
304 void ExampleAppEngine::rew() |
275 void ExampleAppEngine::rew() |
305 { |
276 { |
306 FUNC_LOG |
277 FUNC_LOG |
307 |
278 |
310 d_ptr->rew(); |
281 d_ptr->rew(); |
311 } |
282 } |
312 } |
283 } |
313 |
284 |
314 /*! |
285 /*! |
315 description |
286 Issues the ff() command to the renderer. |
316 |
|
317 /a |
|
318 /return |
|
319 */ |
287 */ |
320 void ExampleAppEngine::ff() |
288 void ExampleAppEngine::ff() |
321 { |
289 { |
322 FUNC_LOG |
290 FUNC_LOG |
323 |
291 |