|
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: AO for rendering commands |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 #include "upnpavrenderingactive.h" |
|
24 |
|
25 #include "upnpavcontrollerclient.h" |
|
26 #include "upnpavrenderingsessionimpl.h" |
|
27 #include "upnpavrequest.h" |
|
28 |
|
29 _LIT( KComponentLogfile, "upnpavcontrollerclient.txt"); |
|
30 #include "upnplog.h" |
|
31 |
|
32 const TInt KPositionInfoSize = 15; |
|
33 |
|
34 // ======== MEMBER FUNCTIONS ======== |
|
35 |
|
36 // -------------------------------------------------------------------------- |
|
37 // CUPnPAVRenderingActive::NewL |
|
38 // See upnpavrenderingactive.h |
|
39 // -------------------------------------------------------------------------- |
|
40 CUPnPAVRenderingActive* CUPnPAVRenderingActive::NewL( |
|
41 RUPnPAVControllerClient& aServer, TInt aId ) |
|
42 { |
|
43 CUPnPAVRenderingActive* self = new (ELeave) CUPnPAVRenderingActive( |
|
44 aServer, aId ); |
|
45 CleanupStack::PushL( self ); |
|
46 self->ConstructL(); |
|
47 CleanupStack::Pop( self ); |
|
48 return self; |
|
49 } |
|
50 |
|
51 // -------------------------------------------------------------------------- |
|
52 // CUPnPAVRenderingActive::CUPnPAVRenderingActive |
|
53 // See upnpavrenderingactive.h |
|
54 // -------------------------------------------------------------------------- |
|
55 CUPnPAVRenderingActive::CUPnPAVRenderingActive( |
|
56 RUPnPAVControllerClient& aServer, TInt aId ): |
|
57 CActive( EPriorityStandard ), |
|
58 iServer( aServer ), |
|
59 iId( aId ), |
|
60 iBufferPtr( 0, 0 ), |
|
61 iBufferPtr2( 0, 0 ), |
|
62 iRespBufSizePkg( iRespBufSize ) |
|
63 { |
|
64 CActiveScheduler::Add( this ); |
|
65 } |
|
66 |
|
67 // -------------------------------------------------------------------------- |
|
68 // CUPnPAVRenderingActive::~CUPnPAVRenderingActive |
|
69 // See upnpavrenderingactive.h |
|
70 // -------------------------------------------------------------------------- |
|
71 CUPnPAVRenderingActive::~CUPnPAVRenderingActive() |
|
72 { |
|
73 __LOG( "CUPnPAVRenderingActive::~CUPnPAVRenderingActive" ); |
|
74 |
|
75 Cancel(); |
|
76 |
|
77 delete iBuffer; |
|
78 delete iBuffer2; |
|
79 |
|
80 if( iMediaServerResourceReserved ) |
|
81 { |
|
82 iServer.ReleaseMediaServer( iId ); |
|
83 } |
|
84 } |
|
85 |
|
86 // -------------------------------------------------------------------------- |
|
87 // CUPnPAVRenderingActive::ConstructL |
|
88 // See upnpavrenderingactive.h |
|
89 // -------------------------------------------------------------------------- |
|
90 void CUPnPAVRenderingActive::ConstructL() |
|
91 { |
|
92 __LOG( "CUPnPAVRenderingActive::ConstructL" ); |
|
93 } |
|
94 |
|
95 // -------------------------------------------------------------------------- |
|
96 // CUPnPAVRenderingActive::RunL |
|
97 // See upnpavrenderingactive.h |
|
98 // -------------------------------------------------------------------------- |
|
99 void CUPnPAVRenderingActive::RunL() |
|
100 { |
|
101 __LOG( "CUPnPAVRenderingActive::RunL" ); |
|
102 |
|
103 switch( iPendingOperation ) |
|
104 { |
|
105 case ESetURI: |
|
106 { |
|
107 SetURICompleteL(); |
|
108 } |
|
109 break; |
|
110 |
|
111 case ESetNextURI: |
|
112 { |
|
113 SetNextURICompleteL(); |
|
114 } |
|
115 break; |
|
116 |
|
117 case EPlay: |
|
118 { |
|
119 PlayCompleteL(); |
|
120 } |
|
121 break; |
|
122 |
|
123 case EStop: |
|
124 { |
|
125 StopCompleteL(); |
|
126 } |
|
127 break; |
|
128 |
|
129 case EPause: |
|
130 { |
|
131 PauseCompleteL(); |
|
132 } |
|
133 break; |
|
134 |
|
135 case ESetVolume: |
|
136 { |
|
137 SetVolumeCompleteL(); |
|
138 } |
|
139 break; |
|
140 |
|
141 case EGetVolume: |
|
142 { |
|
143 GetVolumeCompleteL(); |
|
144 } |
|
145 break; |
|
146 |
|
147 case ESetMute: |
|
148 { |
|
149 SetMuteCompleteL(); |
|
150 } |
|
151 break; |
|
152 |
|
153 case EGetMute: |
|
154 { |
|
155 GetMuteCompleteL(); |
|
156 } |
|
157 break; |
|
158 |
|
159 case EPositionInfo: |
|
160 { |
|
161 PositionInfoCompleteL(); |
|
162 } |
|
163 break; |
|
164 |
|
165 case EStartMediaServer: |
|
166 { |
|
167 StartMediaServerCompleteL(); |
|
168 } |
|
169 break; |
|
170 |
|
171 default: |
|
172 __PANICD( __FILE__, __LINE__ ); |
|
173 break; |
|
174 } |
|
175 } |
|
176 |
|
177 // -------------------------------------------------------------------------- |
|
178 // CUPnPAVRenderingActive::DoCancel |
|
179 // See upnpavrenderingactive.h |
|
180 // -------------------------------------------------------------------------- |
|
181 void CUPnPAVRenderingActive::DoCancel() |
|
182 { |
|
183 __LOG( "CUPnPAVRenderingActive::DoCancel" ); |
|
184 |
|
185 switch( iPendingOperation ) |
|
186 { |
|
187 case ESetURI: |
|
188 { |
|
189 iServer.CancelSetURI( iId ); |
|
190 } |
|
191 break; |
|
192 |
|
193 case ESetNextURI: |
|
194 { |
|
195 iServer.CancelSetNextURI( iId ); |
|
196 } |
|
197 break; |
|
198 |
|
199 case EPlay: |
|
200 { |
|
201 iServer.CancelPlay( iId ); |
|
202 } |
|
203 break; |
|
204 |
|
205 case EStop: |
|
206 { |
|
207 iServer.CancelStop( iId ); |
|
208 } |
|
209 break; |
|
210 |
|
211 case EPause: |
|
212 { |
|
213 iServer.CancelPause( iId ); |
|
214 } |
|
215 break; |
|
216 |
|
217 case ESetVolume: |
|
218 { |
|
219 iServer.CancelSetVolume( iId ); |
|
220 } |
|
221 break; |
|
222 |
|
223 case EGetVolume: |
|
224 { |
|
225 iServer.CancelGetVolume( iId ); |
|
226 } |
|
227 break; |
|
228 |
|
229 case ESetMute: |
|
230 { |
|
231 iServer.CancelSetMute( iId ); |
|
232 } |
|
233 break; |
|
234 |
|
235 case EGetMute: |
|
236 { |
|
237 iServer.CancelGetMute( iId ); |
|
238 } |
|
239 break; |
|
240 |
|
241 case EPositionInfo: |
|
242 { |
|
243 iServer.CancelGetPositionInfo( iId ); |
|
244 } |
|
245 break; |
|
246 |
|
247 case EStartMediaServer: |
|
248 { |
|
249 iServer.CancelReserveMediaServer( iId ); |
|
250 } |
|
251 break; |
|
252 |
|
253 default: |
|
254 __PANICD( __FILE__, __LINE__ ); |
|
255 break; |
|
256 } |
|
257 } |
|
258 |
|
259 // -------------------------------------------------------------------------- |
|
260 // CUPnPAVRenderingActive::RunError |
|
261 // See upnpavrenderingactive.h |
|
262 // -------------------------------------------------------------------------- |
|
263 TInt CUPnPAVRenderingActive::RunError( TInt /*aError*/ ) |
|
264 { |
|
265 return KErrNone; |
|
266 } |
|
267 |
|
268 |
|
269 // -------------------------------------------------------------------------- |
|
270 // CUPnPAVRenderingActive::SetObserver |
|
271 // See upnpavrenderingactive.h |
|
272 // -------------------------------------------------------------------------- |
|
273 void CUPnPAVRenderingActive::SetObserver( |
|
274 MUPnPAVRenderingSessionObserver& aObserver ) |
|
275 { |
|
276 // Set the observer and make an async request to the server to receive |
|
277 // device callbacks |
|
278 __ASSERTD( !iObserver, __FILE__, __LINE__ ); |
|
279 |
|
280 |
|
281 iObserver = &aObserver; |
|
282 } |
|
283 |
|
284 // -------------------------------------------------------------------------- |
|
285 // CUPnPAVRenderingActive::Observer |
|
286 // See upnpavrenderingactive.h |
|
287 // -------------------------------------------------------------------------- |
|
288 MUPnPAVRenderingSessionObserver* CUPnPAVRenderingActive::Observer() const |
|
289 { |
|
290 return iObserver; |
|
291 } |
|
292 |
|
293 // -------------------------------------------------------------------------- |
|
294 // CUPnPAVRenderingActive::RemoveObserver |
|
295 // See upnpavrenderingactive.h |
|
296 // -------------------------------------------------------------------------- |
|
297 void CUPnPAVRenderingActive::RemoveObserver() |
|
298 { |
|
299 iObserver = NULL; |
|
300 } |
|
301 |
|
302 // -------------------------------------------------------------------------- |
|
303 // CUPnPAVRenderingActive::ReserveLocalMSServicesL |
|
304 // See upnpavrenderingactive.h |
|
305 // -------------------------------------------------------------------------- |
|
306 void CUPnPAVRenderingActive::ReserveLocalMSServicesL() |
|
307 { |
|
308 __LOG( "CUPnPAVRenderingActive::ReserveLocalMSServicesL" ); |
|
309 |
|
310 ResetL(); |
|
311 |
|
312 if( iMediaServerResourceReserved ) |
|
313 { |
|
314 if( iObserver ) |
|
315 { |
|
316 iObserver->ReserveLocalMSServicesCompleted( KErrNone ); |
|
317 } |
|
318 } |
|
319 else |
|
320 { |
|
321 iPendingOperation = EStartMediaServer; |
|
322 iServer.ReserveMediaServer( iId, iStatus ); |
|
323 SetActive(); |
|
324 |
|
325 } |
|
326 } |
|
327 |
|
328 // -------------------------------------------------------------------------- |
|
329 // CUPnPAVRenderingActive::CancelReserveLocalMSServicesL |
|
330 // See upnpavrenderingactive.h |
|
331 // -------------------------------------------------------------------------- |
|
332 void CUPnPAVRenderingActive::CancelReserveLocalMSServicesL() |
|
333 { |
|
334 __LOG( "CUPnPAVRenderingActive::CancelReserveLocalMSServicesL" ); |
|
335 |
|
336 if( iPendingOperation == EStartMediaServer ) |
|
337 { |
|
338 Cancel(); |
|
339 } |
|
340 } |
|
341 |
|
342 // -------------------------------------------------------------------------- |
|
343 // CUPnPAVRenderingActive::ReleaseLocalMSServicesL |
|
344 // See upnpavrenderingactive.h |
|
345 // -------------------------------------------------------------------------- |
|
346 void CUPnPAVRenderingActive::ReleaseLocalMSServicesL() |
|
347 { |
|
348 __LOG( "CUPnPAVRenderingActive::ReleaseLocalMSServicesL" ); |
|
349 |
|
350 ResetL(); |
|
351 |
|
352 if( iMediaServerResourceReserved ) |
|
353 { |
|
354 iMediaServerResourceReserved = EFalse; |
|
355 |
|
356 User::LeaveIfError( iServer.ReleaseMediaServer( iId ) ); |
|
357 } |
|
358 } |
|
359 |
|
360 // -------------------------------------------------------------------------- |
|
361 // CUPnPAVRenderingActive::SetURIL |
|
362 // See upnpavrenderingactive.h |
|
363 // -------------------------------------------------------------------------- |
|
364 void CUPnPAVRenderingActive::SetURIL( const TDesC8& aURI, |
|
365 const CUpnpItem& aItem ) |
|
366 { |
|
367 __LOG( "CUPnPAVRenderingActive::SetURIL" ); |
|
368 |
|
369 ResetL(); |
|
370 |
|
371 CUpnpAVRequest* tempRequest = CUpnpAVRequest::NewLC(); |
|
372 tempRequest->SetURIL( aURI ); |
|
373 |
|
374 iBuffer = tempRequest->ToDes8L(); |
|
375 iBufferPtr.Set( iBuffer->Des() ); |
|
376 |
|
377 iBuffer2 = aItem.ToDes8L(); |
|
378 iBufferPtr2.Set( iBuffer2->Des() ); |
|
379 |
|
380 CleanupStack::PopAndDestroy( tempRequest ); |
|
381 |
|
382 iPendingOperation = ESetURI; |
|
383 |
|
384 iServer.SetURI( iId, iBufferPtr, iBufferPtr2, iStatus ); |
|
385 SetActive(); |
|
386 } |
|
387 |
|
388 // -------------------------------------------------------------------------- |
|
389 // CUPnPAVRenderingActive::SetNextURIL |
|
390 // See upnpavrenderingactive.h |
|
391 // -------------------------------------------------------------------------- |
|
392 void CUPnPAVRenderingActive::SetNextURIL( const TDesC8& aURI, |
|
393 const CUpnpItem& aItem ) |
|
394 { |
|
395 __LOG( "CUPnPAVRenderingActive::SetNextURIL" ); |
|
396 |
|
397 ResetL(); |
|
398 |
|
399 CUpnpAVRequest* tempRequest = CUpnpAVRequest::NewLC(); |
|
400 tempRequest->SetURIL( aURI ); |
|
401 |
|
402 iBuffer = tempRequest->ToDes8L(); |
|
403 iBufferPtr.Set( iBuffer->Des() ); |
|
404 |
|
405 iBuffer2 = aItem.ToDes8L(); |
|
406 iBufferPtr2.Set( iBuffer2->Des() ); |
|
407 |
|
408 CleanupStack::PopAndDestroy( tempRequest ); |
|
409 |
|
410 iPendingOperation = ESetNextURI; |
|
411 |
|
412 iServer.SetNextURI( iId, iBufferPtr, iBufferPtr2, iStatus ); |
|
413 SetActive(); |
|
414 } |
|
415 |
|
416 |
|
417 // -------------------------------------------------------------------------- |
|
418 // CUPnPAVRenderingActive::PlayL |
|
419 // See upnpavrenderingactive.h |
|
420 // -------------------------------------------------------------------------- |
|
421 void CUPnPAVRenderingActive::PlayL() |
|
422 { |
|
423 __LOG( "CUPnPAVRenderingActive::PlayL" ); |
|
424 |
|
425 ResetL(); |
|
426 iPendingOperation = EPlay; |
|
427 iServer.Play( iId, iStatus ); |
|
428 SetActive(); |
|
429 } |
|
430 |
|
431 // -------------------------------------------------------------------------- |
|
432 // CUPnPAVRenderingActive::StopL |
|
433 // See upnpavrenderingactive.h |
|
434 // -------------------------------------------------------------------------- |
|
435 void CUPnPAVRenderingActive::StopL() |
|
436 { |
|
437 __LOG( "CUPnPAVRenderingActive::StopL" ); |
|
438 |
|
439 ResetL(); |
|
440 iPendingOperation = EStop; |
|
441 iServer.Stop( iId, iStatus ); |
|
442 SetActive(); |
|
443 } |
|
444 |
|
445 // -------------------------------------------------------------------------- |
|
446 // CUPnPAVRenderingActive::PauseL |
|
447 // See upnpavrenderingactive.h |
|
448 // -------------------------------------------------------------------------- |
|
449 void CUPnPAVRenderingActive::PauseL() |
|
450 { |
|
451 __LOG( "CUPnPAVRenderingActive::PauseL" ); |
|
452 |
|
453 ResetL(); |
|
454 iPendingOperation = EPause; |
|
455 iServer.Pause( iId, iStatus ); |
|
456 SetActive(); |
|
457 } |
|
458 |
|
459 // -------------------------------------------------------------------------- |
|
460 // CUPnPAVRenderingActive::SetVolumeL |
|
461 // See upnpavrenderingactive.h |
|
462 // -------------------------------------------------------------------------- |
|
463 void CUPnPAVRenderingActive::SetVolumeL( TInt aVolumeLevel ) |
|
464 { |
|
465 __LOG( "CUPnPAVRenderingActive::SetVolumeL" ); |
|
466 |
|
467 ResetL(); |
|
468 iPendingOperation = ESetVolume; |
|
469 iServer.SetVolume( iId, aVolumeLevel, iRespBufSizePkg, iStatus ); |
|
470 SetActive(); |
|
471 } |
|
472 |
|
473 // -------------------------------------------------------------------------- |
|
474 // CUPnPAVRenderingActive::GetVolumeL |
|
475 // See upnpavrenderingactive.h |
|
476 // -------------------------------------------------------------------------- |
|
477 void CUPnPAVRenderingActive::GetVolumeL() |
|
478 { |
|
479 __LOG( "CUPnPAVRenderingActive::GetVolumeL" ); |
|
480 |
|
481 ResetL(); |
|
482 iPendingOperation = EGetVolume; |
|
483 iServer.GetVolume( iId, iRespBufSizePkg, iStatus ); |
|
484 SetActive(); |
|
485 } |
|
486 |
|
487 // -------------------------------------------------------------------------- |
|
488 // CUPnPAVRenderingActive::SetMuteL |
|
489 // See upnpavrenderingactive.h |
|
490 // -------------------------------------------------------------------------- |
|
491 void CUPnPAVRenderingActive::SetMuteL( TBool aMute ) |
|
492 { |
|
493 __LOG( "CUPnPAVRenderingActive::SetMuteL" ); |
|
494 |
|
495 ResetL(); |
|
496 iPendingOperation = ESetMute; |
|
497 iServer.SetMute( iId, aMute, iRespBufSizePkg, iStatus ); |
|
498 SetActive(); |
|
499 } |
|
500 |
|
501 // -------------------------------------------------------------------------- |
|
502 // CUPnPAVRenderingActive::NewL |
|
503 // See upnpavrenderingactive.h |
|
504 // -------------------------------------------------------------------------- |
|
505 void CUPnPAVRenderingActive::GetMuteL() |
|
506 { |
|
507 __LOG( "CUPnPAVRenderingActive::GetMuteL" ); |
|
508 |
|
509 ResetL(); |
|
510 iPendingOperation = EGetMute; |
|
511 iServer.GetMute( iId, iRespBufSizePkg, iStatus ); |
|
512 SetActive(); |
|
513 } |
|
514 |
|
515 // -------------------------------------------------------------------------- |
|
516 // CUPnPAVRenderingActive::GetPositionInfoL |
|
517 // See upnpavrenderingactive.h |
|
518 // -------------------------------------------------------------------------- |
|
519 void CUPnPAVRenderingActive::GetPositionInfoL() |
|
520 { |
|
521 __LOG( "CUPnPAVRenderingActive::GetPositionInfoL" ); |
|
522 |
|
523 ResetL(); |
|
524 |
|
525 iBuffer = HBufC8::NewL( KPositionInfoSize ); |
|
526 iBufferPtr.Set( iBuffer->Des() ); |
|
527 iBuffer2 = HBufC8::NewL( KPositionInfoSize ); |
|
528 iBufferPtr2.Set( iBuffer2->Des() ); |
|
529 iPendingOperation = EPositionInfo; |
|
530 iServer.GetPositionInfo( iId, iBufferPtr, iBufferPtr2, iStatus ); |
|
531 SetActive(); |
|
532 } |
|
533 |
|
534 // -------------------------------------------------------------------------- |
|
535 // CUPnPAVRenderingActive::ResetL |
|
536 // See upnpavrenderingactive.h |
|
537 // -------------------------------------------------------------------------- |
|
538 void CUPnPAVRenderingActive::ResetL() |
|
539 { |
|
540 __LOG( "CUPnPAVRenderingActive::ResetL" ); |
|
541 |
|
542 if( IsActive() ) |
|
543 { |
|
544 User::Leave( KErrServerBusy ); |
|
545 } |
|
546 |
|
547 delete iBuffer; iBuffer = NULL; |
|
548 delete iBuffer2; iBuffer2 = NULL; |
|
549 iPendingOperation = ENone; |
|
550 } |
|
551 |
|
552 // -------------------------------------------------------------------------- |
|
553 // CUPnPAVRenderingActive::SetURICompleteL |
|
554 // See upnpavrenderingactive.h |
|
555 // -------------------------------------------------------------------------- |
|
556 void CUPnPAVRenderingActive::SetURICompleteL() |
|
557 { |
|
558 __LOG( "CUPnPAVRenderingActive::SetURICompleteL" ); |
|
559 |
|
560 if( iObserver ) |
|
561 { |
|
562 if( iStatus.Int() == EAVControllerSetURICompleted ) |
|
563 { |
|
564 iObserver->SetURIResult( KErrNone ); |
|
565 } |
|
566 else |
|
567 { |
|
568 iObserver->SetURIResult( iStatus.Int() ); |
|
569 } |
|
570 } |
|
571 } |
|
572 |
|
573 // -------------------------------------------------------------------------- |
|
574 // CUPnPAVRenderingActive::SetNextURICompleteL |
|
575 // See upnpavrenderingactive.h |
|
576 // -------------------------------------------------------------------------- |
|
577 void CUPnPAVRenderingActive::SetNextURICompleteL() |
|
578 { |
|
579 __LOG( "CUPnPAVRenderingActive::SetNextURICompleteL" ); |
|
580 |
|
581 if( iObserver ) |
|
582 { |
|
583 if( iStatus.Int() == EAVControllerSetNextURICompleted ) |
|
584 { |
|
585 iObserver->SetNextURIResult( KErrNone ); |
|
586 } |
|
587 else |
|
588 { |
|
589 iObserver->SetNextURIResult( iStatus.Int() ); |
|
590 } |
|
591 } |
|
592 } |
|
593 |
|
594 // -------------------------------------------------------------------------- |
|
595 // CUPnPAVRenderingActive::PlayCompleteL |
|
596 // See upnpavrenderingactive.h |
|
597 // -------------------------------------------------------------------------- |
|
598 void CUPnPAVRenderingActive::PlayCompleteL() |
|
599 { |
|
600 __LOG( "CUPnPAVRenderingActive::PlayCompleteL" ); |
|
601 |
|
602 if( iObserver ) |
|
603 { |
|
604 if( iStatus.Int() == EAVControllerPlayCompleted ) |
|
605 { |
|
606 iObserver->InteractOperationComplete( KErrNone, EUPnPAVPlay ); |
|
607 } |
|
608 else |
|
609 { |
|
610 iObserver->InteractOperationComplete( iStatus.Int(), |
|
611 EUPnPAVPlay ); |
|
612 } |
|
613 } |
|
614 } |
|
615 |
|
616 // -------------------------------------------------------------------------- |
|
617 // CUPnPAVRenderingActive::StopCompleteL |
|
618 // See upnpavrenderingactive.h |
|
619 // -------------------------------------------------------------------------- |
|
620 void CUPnPAVRenderingActive::StopCompleteL() |
|
621 { |
|
622 __LOG( "CUPnPAVRenderingActive::StopCompleteL" ); |
|
623 |
|
624 if( iObserver ) |
|
625 { |
|
626 if( iStatus.Int() == EAVControllerStopCompleted ) |
|
627 { |
|
628 iObserver->InteractOperationComplete( KErrNone, EUPnPAVStop ); |
|
629 } |
|
630 else |
|
631 { |
|
632 iObserver->InteractOperationComplete( iStatus.Int(), |
|
633 EUPnPAVStop ); |
|
634 } |
|
635 } |
|
636 } |
|
637 |
|
638 // -------------------------------------------------------------------------- |
|
639 // CUPnPAVRenderingActive::PauseCompleteL |
|
640 // See upnpavrenderingactive.h |
|
641 // -------------------------------------------------------------------------- |
|
642 void CUPnPAVRenderingActive::PauseCompleteL() |
|
643 { |
|
644 __LOG( "CUPnPAVRenderingActive::PauseCompleteL" ); |
|
645 |
|
646 if( iObserver ) |
|
647 { |
|
648 if( iStatus.Int() == EAVControllerPauseCompleted ) |
|
649 { |
|
650 iObserver->InteractOperationComplete( KErrNone, |
|
651 EUPnPAVPause ); |
|
652 } |
|
653 else |
|
654 { |
|
655 iObserver->InteractOperationComplete( iStatus.Int(), |
|
656 EUPnPAVPause ); |
|
657 } |
|
658 } |
|
659 } |
|
660 |
|
661 // -------------------------------------------------------------------------- |
|
662 // CUPnPAVRenderingActive::SetVolumeCompleteL |
|
663 // See upnpavrenderingactive.h |
|
664 // -------------------------------------------------------------------------- |
|
665 void CUPnPAVRenderingActive::SetVolumeCompleteL() |
|
666 { |
|
667 __LOG( "CUPnPAVRenderingActive::SetVolumeCompleteL" ); |
|
668 |
|
669 if( iObserver ) |
|
670 { |
|
671 if( iStatus.Int() == EAVControllerSetVolumeCompleted ) |
|
672 { |
|
673 iObserver->VolumeResult( KErrNone, iRespBufSize, ETrue ); |
|
674 } |
|
675 else |
|
676 { |
|
677 iObserver->VolumeResult( iStatus.Int(), 0, ETrue ); |
|
678 } |
|
679 } |
|
680 } |
|
681 |
|
682 // -------------------------------------------------------------------------- |
|
683 // CUPnPAVRenderingActive::GetVolumeCompleteL |
|
684 // See upnpavrenderingactive.h |
|
685 // -------------------------------------------------------------------------- |
|
686 void CUPnPAVRenderingActive::GetVolumeCompleteL() |
|
687 { |
|
688 __LOG( "CUPnPAVRenderingActive::GetVolumeCompleteL" ); |
|
689 |
|
690 if( iObserver ) |
|
691 { |
|
692 if( iStatus.Int() == EAVControllerGetVolumeCompleted ) |
|
693 { |
|
694 iObserver->VolumeResult( KErrNone, iRespBufSize, ETrue ); |
|
695 } |
|
696 else |
|
697 { |
|
698 iObserver->VolumeResult( iStatus.Int(), 0, ETrue ); |
|
699 } |
|
700 } |
|
701 } |
|
702 |
|
703 // -------------------------------------------------------------------------- |
|
704 // CUPnPAVRenderingActive::SetMuteCompleteL |
|
705 // See upnpavrenderingactive.h |
|
706 // -------------------------------------------------------------------------- |
|
707 void CUPnPAVRenderingActive::SetMuteCompleteL() |
|
708 { |
|
709 __LOG( "CUPnPAVRenderingActive::SetMuteCompleteL" ); |
|
710 |
|
711 if( iObserver ) |
|
712 { |
|
713 if( iStatus.Int() == EAVControllerSetMuteCompleted ) |
|
714 { |
|
715 iObserver->MuteResult( KErrNone, (TBool)iRespBufSize, ETrue ); |
|
716 } |
|
717 else |
|
718 { |
|
719 iObserver->MuteResult( iStatus.Int(), 0, ETrue ); |
|
720 } |
|
721 } |
|
722 } |
|
723 |
|
724 // -------------------------------------------------------------------------- |
|
725 // CUPnPAVRenderingActive::GetMuteCompleteL |
|
726 // See upnpavrenderingactive.h |
|
727 // -------------------------------------------------------------------------- |
|
728 void CUPnPAVRenderingActive::GetMuteCompleteL() |
|
729 { |
|
730 __LOG( "CUPnPAVRenderingActive::GetMuteCompleteL" ); |
|
731 |
|
732 if( iObserver ) |
|
733 { |
|
734 if( iStatus.Int() == EAVControllerGetMuteCompleted ) |
|
735 { |
|
736 iObserver->MuteResult( KErrNone, iRespBufSize, ETrue ); |
|
737 } |
|
738 else |
|
739 { |
|
740 iObserver->MuteResult( iStatus.Int(), 0, ETrue ); |
|
741 } |
|
742 } |
|
743 } |
|
744 |
|
745 // -------------------------------------------------------------------------- |
|
746 // CUPnPAVRenderingActive::PositionInfoCompleteL |
|
747 // See upnpavrenderingactive.h |
|
748 // -------------------------------------------------------------------------- |
|
749 void CUPnPAVRenderingActive::PositionInfoCompleteL() |
|
750 { |
|
751 __LOG( "CUPnPAVRenderingActive::PositionInfoCompleteL" ); |
|
752 |
|
753 if( iObserver ) |
|
754 { |
|
755 if( iStatus.Int() == EAVControllerPositionInfoCompleted ) |
|
756 { |
|
757 iObserver->PositionInfoResult( KErrNone, *iBuffer2, *iBuffer ); |
|
758 } |
|
759 else |
|
760 { |
|
761 iObserver->PositionInfoResult( iStatus.Int(), |
|
762 KNullDesC8, |
|
763 KNullDesC8 ); |
|
764 } |
|
765 } |
|
766 } |
|
767 |
|
768 // -------------------------------------------------------------------------- |
|
769 // CUPnPAVRenderingActive::StartMediaServerCompleteL |
|
770 // See upnpavrenderingactive.h |
|
771 // -------------------------------------------------------------------------- |
|
772 void CUPnPAVRenderingActive::StartMediaServerCompleteL() |
|
773 { |
|
774 __LOG( "CUPnPAVRenderingActive::StartMediaServerCompleteL" ); |
|
775 |
|
776 if( iObserver ) |
|
777 { |
|
778 |
|
779 if( iStatus.Int() == EAVControllerStartMediaServerCompleted ) |
|
780 { |
|
781 iMediaServerResourceReserved = ETrue; |
|
782 iObserver->ReserveLocalMSServicesCompleted( KErrNone ); |
|
783 } |
|
784 else |
|
785 { |
|
786 iObserver->ReserveLocalMSServicesCompleted( iStatus.Int() ); |
|
787 } |
|
788 |
|
789 } |
|
790 } |
|
791 // end of file |