1 /* |
|
2 * Copyright (c) 2005 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // USER |
|
20 #include "musengmcesession.h" |
|
21 #include "lcsessionobserver.h" |
|
22 #include "musenglogger.h" |
|
23 #include "lcuiprovider.h" |
|
24 #include "lcvideoplayer.h" |
|
25 #include "musengremotevideoplayer.h" |
|
26 #include "musenglivevideoplayer.h" |
|
27 #include "mccscreen.h" |
|
28 |
|
29 // SYSTEM |
|
30 #include <audiopreference.h> |
|
31 #include <e32property.h> |
|
32 |
|
33 #include <cntitem.h> |
|
34 #include <cntfield.h> |
|
35 #include <cntdef.h> |
|
36 #include <cntfldst.h> |
|
37 |
|
38 |
|
39 #include "svptimer.h" |
|
40 |
|
41 RDrawableWindow* testWindow = 0; |
|
42 |
|
43 // ----------------------------------------------------------------------------- |
|
44 // |
|
45 // ----------------------------------------------------------------------------- |
|
46 // |
|
47 CMusEngMceSession::CMusEngMceSession() |
|
48 { |
|
49 iBackground = IsBackgroundStartup(); |
|
50 } |
|
51 |
|
52 // ----------------------------------------------------------------------------- |
|
53 // |
|
54 // ----------------------------------------------------------------------------- |
|
55 // |
|
56 void CMusEngMceSession::ConstructL() |
|
57 { |
|
58 MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::ConstructL()" ) |
|
59 |
|
60 iRemoteVideoPlayer = CMusEngRemoteVideoPlayer::NewL( *this, *this ); |
|
61 iLiveVideoPlayer = CMusEngLiveVideoPlayer::NewL( *this, iCameraHandler, *this ); |
|
62 iLcSessionState = MLcSession::EUninitialized; |
|
63 |
|
64 iTimer = CSVPTimer::NewL( *this, 1 ); |
|
65 iCameraHandler.SetSession( this ); |
|
66 |
|
67 // indicator control |
|
68 iIndicatorCtr = new ( ELeave ) LcVtIndicatorController(); |
|
69 |
|
70 MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::ConstructL()" ) |
|
71 } |
|
72 |
|
73 // ----------------------------------------------------------------------------- |
|
74 // |
|
75 // ----------------------------------------------------------------------------- |
|
76 // |
|
77 CMusEngMceSession::~CMusEngMceSession() |
|
78 { |
|
79 MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::~CMusEngMceSession()" ) |
|
80 |
|
81 delete iRemoteAddress; |
|
82 delete iRemoteVideoPlayer; |
|
83 delete iLiveVideoPlayer; |
|
84 delete iScreen; |
|
85 |
|
86 if (iIndicatorCtr) |
|
87 { |
|
88 iIndicatorCtr->disableActiveCallIndicator(); |
|
89 delete iIndicatorCtr; |
|
90 } |
|
91 MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::~CMusEngMceSession()" ) |
|
92 } |
|
93 |
|
94 // ----------------------------------------------------------------------------- |
|
95 // From MMusEngDisplayHandler |
|
96 // ----------------------------------------------------------------------------- |
|
97 // |
|
98 TRect CMusEngMceSession::Rect() const |
|
99 { |
|
100 MUS_LOG( "mus: [ENGINE] CMusEngMceSession::Rect()" ) |
|
101 return iRect; |
|
102 } |
|
103 |
|
104 // ----------------------------------------------------------------------------- |
|
105 // From MMusEngDisplayHandler |
|
106 // ----------------------------------------------------------------------------- |
|
107 // |
|
108 void CMusEngMceSession::SetRectL( const TRect& aRect ) |
|
109 { |
|
110 MUS_LOG( "mus: [ENGINE] CMusEngSession::SetRectL()" ) |
|
111 if ( !iScreen ){ |
|
112 iScreen = CMccScreen::NewL(0,TPoint(0,0), TSize(640,640), 0, 1, 0, EFalse, testWindow); |
|
113 } |
|
114 iRect = aRect; |
|
115 if ( iScreen ) |
|
116 { |
|
117 iScreen->SetPrimaryRectL(iRect); |
|
118 } |
|
119 } |
|
120 |
|
121 // ----------------------------------------------------------------------------- |
|
122 // From MMusEngDisplayHandler |
|
123 // ----------------------------------------------------------------------------- |
|
124 // |
|
125 void CMusEngMceSession::SetSecondaryRectL( const TRect& aSecondaryRect ) |
|
126 { |
|
127 MUS_LOG( "mus: [ENGINE] CMusEngMceSession::SetSecondaryRectL()" ) |
|
128 if ( !iScreen ){ |
|
129 iScreen = CMccScreen::NewL(0,TPoint(0,0), TSize(640,640), 0, 1, 0, EFalse, testWindow); |
|
130 } |
|
131 // Same rect is set by primary and secondary setters |
|
132 iSetLocalRect = aSecondaryRect; |
|
133 if ( iScreen ) |
|
134 { |
|
135 iScreen->SetSecondaryRectL(iSetLocalRect); |
|
136 } |
|
137 } |
|
138 |
|
139 // ----------------------------------------------------------------------------- |
|
140 // From MMusEngDisplayHandler |
|
141 // ----------------------------------------------------------------------------- |
|
142 // |
|
143 TRect CMusEngMceSession::SecondaryRect() const |
|
144 { |
|
145 MUS_LOG( "mus: [ENGINE] CMusEngMceSession::SecondaryRect()" ) |
|
146 return iSetLocalRect; |
|
147 } |
|
148 |
|
149 #if 0 |
|
150 |
|
151 // ----------------------------------------------------------------------------- |
|
152 // |
|
153 // ----------------------------------------------------------------------------- |
|
154 // |
|
155 void CMusEngTwoWaySession::SetSecondaryRectL( const TRect& aSecondaryRect ) |
|
156 { |
|
157 MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::SetSecondaryRectL()" ) |
|
158 |
|
159 iLocalRect = aSecondaryRect; |
|
160 |
|
161 MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::SetSecondaryRectL()" ) |
|
162 } |
|
163 |
|
164 // ----------------------------------------------------------------------------- |
|
165 // |
|
166 // ----------------------------------------------------------------------------- |
|
167 // |
|
168 TRect CMusEngTwoWaySession::SecondaryRect() const |
|
169 { |
|
170 MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::SecondaryRect()" ) |
|
171 MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::SecondaryRect()" ) |
|
172 return iLocalRect; |
|
173 } |
|
174 |
|
175 #endif |
|
176 |
|
177 // ----------------------------------------------------------------------------- |
|
178 // From MMusEngDisplayHandler |
|
179 // ----------------------------------------------------------------------------- |
|
180 // |
|
181 MMusEngDisplayHandler::TDisplayOrientation CMusEngMceSession::OrientationL() |
|
182 { |
|
183 MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::RotationL()" ) |
|
184 return MMusEngDisplayHandler::EPortrait; |
|
185 } |
|
186 |
|
187 // ----------------------------------------------------------------------------- |
|
188 // |
|
189 // ----------------------------------------------------------------------------- |
|
190 // |
|
191 void CMusEngMceSession::SetOrientationL( TDisplayOrientation aOrientation ) |
|
192 { |
|
193 MUS_LOG1( "mus: [ENGINE] -> CMusEngMceSession::SetOrientationL() %d", |
|
194 aOrientation ) |
|
195 |
|
196 MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::SetOrientationL()" ) |
|
197 } |
|
198 |
|
199 // ----------------------------------------------------------------------------- |
|
200 // |
|
201 // ----------------------------------------------------------------------------- |
|
202 // |
|
203 void CMusEngMceSession::EnableDisplayL( TBool aEnable ) |
|
204 { |
|
205 MUS_LOG1( "mus: [ENGINE] -> CMusEngMceSession::EnableDisplay() %d", |
|
206 aEnable ) |
|
207 |
|
208 MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::EnableDisplay()") |
|
209 } |
|
210 |
|
211 // ----------------------------------------------------------------------------- |
|
212 // |
|
213 // ----------------------------------------------------------------------------- |
|
214 // |
|
215 TBool CMusEngMceSession::IsDisplayEnabled() |
|
216 { |
|
217 TBool enabled( EFalse ); |
|
218 return enabled; |
|
219 } |
|
220 |
|
221 // ----------------------------------------------------------------------------- |
|
222 // From MMusEngDisplayHandler |
|
223 // ----------------------------------------------------------------------------- |
|
224 // |
|
225 TBool CMusEngMceSession::IsDisplayActive() |
|
226 { |
|
227 return ( IsDisplayEnabled() ); |
|
228 } |
|
229 |
|
230 // ----------------------------------------------------------------------------- |
|
231 // From MLcSession |
|
232 // ----------------------------------------------------------------------------- |
|
233 // |
|
234 MLcSession::TLcSessionState CMusEngMceSession::LcSessionState() const |
|
235 { |
|
236 MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::LcSessionState()" ) |
|
237 |
|
238 TLcSessionState lcSessionState = MLcSession::EUninitialized; |
|
239 |
|
240 /* |
|
241 if ( iSession ) |
|
242 { |
|
243 switch( iSession->State() ) |
|
244 { |
|
245 case CMceSession::EIdle: |
|
246 { |
|
247 lcSessionState = MLcSession::EInitialized; |
|
248 break; |
|
249 } |
|
250 case CMceSession::EIncoming: |
|
251 case CMceSession::EProceeding: |
|
252 case CMceSession::EReserving: |
|
253 { |
|
254 lcSessionState = MLcSession::EReceived; |
|
255 break; |
|
256 } |
|
257 |
|
258 case CMceSession::EOffering: |
|
259 case CMceSession::EAnswering: |
|
260 { |
|
261 lcSessionState = MLcSession::EOpening; |
|
262 break; |
|
263 } |
|
264 case CMceSession::EEstablished: |
|
265 { |
|
266 lcSessionState = MLcSession::EOpen; |
|
267 break; |
|
268 } |
|
269 case CMceSession::ECancelling: |
|
270 case CMceSession::ETerminating: |
|
271 { |
|
272 lcSessionState = MLcSession::EClosing; |
|
273 break; |
|
274 } |
|
275 case CMceSession::ETerminated: |
|
276 { |
|
277 lcSessionState = MLcSession::EClosed; |
|
278 break; |
|
279 } |
|
280 default: |
|
281 { |
|
282 lcSessionState = MLcSession::EUninitialized; |
|
283 break; |
|
284 } |
|
285 } |
|
286 } |
|
287 */ |
|
288 |
|
289 return iLcSessionState; |
|
290 } |
|
291 |
|
292 // ----------------------------------------------------------------------------- |
|
293 // From MLcSession |
|
294 // ----------------------------------------------------------------------------- |
|
295 // |
|
296 void CMusEngMceSession::SetLcSessionObserver( MLcSessionObserver* aObserver ) |
|
297 { |
|
298 iLcSessionObserver = aObserver; |
|
299 } |
|
300 |
|
301 // ----------------------------------------------------------------------------- |
|
302 // From MLcSession |
|
303 // ----------------------------------------------------------------------------- |
|
304 // |
|
305 void CMusEngMceSession::SetLcUiProvider( MLcUiProvider* aUiProvider ) |
|
306 { |
|
307 iLcUiProvider = aUiProvider; |
|
308 } |
|
309 |
|
310 // ----------------------------------------------------------------------------- |
|
311 // From MLcSession |
|
312 // ----------------------------------------------------------------------------- |
|
313 // |
|
314 MLcVideoPlayer* CMusEngMceSession::RemoteVideoPlayer() |
|
315 { |
|
316 return iRemoteVideoPlayer; |
|
317 } |
|
318 |
|
319 // ----------------------------------------------------------------------------- |
|
320 // From MLcSession |
|
321 // ----------------------------------------------------------------------------- |
|
322 // |
|
323 MLcVideoPlayer* CMusEngMceSession::LocalVideoPlayer() |
|
324 { |
|
325 return iLiveVideoPlayer; |
|
326 } |
|
327 |
|
328 // ----------------------------------------------------------------------------- |
|
329 // From MLcSession |
|
330 // ----------------------------------------------------------------------------- |
|
331 // |
|
332 const TDesC& CMusEngMceSession::LocalDisplayName() |
|
333 { |
|
334 return KNullDesC; |
|
335 } |
|
336 |
|
337 // ----------------------------------------------------------------------------- |
|
338 // From MLcSession |
|
339 // ----------------------------------------------------------------------------- |
|
340 // |
|
341 const TDesC& CMusEngMceSession::RemoteDisplayName() |
|
342 { |
|
343 return *iRemoteAddress; |
|
344 } |
|
345 |
|
346 // ----------------------------------------------------------------------------- |
|
347 // From MLcSession |
|
348 // ----------------------------------------------------------------------------- |
|
349 // |
|
350 TInt CMusEngMceSession::SetParameter( TInt aId, TInt aValue ) |
|
351 { |
|
352 if ( aId == 0 ){ |
|
353 testWindow = reinterpret_cast<RDrawableWindow*>(aValue); |
|
354 } |
|
355 return KErrNotSupported; |
|
356 } |
|
357 |
|
358 // ----------------------------------------------------------------------------- |
|
359 // From MLcSession |
|
360 // ----------------------------------------------------------------------------- |
|
361 // |
|
362 TInt CMusEngMceSession::ParameterValue( TInt /*aId*/ ) |
|
363 { |
|
364 return KErrNotSupported; |
|
365 } |
|
366 |
|
367 // ----------------------------------------------------------------------------- |
|
368 // From MLcSession |
|
369 // ----------------------------------------------------------------------------- |
|
370 // |
|
371 TBool CMusEngMceSession::IsBackgroundStartup() |
|
372 { |
|
373 return ETrue; |
|
374 } |
|
375 |
|
376 // ----------------------------------------------------------------------------- |
|
377 // From MLcSession |
|
378 // ----------------------------------------------------------------------------- |
|
379 // |
|
380 TBool CMusEngMceSession::SendDialTone( TChar aKey ) |
|
381 { |
|
382 MUS_LOG1( "mus: [ENGINE] -> CMusEngMceSession::SendDialTone() key = %c",aKey ) |
|
383 return ETrue; |
|
384 } |
|
385 |
|
386 // ----------------------------------------------------------------------------- |
|
387 // From MLcAudioControl |
|
388 // ----------------------------------------------------------------------------- |
|
389 // |
|
390 TBool CMusEngMceSession::IsLcAudioMutedL() |
|
391 { |
|
392 return EFalse; |
|
393 } |
|
394 |
|
395 // ----------------------------------------------------------------------------- |
|
396 // From MLcAudioControl |
|
397 // ----------------------------------------------------------------------------- |
|
398 // |
|
399 void CMusEngMceSession::MuteLcAudioL( TBool aMute ) |
|
400 { |
|
401 } |
|
402 |
|
403 // ----------------------------------------------------------------------------- |
|
404 // From MLcAudioControl |
|
405 // ----------------------------------------------------------------------------- |
|
406 // |
|
407 TBool CMusEngMceSession::IsLcMicMutedL() |
|
408 { |
|
409 return EFalse; |
|
410 } |
|
411 |
|
412 // ----------------------------------------------------------------------------- |
|
413 // From MLcAudioControl |
|
414 // ----------------------------------------------------------------------------- |
|
415 // |
|
416 void CMusEngMceSession::MuteLcMicL( TBool aMute ) |
|
417 { |
|
418 } |
|
419 |
|
420 // ----------------------------------------------------------------------------- |
|
421 // From MLcAudioControl |
|
422 // ----------------------------------------------------------------------------- |
|
423 // |
|
424 TBool CMusEngMceSession::IsEnablingLcLoudspeakerAllowed() |
|
425 { |
|
426 return ETrue; |
|
427 } |
|
428 |
|
429 // ----------------------------------------------------------------------------- |
|
430 // From MLcAudioControl |
|
431 // ----------------------------------------------------------------------------- |
|
432 // |
|
433 void CMusEngMceSession::EnableLcLoudspeakerL( TBool aEnabled ) |
|
434 { |
|
435 } |
|
436 |
|
437 // ----------------------------------------------------------------------------- |
|
438 // From MLcAudioControl |
|
439 // ----------------------------------------------------------------------------- |
|
440 // |
|
441 TBool CMusEngMceSession::IsLcLoudspeakerEnabled() |
|
442 { |
|
443 return ETrue; |
|
444 } |
|
445 |
|
446 // ----------------------------------------------------------------------------- |
|
447 // From MLcAudioControl |
|
448 // ----------------------------------------------------------------------------- |
|
449 // |
|
450 TInt CMusEngMceSession::LcVolumeL() |
|
451 { |
|
452 return 5; |
|
453 } |
|
454 |
|
455 // ----------------------------------------------------------------------------- |
|
456 // From MLcAudioControl |
|
457 // ----------------------------------------------------------------------------- |
|
458 // |
|
459 void CMusEngMceSession::SetLcVolumeL( TInt aValue ) |
|
460 { |
|
461 } |
|
462 |
|
463 // ----------------------------------------------------------------------------- |
|
464 // From MLcAudioControl |
|
465 // ----------------------------------------------------------------------------- |
|
466 // |
|
467 void CMusEngMceSession::IncreaseLcVolumeL() |
|
468 { |
|
469 } |
|
470 |
|
471 // ----------------------------------------------------------------------------- |
|
472 // From MLcAudioControl |
|
473 // ----------------------------------------------------------------------------- |
|
474 // |
|
475 void CMusEngMceSession::DecreaseLcVolumeL() |
|
476 { |
|
477 } |
|
478 |
|
479 |
|
480 // ----------------------------------------------------------------------------- |
|
481 // From MLcAudioControl |
|
482 // ----------------------------------------------------------------------------- |
|
483 // |
|
484 void CMusEngMceSession::TimedOut( TInt aTimerId ) |
|
485 { |
|
486 MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::TimedOut()" ) |
|
487 |
|
488 /* |
|
489 iLcSessionState = MLcSession::EOpen; |
|
490 |
|
491 if ( iLcSessionObserver ) |
|
492 { |
|
493 MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::TimedOut(), StateChanged" ) |
|
494 iLcSessionObserver->StateChanged( *this ); |
|
495 } |
|
496 */ |
|
497 switch( aTimerId ) |
|
498 { |
|
499 case 1: |
|
500 { |
|
501 MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::TimedOut(), StateChanged -> Established" ) |
|
502 |
|
503 InformUiProviderAboutReceivingStart(); |
|
504 |
|
505 iLcSessionState = MLcSession::EOpen; |
|
506 iLcSessionObserver->StateChanged( *this ); |
|
507 |
|
508 // starting remote playing timer |
|
509 iTimer->SetTime(10000, 3); |
|
510 |
|
511 break; |
|
512 } |
|
513 case 2: |
|
514 { |
|
515 MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::TimedOut(), StateChanged -> RemotePlaying" ) |
|
516 iRemoteVideoPlayer->iState = MLcVideoPlayer::EPlaying; |
|
517 iLcSessionObserver->StateChanged( *iRemoteVideoPlayer ); |
|
518 break; |
|
519 } |
|
520 case 3: |
|
521 { |
|
522 MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::TimedOut(), StateChanged -> LocalPlaying" ) |
|
523 iLiveVideoPlayer->iState = MLcVideoPlayer::EPlaying; |
|
524 iLcSessionObserver->StateChanged( *iLiveVideoPlayer ); |
|
525 iTimer->SetTime(5000, 2); |
|
526 break; |
|
527 } |
|
528 case 10: |
|
529 { |
|
530 MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::TimedOut(), Camera Toggle, StateChanged -> LocalPaused" ) |
|
531 iLiveVideoPlayer->iState = MLcVideoPlayer::EPaused; |
|
532 iLcSessionObserver->StateChanged( *iLiveVideoPlayer ); |
|
533 iTimer->SetTime(10000, 11); |
|
534 break; |
|
535 } |
|
536 case 11: |
|
537 { |
|
538 MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::TimedOut(), Camera Toggle, StateChanged -> LocalPlaying" ) |
|
539 iLiveVideoPlayer->iState = MLcVideoPlayer::EPlaying; |
|
540 iLcSessionObserver->StateChanged( *iLiveVideoPlayer ); |
|
541 break; |
|
542 } |
|
543 case 12: |
|
544 { |
|
545 MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::TimedOut(), Camera Play, StateChanged -> LocalPlaying" ) |
|
546 iLiveVideoPlayer->iState = MLcVideoPlayer::EPlaying; |
|
547 iLcSessionObserver->StateChanged( *iLiveVideoPlayer ); |
|
548 break; |
|
549 } |
|
550 case 13: |
|
551 { |
|
552 MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::TimedOut(), Camera Pause, StateChanged -> LocalIdle" ) |
|
553 iLiveVideoPlayer->iState = MLcVideoPlayer::EPaused; |
|
554 iLcSessionObserver->StateChanged( *iLiveVideoPlayer ); |
|
555 break; |
|
556 } |
|
557 |
|
558 |
|
559 case 14: |
|
560 { |
|
561 MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::TimedOut(), StateChanged -> EReceived" ) |
|
562 InformUiProviderAboutReceivingStart(); |
|
563 iLcSessionState = MLcSession::EReceived; |
|
564 iLcSessionObserver->StateChanged( *this ); |
|
565 break; |
|
566 } |
|
567 |
|
568 default: |
|
569 { |
|
570 iLcSessionState = MLcSession::EUninitialized; |
|
571 break; |
|
572 } |
|
573 } |
|
574 /* |
|
575 switch( aTimerId ) |
|
576 { |
|
577 case CMceSession::EIdle: |
|
578 { |
|
579 lcSessionState = MLcSession::EInitialized; |
|
580 break; |
|
581 } |
|
582 case CMceSession::EIncoming: |
|
583 case CMceSession::EProceeding: |
|
584 case CMceSession::EReserving: |
|
585 { |
|
586 lcSessionState = MLcSession::EReceived; |
|
587 break; |
|
588 } |
|
589 |
|
590 case CMceSession::EOffering: |
|
591 case CMceSession::EAnswering: |
|
592 { |
|
593 lcSessionState = MLcSession::EOpening; |
|
594 break; |
|
595 } |
|
596 case CMceSession::EEstablished: |
|
597 { |
|
598 lcSessionState = MLcSession::EOpen; |
|
599 break; |
|
600 } |
|
601 case CMceSession::ECancelling: |
|
602 case CMceSession::ETerminating: |
|
603 { |
|
604 lcSessionState = MLcSession::EClosing; |
|
605 break; |
|
606 } |
|
607 case CMceSession::ETerminated: |
|
608 { |
|
609 lcSessionState = MLcSession::EClosed; |
|
610 break; |
|
611 } |
|
612 default: |
|
613 { |
|
614 lcSessionState = MLcSession::EUninitialized; |
|
615 break; |
|
616 } |
|
617 } |
|
618 */ |
|
619 MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::TimedOut()" ) |
|
620 } |
|
621 |
|
622 |
|
623 |
|
624 TInt CMusEngMceSession::SetForegroundStatus( TBool aIsForeground ) |
|
625 { |
|
626 MUS_LOG1( "mus: [ENGINE] -> CMusEngMceSession::SetForegroundStatus() %d", |
|
627 aIsForeground ) |
|
628 if ( iScreen ){ |
|
629 iScreen->Update(aIsForeground); |
|
630 } |
|
631 |
|
632 if ( aIsForeground ) |
|
633 { |
|
634 iIndicatorCtr->disableActiveCallIndicator(); |
|
635 } |
|
636 else { |
|
637 iIndicatorCtr->enableActiveCallIndicator(); |
|
638 } |
|
639 return KErrNone; |
|
640 } |
|
641 |
|
642 _LIT( KIpVtEngStubRemoteDetails, "5556567844" ); |
|
643 |
|
644 // ----------------------------------------------------------------------------- |
|
645 // |
|
646 // ----------------------------------------------------------------------------- |
|
647 // |
|
648 const TDesC& CMusEngMceSession::RemoteDetails() |
|
649 { |
|
650 return KIpVtEngStubRemoteDetails(); |
|
651 } |
|
652 |
|
653 // ----------------------------------------------------------------------------- |
|
654 // |
|
655 // ----------------------------------------------------------------------------- |
|
656 // |
|
657 void CMusEngMceSession::SetRemoteL( const TDesC& aRemote ) |
|
658 { |
|
659 iRemoteAddress = aRemote.AllocL(); |
|
660 } |
|
661 |
|
662 #if 0 |
|
663 |
|
664 // ----------------------------------------------------------------------------- |
|
665 // |
|
666 // ----------------------------------------------------------------------------- |
|
667 // |
|
668 void CMusEngMceSession::InformObserverAboutSessionStateChange() |
|
669 { |
|
670 if ( iLcSessionObserver ) |
|
671 { |
|
672 iLcSessionObserver->StateChanged( *this ); |
|
673 } |
|
674 } |
|
675 |
|
676 // ----------------------------------------------------------------------------- |
|
677 // |
|
678 // ----------------------------------------------------------------------------- |
|
679 // |
|
680 void CMusEngMceSession::InformObserverAboutSessionUpdate() |
|
681 { |
|
682 if ( iLcSessionObserver ) |
|
683 { |
|
684 iLcSessionObserver->Updated( *this ); |
|
685 } |
|
686 } |
|
687 |
|
688 // ----------------------------------------------------------------------------- |
|
689 // |
|
690 // ----------------------------------------------------------------------------- |
|
691 // |
|
692 void CMusEngMceSession::InformObserverAboutSessionFailure( TInt aReason ) |
|
693 { |
|
694 if ( iLcSessionObserver ) |
|
695 { |
|
696 iLcSessionObserver->Failed( *this, aReason ); |
|
697 } |
|
698 } |
|
699 |
|
700 // ----------------------------------------------------------------------------- |
|
701 // |
|
702 // ----------------------------------------------------------------------------- |
|
703 // |
|
704 void CMusEngMceSession::InformObserverAboutPlayerStateChange( |
|
705 MLcVideoPlayer* aPlayer ) |
|
706 { |
|
707 if ( iLcSessionObserver && aPlayer ) |
|
708 { |
|
709 iLcSessionObserver->StateChanged( *aPlayer ); |
|
710 } |
|
711 |
|
712 } |
|
713 |
|
714 |
|
715 // ----------------------------------------------------------------------------- |
|
716 // |
|
717 // ----------------------------------------------------------------------------- |
|
718 // |
|
719 void CMusEngMceSession::InformObserverAboutPlayerUpdate( |
|
720 MLcVideoPlayer* aPlayer ) |
|
721 { |
|
722 if ( iLcSessionObserver && aPlayer ) |
|
723 { |
|
724 iLcSessionObserver->Updated( *aPlayer ); |
|
725 } |
|
726 } |
|
727 |
|
728 // ----------------------------------------------------------------------------- |
|
729 // |
|
730 // ----------------------------------------------------------------------------- |
|
731 // |
|
732 void CMusEngMceSession::InformObserverAboutPlayerFailure( |
|
733 MLcVideoPlayer* aPlayer, |
|
734 TInt aReason ) |
|
735 { |
|
736 if ( iLcSessionObserver && aPlayer ) |
|
737 { |
|
738 iLcSessionObserver->Failed( *aPlayer, aReason ); |
|
739 } |
|
740 } |
|
741 |
|
742 |
|
743 // ----------------------------------------------------------------------------- |
|
744 // |
|
745 // ----------------------------------------------------------------------------- |
|
746 // |
|
747 MLcUiProvider& CMusEngMceSession::LcUiProviderL() |
|
748 { |
|
749 __ASSERT_ALWAYS( iLcUiProvider, User::Leave( KErrNotReady ) ); |
|
750 return *iLcUiProvider; |
|
751 } |
|
752 #endif |
|
753 |
|
754 // ----------------------------------------------------------------------------- |
|
755 // |
|
756 // ----------------------------------------------------------------------------- |
|
757 // |
|
758 void CMusEngMceSession::InformUiProviderAboutReceivingStart() |
|
759 { |
|
760 MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::InformUiProviderAboutReceivingStart()" ) |
|
761 if ( iBackground && iLcUiProvider ) |
|
762 { |
|
763 MUS_LOG( "mus: [ENGINE] receiving started in BG mode, switching to FG" ) |
|
764 iBackground = EFalse; |
|
765 iLcUiProvider->HandleForegroundStatus( ETrue ); |
|
766 } |
|
767 MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::InformUiProviderAboutReceivingStart()" ) |
|
768 } |
|
769 |
|
770 void CMusEngMceSession::ToggleCameraL() |
|
771 { |
|
772 MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::ToggleCameraL()" ) |
|
773 if( iLiveVideoPlayer->iState == MLcVideoPlayer::EPlaying ) |
|
774 { |
|
775 MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::ToggleCameraL(), start timer" ) |
|
776 iTimer->SetTime(5000, 10); |
|
777 } |
|
778 MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::ToggleCameraL()" ) |
|
779 } |
|
780 |
|
781 void CMusEngMceSession::PlayCameraL() |
|
782 { |
|
783 MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::PlayCameraL()" ) |
|
784 iTimer->SetTime(5000, 12); |
|
785 MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::PlayCameraL()" ) |
|
786 } |
|
787 |
|
788 void CMusEngMceSession::PauseCameraL() |
|
789 { |
|
790 MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::PauseCameraL()" ) |
|
791 iTimer->SetTime(5000, 13); |
|
792 MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::PauseCameraL()" ) |
|
793 } |
|
794 |
|
795 |
|
796 // End of file |
|