|
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: Application's UI class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include "musuilivesharingcontroller.h" |
|
21 #include "musuicallbackservice.h" |
|
22 #include "musuieventobserver.h" |
|
23 #include "musuisharingobserver.h" |
|
24 #include "musuisendobserver.h" |
|
25 #include "musuilivesharingobserver.h" |
|
26 #include "musuidialogutil.h" |
|
27 #include "musenglivesession.h" |
|
28 #include "musuiresourcehandler.h" |
|
29 #include "musui.hrh" |
|
30 #include "mussettings.h" |
|
31 #include "mussettingskeys.h" |
|
32 #include "muslogger.h" // debug logging |
|
33 #include "musuigeneralview.h" |
|
34 |
|
35 #include <musui.rsg> |
|
36 #include <avkon.hrh> |
|
37 #include <StringLoader.h> |
|
38 |
|
39 #include <AknUtils.h> |
|
40 |
|
41 using namespace NMusResourceApi; |
|
42 using namespace MusSettingsKeys; |
|
43 |
|
44 |
|
45 // ----------------------------------------------------------------------------- |
|
46 // |
|
47 // ----------------------------------------------------------------------------- |
|
48 // |
|
49 CMusUiLiveSharingController* CMusUiLiveSharingController::NewL( |
|
50 MMusUiEventObserver& aEventObserver, |
|
51 MMusUiSharingObserver& aSharingObserver, |
|
52 MMusUiSendObserver& aSendObserver, |
|
53 MMusUiLiveSharingObserver& aLiveObserver, |
|
54 const TRect& aRect ) |
|
55 { |
|
56 CMusUiLiveSharingController* self = |
|
57 new( ELeave ) CMusUiLiveSharingController( aEventObserver, |
|
58 aSharingObserver, |
|
59 aSendObserver, |
|
60 aLiveObserver ); |
|
61 CleanupStack::PushL( self ); |
|
62 self->ConstructL( aRect ); |
|
63 CleanupStack::Pop( self ); |
|
64 return self; |
|
65 } |
|
66 |
|
67 |
|
68 // ----------------------------------------------------------------------------- |
|
69 // |
|
70 // ----------------------------------------------------------------------------- |
|
71 // |
|
72 CMusUiLiveSharingController::~CMusUiLiveSharingController() |
|
73 { |
|
74 MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::~CMusUiLiveSharingController" ); |
|
75 delete iSession; |
|
76 MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::~CMusUiLiveSharingController" ); |
|
77 } |
|
78 |
|
79 |
|
80 // ----------------------------------------------------------------------------- |
|
81 // |
|
82 // ----------------------------------------------------------------------------- |
|
83 // |
|
84 CMusUiLiveSharingController::CMusUiLiveSharingController( |
|
85 MMusUiEventObserver& aEventObserver, |
|
86 MMusUiSharingObserver& aSharingObserver, |
|
87 MMusUiSendObserver& aSendObserver, |
|
88 MMusUiLiveSharingObserver& aLiveObserver ) |
|
89 : CMusUiSendController( aEventObserver, aSharingObserver, aSendObserver ), |
|
90 iLiveObserver( aLiveObserver ) |
|
91 { |
|
92 } |
|
93 |
|
94 |
|
95 // ----------------------------------------------------------------------------- |
|
96 // |
|
97 // ----------------------------------------------------------------------------- |
|
98 // |
|
99 void CMusUiLiveSharingController::ConstructL( const TRect& aRect ) |
|
100 { |
|
101 MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::ConstructL" ); |
|
102 |
|
103 CMusUiSendController::ConstructL(); // Base class construction |
|
104 |
|
105 iSession = CMusEngLiveSession::NewL( VideoFileNameL(), |
|
106 aRect, |
|
107 *this, |
|
108 *this, |
|
109 *this, |
|
110 iSipProfileId ); |
|
111 |
|
112 iSession->SetAudioRoutingObserver( this ); |
|
113 |
|
114 if ( iSession->AudioRoutingCanBeChanged() ) |
|
115 { |
|
116 iSession->EnableLoudspeakerL( ELoudspeakerEnabled, ETrue ); |
|
117 } |
|
118 |
|
119 if ( iVideoCodec && iVideoCodec->Length() > 0 ) |
|
120 { |
|
121 iSession->SetSupportedVideoCodecListL( *iVideoCodec ); |
|
122 } |
|
123 |
|
124 MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::ConstructL" ); |
|
125 } |
|
126 |
|
127 |
|
128 // ----------------------------------------------------------------------------- |
|
129 // |
|
130 // ----------------------------------------------------------------------------- |
|
131 // |
|
132 void CMusUiLiveSharingController::PlayL() |
|
133 { |
|
134 MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::PlayL" ); |
|
135 |
|
136 CMusUiSendController::PlayL(); |
|
137 iEventObserver.ShowNaviPaneIconL( |
|
138 (!iDiskFull) ? RecordIcon() : EMusUiNaviIconRecordNot ); |
|
139 |
|
140 MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::PlayL" ); |
|
141 } |
|
142 |
|
143 |
|
144 // ----------------------------------------------------------------------------- |
|
145 // |
|
146 // ----------------------------------------------------------------------------- |
|
147 // |
|
148 void CMusUiLiveSharingController::PauseL() |
|
149 { |
|
150 MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::PauseL" ); |
|
151 |
|
152 CMusUiSendController::PauseL(); |
|
153 iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconPause ); |
|
154 |
|
155 MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::PauseL" ); |
|
156 } |
|
157 |
|
158 |
|
159 // ----------------------------------------------------------------------------- |
|
160 // |
|
161 // ----------------------------------------------------------------------------- |
|
162 // |
|
163 void CMusUiLiveSharingController::DeleteEngineSession() |
|
164 { |
|
165 CMusUiSendController::DeleteEngineSession(); |
|
166 |
|
167 delete iSession; |
|
168 iSession = NULL; |
|
169 } |
|
170 |
|
171 |
|
172 // ----------------------------------------------------------------------------- |
|
173 // |
|
174 // ----------------------------------------------------------------------------- |
|
175 // |
|
176 CMusEngMceOutSession* CMusUiLiveSharingController::EngineOutSession() |
|
177 { |
|
178 return iSession; // Live session is CMusEngMceOutSession |
|
179 } |
|
180 |
|
181 |
|
182 // ----------------------------------------------------------------------------- |
|
183 // |
|
184 // ----------------------------------------------------------------------------- |
|
185 // |
|
186 void CMusUiLiveSharingController::InviteL( const TDesC& aRecipient ) |
|
187 { |
|
188 MUS_LOG_TDESC( "mus: [MUSUI ] -> CMusUiLiveSharingController::InviteL:", |
|
189 aRecipient ); |
|
190 |
|
191 // Registration must not be pending in this phase |
|
192 __ASSERT_ALWAYS( !iSipRegistrationPending, |
|
193 iEventObserver.HandleError( KErrNotReady ) ); |
|
194 |
|
195 delete iAddress; |
|
196 iAddress = NULL; |
|
197 iAddress = aRecipient.AllocL(); |
|
198 |
|
199 |
|
200 TRAPD( err, iSession->InviteL( aRecipient ) ); |
|
201 MUS_LOG( "mus: [MUSUI ] CMusUiLiveSharingController::InviteL: After TRAPD" ); |
|
202 |
|
203 // If address is in wrong format, Manual Address Entry Dialog |
|
204 // is displayed |
|
205 if ( err != KErrNone ) |
|
206 { |
|
207 // Display the error message |
|
208 DismissWaitDialog(); |
|
209 if ( !ExitOccured() ) |
|
210 { |
|
211 MusUiDialogUtil::ShowGlobalErrorDialogL( |
|
212 R_MUS_LIVE_SHARING_VIEW_NOTE_INVITE_ERROR ); |
|
213 } |
|
214 if ( ( ++iTriedInvitations < 2 ) && ( err == KErrArgument ) ) |
|
215 { |
|
216 MUS_LOG( "mus: [MUSUI ] CMusUiLiveSharingController::InviteL: iTriedInvitations < 2" ); |
|
217 iManualAddressTyped = ETrue; |
|
218 iResourceHandler->RequestKeypadL( ETrue ); |
|
219 iSendObserver.ManualAddressEntryL( *iRemoteSipAddressProposal ); |
|
220 return; |
|
221 } |
|
222 else |
|
223 { |
|
224 MUS_LOG( "mus: [MUSUI ] CMusUiLiveSharingController::InviteL: ++iTriedInvitations > 1" ); |
|
225 HandleExitL(); |
|
226 return; |
|
227 } |
|
228 } |
|
229 |
|
230 SetConnectionInitialized( ETrue ); |
|
231 |
|
232 ShowInvitingWaitDialogL(); |
|
233 |
|
234 |
|
235 MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::InviteL" ); |
|
236 } |
|
237 |
|
238 |
|
239 // ----------------------------------------------------------------------------- |
|
240 // |
|
241 // ----------------------------------------------------------------------------- |
|
242 // |
|
243 void CMusUiLiveSharingController::HandleSliderValueChangeL( TInt aNewLevel ) |
|
244 { |
|
245 MUS_LOG1( "mus: [MUSUI ] -> CMusUiLiveSharingController::HandleSliderValueChangeL(%d)", |
|
246 aNewLevel ) |
|
247 |
|
248 __ASSERT_ALWAYS( !ExitOccured(), User::Leave( KErrDied ) ); |
|
249 __ASSERT_ALWAYS( iConnectionEstablished, User::Leave( KErrNotReady ) ); |
|
250 |
|
251 if ( iToolbarZoomSelected ) |
|
252 { |
|
253 iSession->SetZoomL( aNewLevel ); |
|
254 iLiveObserver.SetZoomL( iSession->CurrentZoomL() ); |
|
255 } |
|
256 else |
|
257 { |
|
258 iSession->SetBrightnessL( aNewLevel ); |
|
259 iLiveObserver.SetBrightnessL( iSession->CurrentBrightnessL() ); |
|
260 } |
|
261 |
|
262 MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::HandleSliderValueChangeL" ) |
|
263 } |
|
264 |
|
265 |
|
266 |
|
267 // ----------------------------------------------------------------------------- |
|
268 // |
|
269 // ----------------------------------------------------------------------------- |
|
270 // |
|
271 void CMusUiLiveSharingController::OfferToolbarEventL( TInt aCommand ) |
|
272 { |
|
273 MUS_LOG1( "mus: [MUSUI ] -> CMusUiLiveSharingController::OfferToolbarEventL [%d]", |
|
274 aCommand ); |
|
275 |
|
276 iLiveObserver.SetZoomVisible( EFalse ); |
|
277 iLiveObserver.SetBrightnessVisible( EFalse ); |
|
278 |
|
279 switch ( aCommand ) |
|
280 { |
|
281 case EMusuiCmdToolbarPauseLive: |
|
282 { |
|
283 HandleCommandL( EMusuiCmdViewPause ); |
|
284 iSharingObserver.ReplaceToolbarCommand( EMusuiCmdToolbarPauseLive, |
|
285 EMusuiCmdToolbarUnPauseLive, |
|
286 ETrue ); |
|
287 break; |
|
288 } |
|
289 |
|
290 case EMusuiCmdToolbarUnPauseLive: |
|
291 { |
|
292 HandleCommandL( EMusuiCmdViewContinue ); |
|
293 iSharingObserver.ReplaceToolbarCommand( EMusuiCmdToolbarUnPauseLive, |
|
294 EMusuiCmdToolbarPauseLive, |
|
295 ETrue ); |
|
296 break; |
|
297 } |
|
298 case EMusuiCmdToolbarZoom: |
|
299 { |
|
300 iToolbarZoomSelected = !iToolbarZoomSelected; |
|
301 |
|
302 if ( iToolbarZoomSelected ) |
|
303 { |
|
304 iLiveObserver.SetZoomValues( iSession->MinZoomL(), |
|
305 iSession->MaxZoomL() ); |
|
306 iLiveObserver.SetZoomL( iSession->CurrentZoomL() ); |
|
307 } |
|
308 |
|
309 iLiveObserver.SetZoomVisible( iToolbarZoomSelected ); |
|
310 iSharingObserver.HighlightSelectedToolbarItem( EMusuiCmdToolbarZoom ); |
|
311 |
|
312 break; |
|
313 } |
|
314 case EMusuiCmdToolbarBrightness: |
|
315 { |
|
316 iToolbarBrightnessSelected = !iToolbarBrightnessSelected; |
|
317 |
|
318 if ( iToolbarBrightnessSelected ) |
|
319 { |
|
320 MUS_LOG1( "mus: [MUSUI ] CMusUiLiveSharingController::OfferToolbarEventL: Brightness %d", |
|
321 iSession->CurrentBrightnessL() ); |
|
322 |
|
323 iLiveObserver.SetBrightnessValues( iSession->MinBrightnessL(), |
|
324 iSession->MaxBrightnessL() ); |
|
325 |
|
326 iLiveObserver.SetBrightnessL( iSession->CurrentBrightnessL() ); |
|
327 } |
|
328 |
|
329 iLiveObserver.SetBrightnessVisible( iToolbarBrightnessSelected ); |
|
330 iSharingObserver.HighlightSelectedToolbarItem( EMusuiCmdToolbarBrightness ); |
|
331 |
|
332 break; |
|
333 } |
|
334 default: // Not live specific, let the base class handle |
|
335 { |
|
336 CMusUiEventController::OfferToolbarEventL( aCommand ); |
|
337 break; |
|
338 } |
|
339 } |
|
340 MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::OfferToolbarEventL" ); |
|
341 } |
|
342 |
|
343 |
|
344 // ----------------------------------------------------------------------------- |
|
345 // |
|
346 // ----------------------------------------------------------------------------- |
|
347 // |
|
348 void CMusUiLiveSharingController::HandleCommandL( TInt aCommand ) |
|
349 { |
|
350 MUS_LOG1( "mus: [MUSUI ] -> CMusUiLiveSharingController::HandleCommandL [%d]", |
|
351 aCommand ); |
|
352 |
|
353 __ASSERT_ALWAYS( !ExitOccured(), User::Leave( KErrDied ) ); |
|
354 |
|
355 switch ( aCommand ) |
|
356 { |
|
357 case EMusuiCmdViewPause: |
|
358 { |
|
359 PauseL(); |
|
360 iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconPause ); |
|
361 break; |
|
362 } |
|
363 case EMusuiCmdViewContinue: |
|
364 { |
|
365 PlayL(); |
|
366 break; |
|
367 } |
|
368 |
|
369 case EMusuiCmdViewShareVideo: |
|
370 { |
|
371 PauseL(); |
|
372 // TODO: Change to video sharing |
|
373 break; |
|
374 } |
|
375 case EMusuiCmdViewShareImage: |
|
376 { |
|
377 PauseL(); |
|
378 // TODO: Change to image sharing |
|
379 break; |
|
380 } |
|
381 |
|
382 case EMusuiCmdToolbarZoom: |
|
383 { |
|
384 iToolbarZoomSelected = ETrue; |
|
385 iToolbarBrightnessSelected = EFalse; |
|
386 iLiveObserver.SetZoomVisible( iToolbarZoomSelected ); |
|
387 iLiveObserver.SetZoomValues( iSession->MinZoomL(), |
|
388 iSession->MaxZoomL() ); |
|
389 iLiveObserver.SetZoomL( iSession->CurrentZoomL() ); |
|
390 break; |
|
391 } |
|
392 case EMusuiCmdViewMiddleSoftkeyOk: |
|
393 { |
|
394 HandleMiddleSoftkeyOkL(); |
|
395 break; |
|
396 } |
|
397 |
|
398 case EMusuiCmdViewZoom: |
|
399 { |
|
400 ZoomL(); |
|
401 break; |
|
402 } |
|
403 |
|
404 case EMusuiCmdViewZoomIn: |
|
405 { |
|
406 iLiveObserver.SetZoomVisible( MUS_NO_TOOLBAR ? iZoomSelected : iToolbarZoomSelected ); |
|
407 iSession->ZoomInL(); |
|
408 iLiveObserver.SetZoomL( iSession->CurrentZoomL() ); |
|
409 break; |
|
410 } |
|
411 case EMusuiCmdViewZoomOut: |
|
412 { |
|
413 iLiveObserver.SetZoomVisible( MUS_NO_TOOLBAR ? iZoomSelected : iToolbarZoomSelected ); |
|
414 iSession->ZoomOutL(); |
|
415 iLiveObserver.SetZoomL( iSession->CurrentZoomL() ); |
|
416 break; |
|
417 } |
|
418 |
|
419 case EMusuiCmdToolbarBrightness: |
|
420 { |
|
421 iToolbarZoomSelected = EFalse; |
|
422 iToolbarBrightnessSelected = ETrue; |
|
423 iLiveObserver.SetBrightnessVisible( iToolbarBrightnessSelected ); |
|
424 iLiveObserver.SetBrightnessValues( iSession->MinBrightnessL(), |
|
425 iSession->MaxBrightnessL() ); |
|
426 iLiveObserver.SetBrightnessL( iSession->CurrentBrightnessL() ); |
|
427 break; |
|
428 } |
|
429 case EMusuiCmdViewBrightness: |
|
430 { |
|
431 BrightnessL(); |
|
432 break; |
|
433 } |
|
434 |
|
435 case EMusuiCmdViewIncreaseBrightness: |
|
436 { |
|
437 iLiveObserver.SetBrightnessVisible( MUS_NO_TOOLBAR ? iBrightnessSelected : iToolbarBrightnessSelected ); |
|
438 iSession->IncreaseBrightnessL(); |
|
439 iLiveObserver.SetBrightnessL( iSession->CurrentBrightnessL() ); |
|
440 break; |
|
441 } |
|
442 case EMusuiCmdViewDecreaseBrightness: |
|
443 { |
|
444 iLiveObserver.SetBrightnessVisible( MUS_NO_TOOLBAR ? iBrightnessSelected : iToolbarBrightnessSelected ); |
|
445 iSession->DecreaseBrightnessL(); |
|
446 iLiveObserver.SetBrightnessL( iSession->CurrentBrightnessL() ); |
|
447 break; |
|
448 } |
|
449 |
|
450 case EMusuiCmdRecord: |
|
451 { |
|
452 // Show toolbar hidden while showing options menu |
|
453 iEventObserver.SetToolbarVisibility( ETrue ); |
|
454 |
|
455 if ( iDiskFull ) |
|
456 { |
|
457 DiskFull(); |
|
458 } |
|
459 else |
|
460 { |
|
461 iSession->RecordL( ETrue ); |
|
462 iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconRecord ); |
|
463 } |
|
464 break; |
|
465 } |
|
466 case EMusuiCmdStopRecording: |
|
467 { |
|
468 // Show toolbar hidden while showing options menu |
|
469 iEventObserver.SetToolbarVisibility( ETrue ); |
|
470 |
|
471 iSession->RecordL( EFalse ); |
|
472 iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconRecordNot ); |
|
473 break; |
|
474 } |
|
475 |
|
476 default: |
|
477 { |
|
478 // Try more general handling |
|
479 CMusUiEventController::HandleCommandL( aCommand ); |
|
480 break; |
|
481 } |
|
482 } |
|
483 MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::HandleCommandL" ); |
|
484 } |
|
485 |
|
486 |
|
487 // ----------------------------------------------------------------------------- |
|
488 // |
|
489 // ----------------------------------------------------------------------------- |
|
490 // |
|
491 void CMusUiLiveSharingController::LevelIndicatorDismissed() |
|
492 { |
|
493 MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::LevelIndicatorDismissed" ); |
|
494 if ( MUS_NO_TOOLBAR ) |
|
495 { |
|
496 iZoomSelected = EFalse; |
|
497 iBrightnessSelected = EFalse; |
|
498 TRAP_IGNORE( iSharingObserver.EnableMiddleSoftkeyL( IsLoudSpeakerEnabled() ? |
|
499 R_MUSUI_VIEW_OPS_MSK_IHF_OFF : |
|
500 R_MUSUI_VIEW_OPS_MSK_IHF_ON ) ); |
|
501 } |
|
502 else |
|
503 { |
|
504 if ( iToolbarZoomSelected ) |
|
505 { |
|
506 iToolbarZoomSelected = EFalse; |
|
507 if ( !AknLayoutUtils::PenEnabled() ) |
|
508 { |
|
509 TRAP_IGNORE( iSharingObserver.HighlightSelectedToolbarItem(EMusuiCmdToolbarZoom) ); |
|
510 } |
|
511 } |
|
512 else if( iToolbarBrightnessSelected ) |
|
513 { |
|
514 iToolbarBrightnessSelected = EFalse; |
|
515 if ( !AknLayoutUtils::PenEnabled() ) |
|
516 { |
|
517 TRAP_IGNORE( iSharingObserver.HighlightSelectedToolbarItem(EMusuiCmdToolbarBrightness) ); |
|
518 } |
|
519 } |
|
520 |
|
521 } |
|
522 |
|
523 MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::LevelIndicatorDismissed" ); |
|
524 } |
|
525 |
|
526 |
|
527 |
|
528 // ----------------------------------------------------------------------------- |
|
529 // |
|
530 // ----------------------------------------------------------------------------- |
|
531 // |
|
532 TMusUiNaviMediaDecorator CMusUiLiveSharingController::RecordIcon() |
|
533 { |
|
534 MUS_LOG( "mus: [MUSUI ] CMusUiLiveSharingController::RecordIcon" ); |
|
535 |
|
536 return (iSession->IsRecording() == EFalse) ? |
|
537 EMusUiNaviIconRecordNot : |
|
538 EMusUiNaviIconRecord; |
|
539 } |
|
540 |
|
541 |
|
542 // ----------------------------------------------------------------------------- |
|
543 // |
|
544 // ----------------------------------------------------------------------------- |
|
545 // |
|
546 TBool CMusUiLiveSharingController::IsBrightnessSupported() |
|
547 { |
|
548 if ( !iSession ) |
|
549 { |
|
550 return EFalse; |
|
551 } |
|
552 TRAPD( error, iSession->SetBrightnessL( iSession->CurrentBrightnessL() ) ) |
|
553 return ( error == KErrNotSupported ) ? EFalse : ETrue; |
|
554 } |
|
555 |
|
556 |
|
557 // ----------------------------------------------------------------------------- |
|
558 // |
|
559 // ----------------------------------------------------------------------------- |
|
560 // |
|
561 TBool CMusUiLiveSharingController::IsDiskFull() |
|
562 { |
|
563 return iDiskFull; |
|
564 } |
|
565 |
|
566 |
|
567 // ----------------------------------------------------------------------------- |
|
568 // |
|
569 // ----------------------------------------------------------------------------- |
|
570 // |
|
571 TBool CMusUiLiveSharingController::ToolbarZoomSelected() |
|
572 { |
|
573 return iToolbarZoomSelected; |
|
574 } |
|
575 |
|
576 |
|
577 // ----------------------------------------------------------------------------- |
|
578 // |
|
579 // ----------------------------------------------------------------------------- |
|
580 // |
|
581 TBool CMusUiLiveSharingController::ToolbarBrightnessSelected() |
|
582 { |
|
583 return iToolbarBrightnessSelected; |
|
584 } |
|
585 |
|
586 // ----------------------------------------------------------------------------- |
|
587 // |
|
588 // ----------------------------------------------------------------------------- |
|
589 // |
|
590 TBool CMusUiLiveSharingController::ZoomSelected() |
|
591 { |
|
592 return iZoomSelected; |
|
593 } |
|
594 |
|
595 |
|
596 // ----------------------------------------------------------------------------- |
|
597 // |
|
598 // ----------------------------------------------------------------------------- |
|
599 // |
|
600 TBool CMusUiLiveSharingController::BrightnessSelected() |
|
601 { |
|
602 return iBrightnessSelected; |
|
603 } |
|
604 |
|
605 |
|
606 // ----------------------------------------------------------------------------- |
|
607 // |
|
608 // ----------------------------------------------------------------------------- |
|
609 // |
|
610 void CMusUiLiveSharingController::ZoomL() |
|
611 { |
|
612 MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::ZoomL" ); |
|
613 iZoomSelected = ETrue; |
|
614 iLiveObserver.SetZoomValues( iSession->MinZoomL(), iSession->MaxZoomL() ); |
|
615 iLiveObserver.SetZoomL( iSession->CurrentZoomL() ); |
|
616 iLiveObserver.SetZoomVisible( ETrue ); |
|
617 |
|
618 if ( MUS_NO_TOOLBAR ) |
|
619 { |
|
620 iSharingObserver.EnableMiddleSoftkeyL( R_MUSUI_VIEW_MSK_OK ); |
|
621 } |
|
622 MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::ZoomL" ); |
|
623 } |
|
624 |
|
625 |
|
626 // ----------------------------------------------------------------------------- |
|
627 // |
|
628 // ----------------------------------------------------------------------------- |
|
629 // |
|
630 void CMusUiLiveSharingController::ResetToolbarSelected() |
|
631 { |
|
632 iToolbarZoomSelected = EFalse; |
|
633 iToolbarBrightnessSelected = EFalse; |
|
634 } |
|
635 |
|
636 |
|
637 // ----------------------------------------------------------------------------- |
|
638 // |
|
639 // ----------------------------------------------------------------------------- |
|
640 // |
|
641 void CMusUiLiveSharingController::BrightnessL() |
|
642 { |
|
643 MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::BrightnessL" ); |
|
644 iBrightnessSelected = ETrue; |
|
645 iLiveObserver.SetBrightnessValues( iSession->MinBrightnessL(), |
|
646 iSession->MaxBrightnessL() ); |
|
647 iLiveObserver.SetBrightnessL( iSession->CurrentBrightnessL() ); |
|
648 iLiveObserver.SetBrightnessVisible( ETrue ); |
|
649 |
|
650 if ( MUS_NO_TOOLBAR ) |
|
651 { |
|
652 iSharingObserver.EnableMiddleSoftkeyL( R_MUSUI_VIEW_MSK_OK ); |
|
653 } |
|
654 MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::BrightnessL" ); |
|
655 } |
|
656 |
|
657 |
|
658 // ----------------------------------------------------------------------------- |
|
659 // |
|
660 // ----------------------------------------------------------------------------- |
|
661 // |
|
662 void CMusUiLiveSharingController::HandleMiddleSoftkeyOkL() |
|
663 { |
|
664 MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::HandleMiddleSoftkeyOkL" ); |
|
665 |
|
666 if ( iZoomSelected ) |
|
667 { |
|
668 iZoomSelected = EFalse; |
|
669 iLiveObserver.SetZoomVisible( EFalse ); |
|
670 } |
|
671 else if ( iBrightnessSelected ) |
|
672 { |
|
673 iZoomSelected = EFalse; |
|
674 iLiveObserver.SetBrightnessVisible( EFalse ); |
|
675 } |
|
676 |
|
677 iSharingObserver.EnableMiddleSoftkeyL( IsLoudSpeakerEnabled() ? |
|
678 R_MUSUI_VIEW_OPS_MSK_IHF_OFF : |
|
679 R_MUSUI_VIEW_OPS_MSK_IHF_ON ); |
|
680 |
|
681 MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::HandleMiddleSoftkeyOkL" ); |
|
682 } |
|
683 |
|
684 // ----------------------------------------------------------------------------- |
|
685 // |
|
686 // ----------------------------------------------------------------------------- |
|
687 // |
|
688 void CMusUiLiveSharingController::ZoomInL() |
|
689 { |
|
690 MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::ZoomInL" ); |
|
691 iSession->ZoomInL(); |
|
692 MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::ZoomInL" ); |
|
693 } |
|
694 |
|
695 |
|
696 // ----------------------------------------------------------------------------- |
|
697 // |
|
698 // ----------------------------------------------------------------------------- |
|
699 // |
|
700 void CMusUiLiveSharingController::ZoomOutL() |
|
701 { |
|
702 MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::ZoomOutL" ); |
|
703 iSession->ZoomOutL(); |
|
704 MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::ZoomOutL" ); |
|
705 } |
|
706 |
|
707 |
|
708 // ----------------------------------------------------------------------------- |
|
709 // |
|
710 // ----------------------------------------------------------------------------- |
|
711 // |
|
712 void CMusUiLiveSharingController::IncreaseBrightnessL() |
|
713 { |
|
714 MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::IncreaseBrightnessL" ); |
|
715 iSession->IncreaseBrightnessL(); |
|
716 MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::IncreaseBrightnessL" ); |
|
717 } |
|
718 |
|
719 |
|
720 // ----------------------------------------------------------------------------- |
|
721 // |
|
722 // ----------------------------------------------------------------------------- |
|
723 // |
|
724 void CMusUiLiveSharingController::DecreaseBrightnessL() |
|
725 { |
|
726 MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::DecreaseBrightnessL" ); |
|
727 iSession->DecreaseBrightnessL(); |
|
728 MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::DecreaseBrightnessL" ); |
|
729 } |
|
730 |
|
731 |
|
732 // ----------------------------------------------------------------------------- |
|
733 // |
|
734 // ----------------------------------------------------------------------------- |
|
735 // |
|
736 void CMusUiLiveSharingController::DiskFull() |
|
737 { |
|
738 // Update the icon: |
|
739 TRAP_IGNORE( iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconRecordNot ); |
|
740 DismissWaitDialog(); |
|
741 // Saving ends when disk is full but streaming continues (user is notified) |
|
742 TRAP_IGNORE( MusUiDialogUtil::ShowGlobalErrorDialogL( R_MUS_VIEW_NOTE_MEMORY_LOW ) ) ); |
|
743 iDiskFull = ETrue; |
|
744 } |
|
745 |
|
746 |
|
747 // ----------------------------------------------------------------------------- |
|
748 // |
|
749 // ----------------------------------------------------------------------------- |
|
750 // |
|
751 void CMusUiLiveSharingController::SessionEstablished() |
|
752 { |
|
753 MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::SessionEstablished" ); |
|
754 |
|
755 TRAPD( error, iResourceHandler->RequestCameraL( ETrue ) ); |
|
756 if ( error != KErrNone ) |
|
757 { |
|
758 MUS_LOG1( "mus: [MUSUI ] RequestCameraL leave code: %d", error ) |
|
759 } |
|
760 |
|
761 CMusUiSendController::SessionEstablished(); // Base class handling |
|
762 |
|
763 iVideoToBeSaved = ETrue; |
|
764 |
|
765 MusSettingsKeys::TAutoRecord autoRecordValue = EAutoRecordOff; |
|
766 TRAPD ( errAutoRecord, autoRecordValue = |
|
767 MultimediaSharingSettings::AutoRecordSettingL() ); |
|
768 if ( errAutoRecord != KErrNone ) |
|
769 { |
|
770 MUS_LOG1( "mus: [MUSUI ] AutoRecordSettingL leave code: %d", errAutoRecord ) |
|
771 HandleError( errAutoRecord ); |
|
772 } |
|
773 |
|
774 if ( autoRecordValue != EAutoRecordOff ) |
|
775 { |
|
776 TRAPD ( errRecordL, iSession->RecordL( ETrue ) ); |
|
777 if ( errRecordL != KErrNone ) |
|
778 { |
|
779 MUS_LOG1( "mus: [MUSUI ] RecordL leave code: %d", errRecordL ) |
|
780 HandleError( errRecordL ); |
|
781 } |
|
782 } |
|
783 |
|
784 TRAP_IGNORE( iEventObserver.ShowNaviPaneIconL( RecordIcon() ) ) |
|
785 |
|
786 MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::SessionEstablished" ); |
|
787 } |
|
788 |
|
789 |
|
790 // ----------------------------------------------------------------------------- |
|
791 // |
|
792 // ----------------------------------------------------------------------------- |
|
793 // |
|
794 void CMusUiLiveSharingController::SessionTerminated() |
|
795 { |
|
796 MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::SessionTerminated" ); |
|
797 if ( !ExitOccured() ) |
|
798 { |
|
799 DismissWaitDialog(); |
|
800 |
|
801 TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); |
|
802 } |
|
803 MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::SessionTerminated" ); |
|
804 } |
|
805 |
|
806 |
|
807 // ----------------------------------------------------------------------------- |
|
808 // |
|
809 // ----------------------------------------------------------------------------- |
|
810 // |
|
811 void CMusUiLiveSharingController::SessionConnectionLost() |
|
812 { |
|
813 MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::SessionConnectionLost" ); |
|
814 DismissWaitDialog(); |
|
815 if ( !ExitOccured() ) |
|
816 { |
|
817 TRAP_IGNORE( MusUiDialogUtil::ShowGlobalErrorDialogL( |
|
818 R_MUS_LIVE_SHARING_VIEW_NOTE_CONNECTION_LOST ) ); |
|
819 } |
|
820 |
|
821 TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); |
|
822 |
|
823 MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::SessionConnectionLost" ); |
|
824 } |
|
825 |
|
826 |
|
827 // ----------------------------------------------------------------------------- |
|
828 // |
|
829 // ----------------------------------------------------------------------------- |
|
830 // |
|
831 void CMusUiLiveSharingController::SessionFailed() |
|
832 { |
|
833 MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::SessionFailed" ); |
|
834 if ( !ExitOccured() ) |
|
835 { |
|
836 DismissWaitDialog(); |
|
837 |
|
838 TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); |
|
839 } |
|
840 |
|
841 MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::SessionFailed" ); |
|
842 } |
|
843 |
|
844 |
|
845 // ----------------------------------------------------------------------------- |
|
846 // |
|
847 // ----------------------------------------------------------------------------- |
|
848 // |
|
849 void CMusUiLiveSharingController::StreamIdle() |
|
850 { |
|
851 MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::StreamIdle" ); |
|
852 DismissWaitDialog(); |
|
853 MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::StreamIdle" ); |
|
854 } |
|
855 |
|
856 |
|
857 // ----------------------------------------------------------------------------- |
|
858 // |
|
859 // ----------------------------------------------------------------------------- |
|
860 // |
|
861 void CMusUiLiveSharingController::StreamStreaming() |
|
862 { |
|
863 MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::StreamStreaming" ); |
|
864 //DismissWaitDialog(); |
|
865 MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::StreamStreaming" ); |
|
866 } |
|
867 |
|
868 |
|
869 // ----------------------------------------------------------------------------- |
|
870 // |
|
871 // ----------------------------------------------------------------------------- |
|
872 // |
|
873 void CMusUiLiveSharingController::SessionTimeChanged( |
|
874 const TTimeIntervalSeconds& aSeconds ) |
|
875 { |
|
876 if ( aSeconds.Int() > -1 ) |
|
877 { |
|
878 iSharingObserver.UpdateSessionTime( SessionTimeFormatted( aSeconds ) ); |
|
879 } |
|
880 } |
|
881 |
|
882 |
|
883 // ----------------------------------------------------------------------------- |
|
884 // |
|
885 // ----------------------------------------------------------------------------- |
|
886 // |
|
887 void CMusUiLiveSharingController::InactivityTimeout() |
|
888 { |
|
889 MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::InactivityTimeout" ); |
|
890 DismissWaitDialog(); |
|
891 if ( !ExitOccured() ) |
|
892 { |
|
893 TRAP_IGNORE( MusUiDialogUtil::ShowGlobalErrorDialogL( |
|
894 R_MUS_LIVE_SHARING_VIEW_NOTE_SERVICE_N_A ) ); |
|
895 } |
|
896 |
|
897 TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); |
|
898 |
|
899 MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::InactivityTimeout" ); |
|
900 } |
|
901 |
|
902 |
|
903 |
|
904 |
|
905 |
|
906 // End of file |
|
907 |