|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: dispatches control point events to AVController clients |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 // INCLUDE FILES |
|
24 |
|
25 #include "upnpavdispatcher.h" |
|
26 |
|
27 #include "upnpavactioninfo.h" |
|
28 #include "upnpavcontrolpointobserver.h" |
|
29 //#include "upnpavcontrollerimpl.h" |
|
30 #include "upnpavcontrollerserver.h" |
|
31 |
|
32 _LIT( KComponentLogfile, "CUPnPAVDispatcher.txt"); |
|
33 #include "upnplog.h" |
|
34 |
|
35 // ============================ MEMBER FUNCTIONS ============================ |
|
36 |
|
37 // -------------------------------------------------------------------------- |
|
38 // CUPnPAVDispatcher::CUPnPAVDispatcher |
|
39 // C++ default constructor can NOT contain any code, that |
|
40 // might leave. |
|
41 // -------------------------------------------------------------------------- |
|
42 // |
|
43 CUPnPAVDispatcher::CUPnPAVDispatcher( CUpnpAVControllerServer& aServer ) : |
|
44 iServer( aServer ) |
|
45 { |
|
46 } |
|
47 |
|
48 // -------------------------------------------------------------------------- |
|
49 // CUPnPAVDispatcher::ConstructL |
|
50 // Symbian 2nd phase constructor can leave. |
|
51 // -------------------------------------------------------------------------- |
|
52 // |
|
53 void CUPnPAVDispatcher::ConstructL() |
|
54 { |
|
55 } |
|
56 |
|
57 // -------------------------------------------------------------------------- |
|
58 // CUPnPAVDispatcher::NewL |
|
59 // Two-phased constructor. |
|
60 // -------------------------------------------------------------------------- |
|
61 // |
|
62 CUPnPAVDispatcher* CUPnPAVDispatcher::NewL( CUpnpAVControllerServer& aServer ) |
|
63 { |
|
64 CUPnPAVDispatcher* self = NewLC( aServer); |
|
65 CleanupStack::Pop( self ); |
|
66 return self; |
|
67 } |
|
68 |
|
69 // -------------------------------------------------------------------------- |
|
70 // CUPnPAVDispatcher::NewLC |
|
71 // Two-phased constructor. |
|
72 // -------------------------------------------------------------------------- |
|
73 // |
|
74 CUPnPAVDispatcher* CUPnPAVDispatcher::NewLC( |
|
75 CUpnpAVControllerServer& aServer ) |
|
76 { |
|
77 CUPnPAVDispatcher* self = new( ELeave ) |
|
78 CUPnPAVDispatcher( aServer ); |
|
79 CleanupStack::PushL( self ); |
|
80 self->ConstructL(); |
|
81 return self; |
|
82 } |
|
83 |
|
84 |
|
85 // Destructor |
|
86 CUPnPAVDispatcher::~CUPnPAVDispatcher() |
|
87 { |
|
88 iActionInfos.ResetAndDestroy(); |
|
89 // iActionInfosDevice.ResetAndDestroy(); |
|
90 iActionInfosEvent.ResetAndDestroy(); |
|
91 } |
|
92 |
|
93 // -------------------------------------------------------------------------- |
|
94 // CUPnPAVDispatcher::NewLC |
|
95 // Two-phased constructor. |
|
96 // -------------------------------------------------------------------------- |
|
97 // |
|
98 void CUPnPAVDispatcher::RcSetVolumeResponse( |
|
99 const TDesC8& aUuid, |
|
100 TInt aSessionId, |
|
101 TInt aErr, |
|
102 const TDesC8& aInstance, |
|
103 const TDesC8& aChannel, |
|
104 const TDesC8& aDesiredVolume) |
|
105 { |
|
106 MUpnpAVControlPointObserver& obs = FindObserver( aSessionId ); |
|
107 if( &obs ) |
|
108 { |
|
109 obs.RcSetVolumeResponse( aUuid, aSessionId, aErr, aInstance, aChannel, |
|
110 aDesiredVolume ); |
|
111 } |
|
112 } |
|
113 |
|
114 // -------------------------------------------------------------------------- |
|
115 // CUPnPAVDispatcher::NewLC |
|
116 // Two-phased constructor. |
|
117 // -------------------------------------------------------------------------- |
|
118 // |
|
119 void CUPnPAVDispatcher::RcVolumeResponse( |
|
120 const TDesC8& aUuid, |
|
121 TInt aSessionId, |
|
122 TInt aErr, |
|
123 const TDesC8& aInstance, |
|
124 const TDesC8& aChannel, |
|
125 const TDesC8& aCurrentVolume) |
|
126 { |
|
127 MUpnpAVControlPointObserver& obs = FindObserver( aSessionId ); |
|
128 if( &obs ) |
|
129 { |
|
130 obs.RcVolumeResponse( aUuid, aSessionId, aErr, aInstance, aChannel, |
|
131 aCurrentVolume ); |
|
132 } |
|
133 } |
|
134 |
|
135 // -------------------------------------------------------------------------- |
|
136 // CUPnPAVDispatcher::NewLC |
|
137 // Two-phased constructor. |
|
138 // -------------------------------------------------------------------------- |
|
139 // |
|
140 void CUPnPAVDispatcher::RcSetMuteResponse( |
|
141 const TDesC8& aUuid, |
|
142 TInt aSessionId, |
|
143 TInt aErr, |
|
144 const TDesC8& aInstance, |
|
145 const TDesC8& aChannel, |
|
146 const TDesC8& aDesiredMute) |
|
147 { |
|
148 MUpnpAVControlPointObserver& obs = FindObserver( aSessionId ); |
|
149 if( &obs ) |
|
150 { |
|
151 |
|
152 obs.RcSetMuteResponse( aUuid, aSessionId, aErr, aInstance, aChannel, |
|
153 aDesiredMute ); |
|
154 } |
|
155 } |
|
156 |
|
157 // -------------------------------------------------------------------------- |
|
158 // CUPnPAVDispatcher::NewLC |
|
159 // Two-phased constructor. |
|
160 // -------------------------------------------------------------------------- |
|
161 // |
|
162 void CUPnPAVDispatcher::RcMuteResponse( |
|
163 const TDesC8& aUuid, |
|
164 TInt aSessionId, |
|
165 TInt aErr, |
|
166 const TDesC8& aInstance, |
|
167 const TDesC8& aChannel, |
|
168 const TDesC8& aCurrentMute) |
|
169 { |
|
170 MUpnpAVControlPointObserver& obs = FindObserver( aSessionId ); |
|
171 if( &obs ) |
|
172 { |
|
173 |
|
174 obs.RcMuteResponse( aUuid, aSessionId, aErr, aInstance, aChannel, |
|
175 aCurrentMute ); |
|
176 } |
|
177 } |
|
178 |
|
179 |
|
180 // -------------------------------------------------------------------------- |
|
181 // CUPnPAVDispatcher::NewLC |
|
182 // Two-phased constructor. |
|
183 // -------------------------------------------------------------------------- |
|
184 // |
|
185 void CUPnPAVDispatcher::AvtSetTransportUriResponse( |
|
186 const TDesC8& aUuid, |
|
187 TInt aSessionId, |
|
188 TInt aErr, |
|
189 const TDesC8& aInstanceId, |
|
190 const TDesC8& aCurrentUri, |
|
191 const TDesC8& aCurrentUriMetaData) |
|
192 { |
|
193 MUpnpAVControlPointObserver& obs = FindObserver( aSessionId ); |
|
194 if( &obs ) |
|
195 { |
|
196 obs.AvtSetTransportUriResponse( aUuid, aSessionId, aErr, aInstanceId, |
|
197 aCurrentUri, aCurrentUriMetaData ); |
|
198 } |
|
199 } |
|
200 |
|
201 // -------------------------------------------------------------------------- |
|
202 // CUPnPAVDispatcher::NewLC |
|
203 // Two-phased constructor. |
|
204 // -------------------------------------------------------------------------- |
|
205 // |
|
206 void CUPnPAVDispatcher::AvtSetNextTransportUriResponse( |
|
207 const TDesC8& aUuid, |
|
208 TInt aSessionId, |
|
209 TInt aErr, |
|
210 const TDesC8& aInstanceId, |
|
211 const TDesC8& aNextUri, |
|
212 const TDesC8& aNextUriMetaData ) |
|
213 { |
|
214 MUpnpAVControlPointObserver& obs = FindObserver( aSessionId ); |
|
215 if( &obs ) |
|
216 { |
|
217 obs.AvtSetNextTransportUriResponse( aUuid, aSessionId, aErr, |
|
218 aInstanceId, aNextUri, aNextUriMetaData ); |
|
219 } |
|
220 } |
|
221 |
|
222 // -------------------------------------------------------------------------- |
|
223 // CUPnPAVDispatcher::NewLC |
|
224 // Two-phased constructor. |
|
225 // -------------------------------------------------------------------------- |
|
226 // |
|
227 void CUPnPAVDispatcher::AvtMediaInfoResponse( |
|
228 const TDesC8& /*aUuid*/, |
|
229 TInt /*aSessionId*/, |
|
230 TInt /*aErr*/, |
|
231 const TDesC8& /*aInstanceId*/, |
|
232 const TDesC8& /*aNrTracks*/, |
|
233 const TDesC8& /*aMediaDuration*/, |
|
234 const TDesC8& /*aCurrentUri*/, |
|
235 const TDesC8& /*aCurrentUriMetaData*/, |
|
236 const TDesC8& /*aNextUri*/, |
|
237 const TDesC8& /*aNextUriMetaData*/, |
|
238 const TDesC8& /*aPlayMedium*/, |
|
239 const TDesC8& /*aRecordMedium*/, |
|
240 const TDesC8& /*aWriteStatus*/) |
|
241 { |
|
242 |
|
243 } |
|
244 |
|
245 // -------------------------------------------------------------------------- |
|
246 // CUPnPAVDispatcher::NewLC |
|
247 // Two-phased constructor. |
|
248 // -------------------------------------------------------------------------- |
|
249 // |
|
250 void CUPnPAVDispatcher::AvtGetTransportInfoResponse( |
|
251 const TDesC8& /*aUuid*/, |
|
252 TInt /*aSessionId*/, |
|
253 TInt /*aErr*/, |
|
254 const TDesC8& /*aInstanceId*/, |
|
255 const TDesC8& /*aCurrenTransportState*/, |
|
256 const TDesC8& /*aCurrentTransportStatus*/, |
|
257 const TDesC8& /*aCurrentSpeed*/) |
|
258 { |
|
259 |
|
260 } |
|
261 |
|
262 // -------------------------------------------------------------------------- |
|
263 // CUPnPAVDispatcher::NewLC |
|
264 // Two-phased constructor. |
|
265 // -------------------------------------------------------------------------- |
|
266 // |
|
267 void CUPnPAVDispatcher::AvtPositionInfoResponse( |
|
268 const TDesC8& aUuid, |
|
269 TInt aSessionId, |
|
270 TInt aErr, |
|
271 const TDesC8& aInstanceId, |
|
272 const TDesC8& aTrack, |
|
273 const TDesC8& aTrackDuration, |
|
274 const TDesC8& aTrackMetaData, |
|
275 const TDesC8& aTrackURI, |
|
276 const TDesC8& aRelTime, |
|
277 const TDesC8& aAbsTime, |
|
278 const TDesC8& aRelCount, |
|
279 const TDesC8& aAbsCount) |
|
280 { |
|
281 MUpnpAVControlPointObserver& obs = FindObserver( aSessionId ); |
|
282 if( &obs ) |
|
283 { |
|
284 obs.AvtPositionInfoResponse( aUuid, aSessionId, aErr, |
|
285 aInstanceId, aTrack, aTrackDuration, aTrackMetaData, |
|
286 aTrackURI, aRelTime, aAbsTime, aRelCount, aAbsCount ); |
|
287 } |
|
288 } |
|
289 |
|
290 // -------------------------------------------------------------------------- |
|
291 // CUPnPAVDispatcher::NewLC |
|
292 // Two-phased constructor. |
|
293 // -------------------------------------------------------------------------- |
|
294 // |
|
295 void CUPnPAVDispatcher::AvtDeviceCapabilitiesResponse( |
|
296 const TDesC8& /*aUuid*/, |
|
297 TInt /*aSessionId*/, |
|
298 TInt /*aErr*/, |
|
299 const TDesC8& /*aInstanceId*/, |
|
300 const TDesC8& /*aPlayMedia*/, |
|
301 const TDesC8& /*aRecMedia*/, |
|
302 const TDesC8& /*aRecQualityMode*/) |
|
303 { |
|
304 |
|
305 } |
|
306 |
|
307 // -------------------------------------------------------------------------- |
|
308 // CUPnPAVDispatcher::NewLC |
|
309 // Two-phased constructor. |
|
310 // -------------------------------------------------------------------------- |
|
311 // |
|
312 void CUPnPAVDispatcher::AvtTransportSettingsResponse( |
|
313 const TDesC8& /*aUuid*/, |
|
314 TInt /*aSessionId*/, |
|
315 TInt /*aErr*/, |
|
316 const TDesC8& /*aInstanceId*/, |
|
317 const TDesC8& /*aPlayMode*/, |
|
318 const TDesC8& /*aRecQualityMode*/) |
|
319 { |
|
320 |
|
321 } |
|
322 |
|
323 // -------------------------------------------------------------------------- |
|
324 // CUPnPAVDispatcher::NewLC |
|
325 // Two-phased constructor. |
|
326 // -------------------------------------------------------------------------- |
|
327 // |
|
328 void CUPnPAVDispatcher::AvtStopResponse( |
|
329 const TDesC8& aUuid, |
|
330 TInt aSessionId, |
|
331 TInt aErr, |
|
332 const TDesC8& aInstanceId) |
|
333 { |
|
334 MUpnpAVControlPointObserver& obs = FindObserver( aSessionId ); |
|
335 if( &obs ) |
|
336 { |
|
337 obs.AvtStopResponse( aUuid, aSessionId, aErr, aInstanceId ); |
|
338 } |
|
339 } |
|
340 |
|
341 // -------------------------------------------------------------------------- |
|
342 // CUPnPAVDispatcher::NewLC |
|
343 // Two-phased constructor. |
|
344 // -------------------------------------------------------------------------- |
|
345 // |
|
346 void CUPnPAVDispatcher::AvtPlayResponse( |
|
347 const TDesC8& aUuid, |
|
348 TInt aSessionId, |
|
349 TInt aErr, |
|
350 const TDesC8& aInstanceId, |
|
351 const TDesC8& aSpeed) |
|
352 { |
|
353 MUpnpAVControlPointObserver& obs = FindObserver( aSessionId ); |
|
354 if( &obs ) |
|
355 { |
|
356 obs.AvtPlayResponse( aUuid, aSessionId, aErr, aInstanceId, |
|
357 aSpeed ); |
|
358 } |
|
359 } |
|
360 |
|
361 // -------------------------------------------------------------------------- |
|
362 // CUPnPAVDispatcher::NewLC |
|
363 // Two-phased constructor. |
|
364 // -------------------------------------------------------------------------- |
|
365 // |
|
366 void CUPnPAVDispatcher::AvtPauseResponse( |
|
367 const TDesC8& aUuid, |
|
368 TInt aSessionId, |
|
369 TInt aErr, |
|
370 const TDesC8& aInstanceId) |
|
371 { |
|
372 MUpnpAVControlPointObserver& obs = FindObserver( aSessionId ); |
|
373 if( &obs ) |
|
374 { |
|
375 obs.AvtPauseResponse( aUuid, aSessionId, aErr, aInstanceId ); |
|
376 } |
|
377 } |
|
378 |
|
379 // -------------------------------------------------------------------------- |
|
380 // CUPnPAVDispatcher::NewLC |
|
381 // Two-phased constructor. |
|
382 // -------------------------------------------------------------------------- |
|
383 // |
|
384 void CUPnPAVDispatcher::AvtRecordResponse( |
|
385 const TDesC8& /*aUuid*/, |
|
386 TInt /*aSessionId*/, |
|
387 TInt /*aErr*/, |
|
388 const TDesC8& /*aInstanceId*/) |
|
389 { |
|
390 |
|
391 } |
|
392 |
|
393 // -------------------------------------------------------------------------- |
|
394 // CUPnPAVDispatcher::NewLC |
|
395 // Two-phased constructor. |
|
396 // -------------------------------------------------------------------------- |
|
397 // |
|
398 void CUPnPAVDispatcher::AvtSeekResponse( |
|
399 const TDesC8& /*aUuid*/, |
|
400 TInt /*aSessionId*/, |
|
401 TInt /*aErr*/, |
|
402 const TDesC8& /*aInstanceId*/, |
|
403 const TDesC8& /*aUnit*/, |
|
404 const TDesC8& /*aTarget*/) |
|
405 { |
|
406 |
|
407 } |
|
408 |
|
409 // -------------------------------------------------------------------------- |
|
410 // CUPnPAVDispatcher::NewLC |
|
411 // Two-phased constructor. |
|
412 // -------------------------------------------------------------------------- |
|
413 // |
|
414 void CUPnPAVDispatcher::AvtNextResponse( |
|
415 const TDesC8& /*aUuid*/, |
|
416 TInt /*aSessionId*/, |
|
417 TInt /*aErr*/, |
|
418 const TDesC8& /*aInstanceId*/) |
|
419 { |
|
420 |
|
421 } |
|
422 |
|
423 // -------------------------------------------------------------------------- |
|
424 // CUPnPAVDispatcher::NewLC |
|
425 // Two-phased constructor. |
|
426 // -------------------------------------------------------------------------- |
|
427 // |
|
428 void CUPnPAVDispatcher::AvtPreviousResponse( |
|
429 const TDesC8& /*aUuid*/, |
|
430 TInt /*aSessionId*/, |
|
431 TInt /*aErr*/, |
|
432 const TDesC8& /*aInstanceId*/) |
|
433 { |
|
434 |
|
435 } |
|
436 |
|
437 // -------------------------------------------------------------------------- |
|
438 // CUPnPAVDispatcher::NewLC |
|
439 // Two-phased constructor. |
|
440 // -------------------------------------------------------------------------- |
|
441 // |
|
442 void CUPnPAVDispatcher::AvtSetPlayModeResponse( |
|
443 const TDesC8& /*aUuid*/, |
|
444 TInt /*aSessionId*/, |
|
445 TInt /*aErr*/, |
|
446 const TDesC8& /*aInstanceId*/, |
|
447 const TDesC8& /*aNewPlayMode*/) |
|
448 { |
|
449 |
|
450 } |
|
451 |
|
452 // -------------------------------------------------------------------------- |
|
453 // CUPnPAVDispatcher::NewLC |
|
454 // Two-phased constructor. |
|
455 // -------------------------------------------------------------------------- |
|
456 // |
|
457 void CUPnPAVDispatcher::AvtSetRecordModeResponse( |
|
458 const TDesC8& /*aUuid*/, |
|
459 TInt /*aSessionId*/, |
|
460 TInt /*aErr*/, |
|
461 const TDesC8& /*aInstanceId*/, |
|
462 const TDesC8& /*aNewRecordQuality*/) |
|
463 { |
|
464 |
|
465 } |
|
466 |
|
467 // -------------------------------------------------------------------------- |
|
468 // CUPnPAVDispatcher::NewLC |
|
469 // Two-phased constructor. |
|
470 // -------------------------------------------------------------------------- |
|
471 // |
|
472 void CUPnPAVDispatcher::CdsSearchCapabilitiesResponse( |
|
473 const TDesC8& aUuid, |
|
474 TInt aSessionId, |
|
475 TInt aErr, |
|
476 const TDesC8& aSearchCaps) |
|
477 { |
|
478 MUpnpAVControlPointObserver& obs = FindObserver( aSessionId ); |
|
479 if( &obs ) |
|
480 { |
|
481 obs.CdsSearchCapabilitiesResponse( aUuid, aSessionId, aErr, |
|
482 aSearchCaps ); |
|
483 } |
|
484 } |
|
485 |
|
486 // -------------------------------------------------------------------------- |
|
487 // CUPnPAVDispatcher::NewLC |
|
488 // Two-phased constructor. |
|
489 // -------------------------------------------------------------------------- |
|
490 // |
|
491 void CUPnPAVDispatcher::CdsSortCapabilitiesResponse( |
|
492 const TDesC8& /*aUuid*/, |
|
493 TInt /*aSessionId*/, |
|
494 TInt /*aErr*/, |
|
495 const TDesC8& /*aSortCaps*/) |
|
496 { |
|
497 |
|
498 } |
|
499 |
|
500 // -------------------------------------------------------------------------- |
|
501 // CUPnPAVDispatcher::NewLC |
|
502 // Two-phased constructor. |
|
503 // -------------------------------------------------------------------------- |
|
504 // |
|
505 void CUPnPAVDispatcher::CdsSystemUpdateIdResponse( |
|
506 const TDesC8& /*aUuid*/, |
|
507 TInt /*aSessionId*/, |
|
508 TInt /*aErr*/, |
|
509 TInt /*aSystemUpdateId*/) |
|
510 { |
|
511 |
|
512 } |
|
513 |
|
514 // -------------------------------------------------------------------------- |
|
515 // CUPnPAVDispatcher::NewLC |
|
516 // Two-phased constructor. |
|
517 // -------------------------------------------------------------------------- |
|
518 // |
|
519 void CUPnPAVDispatcher::CdsBrowseResponse( |
|
520 const TDesC8& aUuid, |
|
521 TInt aSessionId, |
|
522 TInt aErr, |
|
523 const TDesC8& aObjectID, |
|
524 const TDesC8& aBrowseFlag, |
|
525 const TDesC8& aFilter, |
|
526 TInt aIndex, |
|
527 TInt aRequest, |
|
528 const TDesC8& aSortCriteria, |
|
529 const TDesC8& aResult, |
|
530 TInt aReturned, |
|
531 TInt aMatches, |
|
532 const TDesC8& aUpdateID) |
|
533 { |
|
534 MUpnpAVControlPointObserver& obs = FindObserver( aSessionId ); |
|
535 if( &obs ) |
|
536 { |
|
537 obs.CdsBrowseResponse( aUuid, aSessionId, aErr, aObjectID, |
|
538 aBrowseFlag, aFilter, aIndex, aRequest, aSortCriteria, |
|
539 aResult, aReturned, aMatches, aUpdateID ); |
|
540 } |
|
541 } |
|
542 |
|
543 // -------------------------------------------------------------------------- |
|
544 // CUPnPAVDispatcher::NewLC |
|
545 // Two-phased constructor. |
|
546 // -------------------------------------------------------------------------- |
|
547 // |
|
548 void CUPnPAVDispatcher::CdsSearchResponse( |
|
549 const TDesC8& aUuid, |
|
550 TInt aSessionId, |
|
551 TInt aErr, |
|
552 const TDesC8& aContainerId, |
|
553 const TDesC8& aSearchCriteria, |
|
554 const TDesC8& aFilter, |
|
555 TInt aIndex, |
|
556 TInt aRequest, |
|
557 const TDesC8& aSortCriteria, |
|
558 const TDesC8& aResult, |
|
559 TInt aReturned, |
|
560 TInt aMatches, |
|
561 const TDesC8& aUpdateID) |
|
562 { |
|
563 MUpnpAVControlPointObserver& obs = FindObserver( aSessionId ); |
|
564 if( &obs ) |
|
565 { |
|
566 obs.CdsSearchResponse( aUuid, aSessionId, aErr, aContainerId, |
|
567 aSearchCriteria, aFilter, aIndex, aRequest, aSortCriteria, |
|
568 aResult, aReturned, aMatches, aUpdateID ); |
|
569 } |
|
570 } |
|
571 |
|
572 // -------------------------------------------------------------------------- |
|
573 // CUPnPAVDispatcher::NewLC |
|
574 // Two-phased constructor. |
|
575 // -------------------------------------------------------------------------- |
|
576 // |
|
577 void CUPnPAVDispatcher::CdsDestroyObjectResponse( |
|
578 const TDesC8& aUuid, |
|
579 TInt aSessionId, |
|
580 TInt aErr, |
|
581 const TDesC8& aObjectId ) |
|
582 { |
|
583 MUpnpAVControlPointObserver& obs = FindObserver( aSessionId ); |
|
584 if( &obs ) |
|
585 { |
|
586 obs.CdsDestroyObjectResponse( aUuid, aSessionId, aErr, aObjectId ); |
|
587 } |
|
588 } |
|
589 |
|
590 // -------------------------------------------------------------------------- |
|
591 // CUPnPAVDispatcher::NewLC |
|
592 // Two-phased constructor. |
|
593 // -------------------------------------------------------------------------- |
|
594 // |
|
595 void CUPnPAVDispatcher::CdsUpdateObjectResponse( |
|
596 const TDesC8& /*aUuid*/, |
|
597 TInt /*aSessionId*/, |
|
598 TInt /*aErr*/, |
|
599 const TDesC8& /*aObjectId*/, |
|
600 const TDesC8& /*aCurrentTagValue*/, |
|
601 const TDesC8& /*aNewTagValue*/ ) |
|
602 { |
|
603 |
|
604 } |
|
605 |
|
606 // -------------------------------------------------------------------------- |
|
607 // CUPnPAVDispatcher::NewLC |
|
608 // Two-phased constructor. |
|
609 // -------------------------------------------------------------------------- |
|
610 // |
|
611 void CUPnPAVDispatcher::CdsImportResponse( |
|
612 const TDesC8& aUuid, |
|
613 TInt aSessionId, |
|
614 TInt aErr, |
|
615 const TDesC8& aSourceURI, |
|
616 const TDesC8& aDestinationURI, |
|
617 const TDesC8& aTransferId ) |
|
618 { |
|
619 MUpnpAVControlPointObserver& obs = FindObserver( aSessionId ); |
|
620 if( &obs ) |
|
621 { |
|
622 obs.CdsImportResponse( aUuid, aSessionId, aErr, aSourceURI, |
|
623 aDestinationURI, aTransferId ); |
|
624 } |
|
625 |
|
626 } |
|
627 |
|
628 // -------------------------------------------------------------------------- |
|
629 // CUPnPAVDispatcher::NewLC |
|
630 // Two-phased constructor. |
|
631 // -------------------------------------------------------------------------- |
|
632 // |
|
633 void CUPnPAVDispatcher::CdsExportResponse( |
|
634 const TDesC8& aUuid, |
|
635 TInt aSessionId, |
|
636 TInt aErr, |
|
637 const TDesC8& aSourceURI, |
|
638 const TDesC8& aDestinationURI, |
|
639 const TDesC8& aTransferId ) |
|
640 { |
|
641 MUpnpAVControlPointObserver& obs = FindObserver( aSessionId ); |
|
642 if( &obs ) |
|
643 { |
|
644 obs.CdsExportResponse( aUuid, aSessionId, aErr, aSourceURI, |
|
645 aDestinationURI, aTransferId ); |
|
646 } |
|
647 |
|
648 |
|
649 } |
|
650 |
|
651 // -------------------------------------------------------------------------- |
|
652 // CUPnPAVDispatcher::NewLC |
|
653 // Two-phased constructor. |
|
654 // -------------------------------------------------------------------------- |
|
655 // |
|
656 void CUPnPAVDispatcher::CdsStopTransferResponse( |
|
657 const TDesC8& aUuid, |
|
658 TInt aSessionId, |
|
659 TInt aErr, |
|
660 const TDesC8& aTransferId ) |
|
661 { |
|
662 MUpnpAVControlPointObserver& obs = FindObserver( aSessionId ); |
|
663 if( &obs ) |
|
664 { |
|
665 obs.CdsStopTransferResponse( aUuid, aSessionId, aErr, aTransferId ); |
|
666 } |
|
667 } |
|
668 |
|
669 // -------------------------------------------------------------------------- |
|
670 // CUPnPAVDispatcher::NewLC |
|
671 // Two-phased constructor. |
|
672 // -------------------------------------------------------------------------- |
|
673 // |
|
674 void CUPnPAVDispatcher::CdsCTransferProgressResponse( |
|
675 const TDesC8& aUuid, |
|
676 TInt aSessionId, |
|
677 TInt aErr, |
|
678 const TDesC8& aTransferId, |
|
679 const TDesC8& aTransferStatus, |
|
680 const TDesC8& aTransferLength, |
|
681 const TDesC8& aTransferTotal ) |
|
682 { |
|
683 MUpnpAVControlPointObserver& obs = FindObserver( aSessionId ); |
|
684 if( &obs ) |
|
685 { |
|
686 obs.CdsCTransferProgressResponse( aUuid, aSessionId, |
|
687 aErr, aTransferId, aTransferStatus, aTransferLength, |
|
688 aTransferTotal ); |
|
689 } |
|
690 } |
|
691 |
|
692 // -------------------------------------------------------------------------- |
|
693 // CUPnPAVDispatcher::NewLC |
|
694 // Two-phased constructor. |
|
695 // -------------------------------------------------------------------------- |
|
696 // |
|
697 void CUPnPAVDispatcher::CdsDeleteResourceResponse( |
|
698 const TDesC8& /*aUuid*/, |
|
699 TInt /*aSessionId*/, |
|
700 TInt /*aErr*/, |
|
701 const TDesC8& /*aResourceUri*/ ) |
|
702 { |
|
703 |
|
704 } |
|
705 |
|
706 // -------------------------------------------------------------------------- |
|
707 // CUPnPAVDispatcher::NewLC |
|
708 // Two-phased constructor. |
|
709 // -------------------------------------------------------------------------- |
|
710 // |
|
711 void CUPnPAVDispatcher::CdsCreateReferenceResponse( |
|
712 const TDesC8& /*aUuid*/, |
|
713 TInt /*aSessionId*/, |
|
714 TInt /*aErr*/, |
|
715 const TDesC8& /*aContainerId*/, |
|
716 const TDesC8& /*aObjectId*/, |
|
717 const TDesC8& /*aNewId*/ ) |
|
718 { |
|
719 |
|
720 } |
|
721 |
|
722 // -------------------------------------------------------------------------- |
|
723 // CUPnPAVDispatcher::NewLC |
|
724 // Two-phased constructor. |
|
725 // -------------------------------------------------------------------------- |
|
726 // |
|
727 void CUPnPAVDispatcher::CdsCreateObjectResponse( |
|
728 const TDesC8& aUuid, |
|
729 TInt aSessionId, |
|
730 TInt aErr, |
|
731 const TDesC8& aContainerID, |
|
732 const TDesC8& aElements, |
|
733 const TDesC8& aObjectID, |
|
734 const TDesC8& aResult ) |
|
735 { |
|
736 MUpnpAVControlPointObserver& obs = FindObserver( aSessionId ); |
|
737 if( &obs ) |
|
738 { |
|
739 obs.CdsCreateObjectResponse( aUuid, aSessionId, aErr, aContainerID, |
|
740 aElements, aObjectID, aResult ); |
|
741 } |
|
742 } |
|
743 |
|
744 // -------------------------------------------------------------------------- |
|
745 // CUPnPAVDispatcher::NewLC |
|
746 // Two-phased constructor. |
|
747 // -------------------------------------------------------------------------- |
|
748 // |
|
749 void CUPnPAVDispatcher::CmProtocolInfoResponse( |
|
750 const TDesC8& aUuid, |
|
751 TInt aSessionId, |
|
752 TInt aErr, |
|
753 const TDesC8& aSource, |
|
754 const TDesC8& aSink ) |
|
755 { |
|
756 iServer.CmProtocolInfoResponse( aUuid, aSessionId, aErr, aSource, aSink ); |
|
757 } |
|
758 |
|
759 // -------------------------------------------------------------------------- |
|
760 // CUPnPAVDispatcher::NewLC |
|
761 // Two-phased constructor. |
|
762 // -------------------------------------------------------------------------- |
|
763 // |
|
764 void CUPnPAVDispatcher::CmPrepareResponse( |
|
765 const TDesC8& /*aUuid*/, |
|
766 TInt /*aSessionId*/, |
|
767 TInt /*aErr*/, |
|
768 const TDesC8& /*aRemoteProtocolInfo*/, |
|
769 const TDesC8& /*aPeerConnectionManager*/, |
|
770 const TDesC8& /*aPeerConnectionId*/, |
|
771 const TDesC8& /*aDirection*/, |
|
772 TInt /*aConnection*/, |
|
773 TInt /*aTransport*/, |
|
774 TInt /*aRsc*/ ) |
|
775 { |
|
776 |
|
777 } |
|
778 |
|
779 // -------------------------------------------------------------------------- |
|
780 // CUPnPAVDispatcher::NewLC |
|
781 // Two-phased constructor. |
|
782 // -------------------------------------------------------------------------- |
|
783 // |
|
784 void CUPnPAVDispatcher::CmComplete( |
|
785 const TDesC8& /*aUuid*/, |
|
786 TInt /*aSessionId*/, |
|
787 TInt /*aErr*/, |
|
788 TInt /*aConnection*/ ) |
|
789 { |
|
790 |
|
791 } |
|
792 |
|
793 // -------------------------------------------------------------------------- |
|
794 // CUPnPAVDispatcher::NewLC |
|
795 // Two-phased constructor. |
|
796 // -------------------------------------------------------------------------- |
|
797 // |
|
798 void CUPnPAVDispatcher::CmCurrentConnections( |
|
799 const TDesC8& /*aUuid*/, |
|
800 TInt /*aSessionId*/, |
|
801 TInt /*aErr*/, |
|
802 const TDesC8& /*aConnections*/) |
|
803 { |
|
804 |
|
805 } |
|
806 |
|
807 // -------------------------------------------------------------------------- |
|
808 // CUPnPAVDispatcher::NewLC |
|
809 // Two-phased constructor. |
|
810 // -------------------------------------------------------------------------- |
|
811 // |
|
812 void CUPnPAVDispatcher::CmCurrentInfo( |
|
813 const TDesC8& /*aUuid*/, |
|
814 TInt /*aSessionId*/, |
|
815 TInt /*aErr*/, |
|
816 TInt /*rscId*/, |
|
817 TInt /*transportId*/, |
|
818 const TDesC8& /*aProtocolInfo*/, |
|
819 const TDesC8& /*aPeerConnectionManager*/, |
|
820 TInt /*peerId*/, |
|
821 const TDesC8& /*aDirection*/, |
|
822 const TDesC8& /*aStatus*/ ) |
|
823 { |
|
824 |
|
825 } |
|
826 |
|
827 // -------------------------------------------------------------------------- |
|
828 // CUPnPAVDispatcher::NewLC |
|
829 // Two-phased constructor. |
|
830 // -------------------------------------------------------------------------- |
|
831 // |
|
832 void CUPnPAVDispatcher::CdsUpdateEvent( |
|
833 const TDesC8& /*aUuid*/, |
|
834 TInt /*aSystemUpdateId*/ |
|
835 ) |
|
836 { |
|
837 |
|
838 } |
|
839 |
|
840 // -------------------------------------------------------------------------- |
|
841 // CUPnPAVDispatcher::NewLC |
|
842 // Two-phased constructor. |
|
843 // -------------------------------------------------------------------------- |
|
844 // |
|
845 void CUPnPAVDispatcher::CdsContainerEvent( |
|
846 const TDesC8& /*aUuid*/, |
|
847 const TDesC8& /*aConteinerIds*/ |
|
848 ) |
|
849 { |
|
850 |
|
851 } |
|
852 |
|
853 // -------------------------------------------------------------------------- |
|
854 // CUPnPAVDispatcher::NewLC |
|
855 // Two-phased constructor. |
|
856 // -------------------------------------------------------------------------- |
|
857 // |
|
858 void CUPnPAVDispatcher::CdsTransferEvent( |
|
859 const TDesC8& /*aUuid*/, |
|
860 const TDesC8& /*aTransferIds*/ |
|
861 ) |
|
862 { |
|
863 |
|
864 } |
|
865 |
|
866 // -------------------------------------------------------------------------- |
|
867 // CUPnPAVDispatcher::NewLC |
|
868 // Two-phased constructor. |
|
869 // -------------------------------------------------------------------------- |
|
870 // |
|
871 void CUPnPAVDispatcher::RcLastChangeEvent( |
|
872 const TDesC8& aUuid, |
|
873 const TDesC8& aLastChange |
|
874 ) |
|
875 { |
|
876 // Forward to each observer |
|
877 TInt tempCount = iActionInfosEvent.Count(); |
|
878 |
|
879 for( TInt i = 0; i < tempCount; i++ ) |
|
880 { |
|
881 if( aUuid == iActionInfosEvent[ i ]->Uuid() ) |
|
882 { |
|
883 iActionInfosEvent[ i ]->Observer().RcLastChangeEvent( |
|
884 aUuid, aLastChange ); |
|
885 } |
|
886 } |
|
887 } |
|
888 |
|
889 // -------------------------------------------------------------------------- |
|
890 // CUPnPAVDispatcher::NewLC |
|
891 // Two-phased constructor. |
|
892 // -------------------------------------------------------------------------- |
|
893 // |
|
894 void CUPnPAVDispatcher::AvtLastChangeEvent( |
|
895 const TDesC8& aUuid, |
|
896 const TDesC8& aLastChange |
|
897 ) |
|
898 { |
|
899 // Forward to each observer |
|
900 TInt tempCount = iActionInfosEvent.Count(); |
|
901 |
|
902 for( TInt i = 0; i < tempCount; i++ ) |
|
903 { |
|
904 if( aUuid == iActionInfosEvent[ i ]->Uuid() ) |
|
905 { |
|
906 iActionInfosEvent[ i ]->Observer().AvtLastChangeEvent( |
|
907 aUuid, aLastChange ); |
|
908 } |
|
909 } |
|
910 |
|
911 } |
|
912 |
|
913 // -------------------------------------------------------------------------- |
|
914 // CUPnPAVDispatcher::NewLC |
|
915 // Two-phased constructor. |
|
916 // -------------------------------------------------------------------------- |
|
917 // |
|
918 void CUPnPAVDispatcher::CmSourceEvent( |
|
919 const TDesC8& /*aUuid*/, |
|
920 const TDesC8& /*aSource*/ |
|
921 ) |
|
922 { |
|
923 |
|
924 } |
|
925 |
|
926 // -------------------------------------------------------------------------- |
|
927 // CUPnPAVDispatcher::NewLC |
|
928 // Two-phased constructor. |
|
929 // -------------------------------------------------------------------------- |
|
930 // |
|
931 void CUPnPAVDispatcher::CmSinkEvent( |
|
932 const TDesC8& /*aUuid*/, |
|
933 const TDesC8& /*aSink*/ |
|
934 ) |
|
935 { |
|
936 |
|
937 } |
|
938 |
|
939 // -------------------------------------------------------------------------- |
|
940 // CUPnPAVDispatcher::NewLC |
|
941 // Two-phased constructor. |
|
942 // -------------------------------------------------------------------------- |
|
943 // |
|
944 void CUPnPAVDispatcher::CmConnectionsEvent( |
|
945 const TDesC8& /*aUuid*/, |
|
946 const TDesC8& /*aConnections*/ |
|
947 ) |
|
948 { |
|
949 |
|
950 } |
|
951 |
|
952 // -------------------------------------------------------------------------- |
|
953 // CUPnPAVDispatcher::NewLC |
|
954 // Two-phased constructor. |
|
955 // -------------------------------------------------------------------------- |
|
956 // |
|
957 void CUPnPAVDispatcher::HttpResponseL( CUpnpHttpMessage* /*aMessage*/ ) |
|
958 { |
|
959 |
|
960 } |
|
961 |
|
962 // -------------------------------------------------------------------------- |
|
963 // CUPnPAVDispatcher::NewLC |
|
964 // Two-phased constructor. |
|
965 // -------------------------------------------------------------------------- |
|
966 // |
|
967 void CUPnPAVDispatcher::DeviceDiscoveredL( CUpnpDevice* aDevice ) |
|
968 { |
|
969 __ASSERTD( aDevice, __FILE__, __LINE__ ) |
|
970 |
|
971 if( aDevice ) |
|
972 { |
|
973 iServer.DeviceDiscoveredL( *aDevice ); |
|
974 } |
|
975 else |
|
976 { |
|
977 // No can do? |
|
978 } |
|
979 } |
|
980 |
|
981 // -------------------------------------------------------------------------- |
|
982 // CUPnPAVDispatcher::NewLC |
|
983 // Two-phased constructor. |
|
984 // -------------------------------------------------------------------------- |
|
985 // |
|
986 void CUPnPAVDispatcher::DeviceDisappearedL( CUpnpDevice* aDevice ) |
|
987 { |
|
988 __ASSERTD( aDevice, __FILE__, __LINE__ ); |
|
989 |
|
990 if( aDevice ) |
|
991 { |
|
992 iServer.DeviceDisappearedL( *aDevice ); |
|
993 } |
|
994 else |
|
995 { |
|
996 // No can do? |
|
997 } |
|
998 } |
|
999 |
|
1000 void CUPnPAVDispatcher::RegisterL( TInt aSessionId, |
|
1001 MUpnpAVControlPointObserver& aObserver/*, const TDesC8& aUuid*/ ) |
|
1002 { |
|
1003 CUPnPAVActionInfo* tempInfo = CUPnPAVActionInfo::NewLC(); |
|
1004 tempInfo->SetSessionId( aSessionId ); |
|
1005 tempInfo->SetObserver( aObserver ); |
|
1006 //tempInfo->SetUuidL( aUuid ); |
|
1007 CleanupStack::Pop( tempInfo ); |
|
1008 iActionInfos.Append( tempInfo ); |
|
1009 } |
|
1010 |
|
1011 void CUPnPAVDispatcher::UnRegister( TInt aSessionId |
|
1012 /*, const TDesC8& aUuid*/ ) |
|
1013 { |
|
1014 TInt tempCount = iActionInfos.Count(); |
|
1015 |
|
1016 for( TInt i = 0; i < tempCount; i++ ) |
|
1017 { |
|
1018 if( iActionInfos[ i ]->SessionId() == aSessionId ) |
|
1019 { |
|
1020 delete iActionInfos[ i ]; |
|
1021 iActionInfos.Remove( i ); |
|
1022 i = tempCount; |
|
1023 } |
|
1024 } |
|
1025 } |
|
1026 |
|
1027 MUpnpAVControlPointObserver& CUPnPAVDispatcher::FindObserver( |
|
1028 TInt aSessionId ) |
|
1029 { |
|
1030 MUpnpAVControlPointObserver* tempObserver = NULL; |
|
1031 TInt tempCount = iActionInfos.Count(); |
|
1032 |
|
1033 for( TInt i = 0; i < tempCount; i++ ) |
|
1034 { |
|
1035 if( iActionInfos[ i ]->SessionId() == aSessionId ) |
|
1036 { |
|
1037 tempObserver = &( iActionInfos[ i ]->Observer() ); |
|
1038 i = tempCount; |
|
1039 } |
|
1040 } |
|
1041 return *tempObserver; |
|
1042 } |
|
1043 |
|
1044 void CUPnPAVDispatcher::RegisterForEventsL( |
|
1045 MUpnpAVControlPointObserver& aObserver, const TDesC8& aUuid ) |
|
1046 { |
|
1047 CUPnPAVActionInfo* tempInfo = CUPnPAVActionInfo::NewLC(); |
|
1048 tempInfo->SetObserver( aObserver ); |
|
1049 tempInfo->SetUuidL( aUuid ); |
|
1050 CleanupStack::Pop( tempInfo ); |
|
1051 iActionInfosEvent.Append( tempInfo ); |
|
1052 } |
|
1053 |
|
1054 void CUPnPAVDispatcher::UnRegisterEvents( |
|
1055 MUpnpAVControlPointObserver& aObserver ) |
|
1056 { |
|
1057 TInt tempCount = iActionInfosEvent.Count(); |
|
1058 |
|
1059 for( TInt i = 0; i < tempCount; i++ ) |
|
1060 { |
|
1061 if( &aObserver == &iActionInfosEvent[ i ]->Observer() ) |
|
1062 { |
|
1063 delete iActionInfosEvent[ i ]; |
|
1064 iActionInfosEvent.Remove( i ); |
|
1065 i = tempCount; |
|
1066 } |
|
1067 } |
|
1068 } |
|
1069 |
|
1070 |
|
1071 // End of File |
|
1072 |