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