1 /* |
|
2 * Copyright (c) 2007-2010 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: Video pre-capture view class for Camera application* |
|
15 */ |
|
16 |
|
17 |
|
18 // INCLUDE FILES |
|
19 |
|
20 |
|
21 #include "CamUtility.h" |
|
22 #include "CamAppUiBase.h" |
|
23 #include "CamAppController.h" |
|
24 #include "CamVideoPreCaptureView.h" |
|
25 #include "CamLogger.h" |
|
26 #include "CamContainerBase.h" |
|
27 #include "CamAppUi.h" |
|
28 #include <eikmenub.h> |
|
29 #include <eikapp.h> |
|
30 #include <avkon.rsg> |
|
31 #include <CaeEngine.h> |
|
32 #include <akntoolbar.h> |
|
33 #include <akntoolbarextension.h> |
|
34 #include <gulicon.h> |
|
35 #include <AknIconUtils.h> |
|
36 #include <aknbutton.h> |
|
37 #include <StringLoader.h> |
|
38 #include <AknsUtils.h> |
|
39 #include <AknsConstants.h> |
|
40 #include <cameraapp.mbg> |
|
41 #include "CamCaptureSetupMenu.h" |
|
42 #include "CamPanic.h" |
|
43 #include "CamSidePane.h" |
|
44 |
|
45 #include "CamShootingModeContainer.h" |
|
46 #include "CamVideoPreCaptureContainer.h" |
|
47 #include "Cam.hrh" |
|
48 #include "CamAppUid.h" |
|
49 #include <csxhelp/lcam.hlp.hrh> |
|
50 #include <cameraapp.rsg> |
|
51 #include <vgacamsettings.rsg> |
|
52 #include "CamUtility.h" |
|
53 #include "camactivepalettehandler.h" |
|
54 #include "CameraUiConfigManager.h" |
|
55 #include "CamLocalViewIds.h" |
|
56 #include "OstTraceDefinitions.h" |
|
57 #ifdef OST_TRACE_COMPILER_IN_USE |
|
58 #include "CamVideoPreCaptureViewTraces.h" |
|
59 #endif |
|
60 #include "CamTimer.h" |
|
61 |
|
62 const TInt KHdmiTimeout = 1000000; // 1 sec |
|
63 |
|
64 |
|
65 // ========================= MEMBER FUNCTIONS ================================ |
|
66 // --------------------------------------------------------------------------- |
|
67 // CCamVideoPreCaptureView::NewLC |
|
68 // Symbian OS two-phased constructor |
|
69 // --------------------------------------------------------------------------- |
|
70 // |
|
71 CCamVideoPreCaptureView* CCamVideoPreCaptureView::NewLC( CCamAppController& aController ) |
|
72 { |
|
73 CCamVideoPreCaptureView* self = |
|
74 new( ELeave ) CCamVideoPreCaptureView( aController ); |
|
75 |
|
76 CleanupStack::PushL( self ); |
|
77 self->ConstructL(); |
|
78 return self; |
|
79 } |
|
80 |
|
81 // --------------------------------------------------------------------------- |
|
82 // CCamVideoPreCaptureView destructor |
|
83 // |
|
84 // --------------------------------------------------------------------------- |
|
85 // |
|
86 CCamVideoPreCaptureView::~CCamVideoPreCaptureView() |
|
87 { |
|
88 if( iHdmiTimer ) |
|
89 { |
|
90 delete iHdmiTimer; |
|
91 iHdmiTimer = NULL; |
|
92 } |
|
93 } |
|
94 |
|
95 // --------------------------------------------------------------------------- |
|
96 // CCamVideoPreCaptureView::Id |
|
97 // Returns UID of view |
|
98 // --------------------------------------------------------------------------- |
|
99 // |
|
100 TUid CCamVideoPreCaptureView::Id() const |
|
101 { |
|
102 return TUid::Uid( ECamViewIdVideoPreCapture ); |
|
103 } |
|
104 |
|
105 // --------------------------------------------------------------------------- |
|
106 // CCamVideoPreCaptureView::DoDeactivate |
|
107 // Deactivate this view |
|
108 // --------------------------------------------------------------------------- |
|
109 // |
|
110 void CCamVideoPreCaptureView::DoDeactivate() |
|
111 { |
|
112 OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMVIDEOPRECAPTUREVIEW_DODEACTIVATE, "e_CCamVideoPreCaptureView_DoDeactivate 1" ); |
|
113 PERF_EVENT_START_L2( EPerfEventVideoPreCaptureViewDeactivation ); |
|
114 CCamPreCaptureViewBase::DoDeactivate(); |
|
115 PERF_EVENT_END_L2( EPerfEventVideoPreCaptureViewDeactivation ); |
|
116 OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMVIDEOPRECAPTUREVIEW_DODEACTIVATE, "e_CCamVideoPreCaptureView_DoDeactivate 0" ); |
|
117 } |
|
118 |
|
119 // ----------------------------------------------------------------------------- |
|
120 // CCamVideoPreCaptureView::HandleCommandL |
|
121 // Handle commands |
|
122 // ----------------------------------------------------------------------------- |
|
123 // |
|
124 void |
|
125 CCamVideoPreCaptureView::HandleCommandL( TInt aCommand ) |
|
126 { |
|
127 PRINT( _L("Camera => CCamVideoPreCaptureView::HandleCommandL") ); |
|
128 // check our current operation state |
|
129 TCamCaptureOperation operation = iController.CurrentVideoOperation(); |
|
130 CCamAppUi* appUi = static_cast<CCamAppUi*>( iEikonEnv->AppUi() ); |
|
131 TCamOrientation orientation = appUi->CamOrientation(); |
|
132 switch ( aCommand ) |
|
133 { |
|
134 case ECamMSKCmdSelect: |
|
135 case ECamMSKCmdAppRecord: |
|
136 { |
|
137 if( orientation == ECamOrientationCamcorder || |
|
138 orientation == ECamOrientationCamcorderLeft || |
|
139 orientation == ECamOrientationPortrait ) |
|
140 { |
|
141 if ( !StartMskCaptureL() ) |
|
142 { |
|
143 // If in the Landscape mode, MSK event is mapped |
|
144 // like a normal selection key so that AP items |
|
145 // are selected and respective setting pages are launched |
|
146 TKeyEvent aKeyEvent; |
|
147 aKeyEvent.iCode = aKeyEvent.iRepeats = aKeyEvent.iModifiers = 0; |
|
148 aKeyEvent.iScanCode = EStdKeyDevice3; |
|
149 static_cast<CCamVideoPreCaptureContainer*> |
|
150 ( Container() )->OfferKeyEventL( aKeyEvent, EEventKey ); |
|
151 } |
|
152 } |
|
153 else if ( aCommand == ECamMSKCmdAppRecord ) |
|
154 // if the Camera in the Portrait mode |
|
155 // MSK event is handled like a capture key |
|
156 { |
|
157 if( iController.IntegerSettingValue( ECamSettingItemStopRecordingInHdmiMode) && |
|
158 iController.IsHdmiCableConnected() ) |
|
159 { |
|
160 appUi->HandleHdmiEventL( ECamHdmiCableConnectedBeforeRecording ); |
|
161 } |
|
162 else if ( iController.IsViewFinding() && appUi->CheckMemoryL() ) |
|
163 { |
|
164 iController.StartVideoRecordingL(); |
|
165 // fixed toolbar is used only with touch devices |
|
166 if ( iController.IsTouchScreenSupported() ) |
|
167 { |
|
168 CAknToolbar* fixedToolbar = Toolbar(); |
|
169 if ( fixedToolbar ) |
|
170 { |
|
171 fixedToolbar->SetToolbarVisibility( EFalse ); |
|
172 } |
|
173 } |
|
174 } |
|
175 } |
|
176 break; |
|
177 } |
|
178 case ECamCmdRecord: |
|
179 { |
|
180 TInt callType( EPSCTsyCallTypeUninitialized ); |
|
181 RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallType, callType ); |
|
182 if( iController.IsHdmiCableConnected() ) |
|
183 { |
|
184 appUi->HandleHdmiEventL( ECamHdmiCableConnectedBeforeRecording ); |
|
185 } |
|
186 else if ( callType != EPSCTsyCallTypeH324Multimedia && iController.IsViewFinding() && appUi->CheckMemoryL() ) |
|
187 { |
|
188 SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); |
|
189 appUi->SetLensCoverExit( EFalse ); |
|
190 iController.StartVideoRecordingL(); |
|
191 // fixed toolbar is used only with touch devices |
|
192 if ( iController.IsTouchScreenSupported() ) |
|
193 { |
|
194 CAknToolbar* fixedToolbar = Toolbar(); |
|
195 if ( fixedToolbar ) |
|
196 { |
|
197 fixedToolbar->SetToolbarVisibility( EFalse ); |
|
198 } |
|
199 } |
|
200 } |
|
201 break; |
|
202 } |
|
203 |
|
204 case EAknSoftkeySelect: |
|
205 { |
|
206 switch( operation ) |
|
207 { |
|
208 // ------------------------- |
|
209 case ECamNoOperation: |
|
210 { |
|
211 if ( !iController.VideoRecordPending() ) |
|
212 { |
|
213 CCamPreCaptureViewBase::HandleCommandL( aCommand ); |
|
214 } |
|
215 break; |
|
216 } |
|
217 // ------------------------- |
|
218 // ...Otherwise, if we are in video recording or paused mode |
|
219 // ...then stop the recording. |
|
220 case ECamCapturing: |
|
221 case ECamPaused: |
|
222 { |
|
223 iController.StopVideoRecording(); |
|
224 break; |
|
225 } |
|
226 // ------------------------- |
|
227 default: |
|
228 break; |
|
229 // ------------------------- |
|
230 } |
|
231 break; |
|
232 } |
|
233 // --------------------------------------------------- |
|
234 case ECamCmdPause: |
|
235 { |
|
236 iController.PauseVideoRecording(); |
|
237 break; |
|
238 } |
|
239 // --------------------------------------------------- |
|
240 case ECamCmdContinue: |
|
241 { |
|
242 iController.ContinueVideoRecording(); |
|
243 break; |
|
244 } |
|
245 // --------------------------------------------------- |
|
246 case ECamCmdShootSetup: |
|
247 { |
|
248 // If currently recording or paused recording then don't |
|
249 // popup the capture setup menu. |
|
250 if ( ECamPaused == operation |
|
251 || ECamCapturing == operation ) |
|
252 { |
|
253 return; |
|
254 } |
|
255 // Otherwise popup the capture setup menu |
|
256 else |
|
257 { |
|
258 CCamPreCaptureViewBase::HandleCommandL( aCommand ); |
|
259 } |
|
260 break; |
|
261 } |
|
262 // --------------------------------------------------- |
|
263 case ECamCmdGoToStandby: |
|
264 { |
|
265 PRINT( _L("Camera <> CCamVideoPreCaptureView::HandleCommandL: case ECamCmdGoToStandby") ); |
|
266 |
|
267 //PRINT1( _L("Camera => CCamVideoPreCaptureView::HandleCommandL standby error (%d)"), iStandbyError) |
|
268 //SwitchToStandbyModeL( ECamViewIdVideoPreCapture, iStandbyError ); |
|
269 SwitchToStandbyModeL( ECamViewIdVideoPreCapture, appUi->StandbyStatus() ); |
|
270 break; |
|
271 } |
|
272 // --------------------------------------------------- |
|
273 case ECamCmdExitStandby: |
|
274 { |
|
275 PRINT( _L("Camera <> CCamVideoPreCaptureView::HandleCommandL: case ECamCmdExitStandby") ); |
|
276 ExitStandbyModeL(); |
|
277 UpdateToolbarIconsL(); |
|
278 break; |
|
279 } |
|
280 // --------------------------------------------------- |
|
281 case ECamCmdMute: |
|
282 { |
|
283 MuteEmbeddedAudioL( ETrue ); |
|
284 break; |
|
285 } |
|
286 // --------------------------------------------------- |
|
287 case ECamCmdUnmute: |
|
288 { |
|
289 MuteEmbeddedAudioL( EFalse ); |
|
290 break; |
|
291 } |
|
292 // --------------------------------------------------- |
|
293 case ECamCmdStop: |
|
294 { |
|
295 CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() ); |
|
296 appUi->EndCapture(); |
|
297 break; |
|
298 } |
|
299 // --------------------------------------------------- |
|
300 case ECamCmdToggleVideoFlash: |
|
301 { |
|
302 if ( iController.UiConfigManagerPtr()->IsVideoLightSupported() ) |
|
303 { |
|
304 TCamFlashId flash = static_cast< TCamFlashId > |
|
305 ( iController.IntegerSettingValue( ECamSettingItemDynamicVideoFlash ) ); |
|
306 if( flash == ECamFlashForced ) |
|
307 { |
|
308 flash = ECamFlashOff; |
|
309 } |
|
310 else |
|
311 { |
|
312 flash = ECamFlashForced; |
|
313 } |
|
314 iController.SetIntegerSettingValueL(ECamSettingItemDynamicVideoFlash, flash); |
|
315 |
|
316 CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() ); |
|
317 if ( appUi && |
|
318 appUi->APHandler() && |
|
319 ( appUi->CamOrientation() == ECamOrientationCamcorder || appUi->CamOrientation() == ECamOrientationCamcorderLeft ) ) |
|
320 { |
|
321 appUi->APHandler()->UpdateActivePaletteL(); |
|
322 } |
|
323 } |
|
324 UpdateToolbarIconsL(); |
|
325 break; |
|
326 } |
|
327 // --------------------------------------------------- |
|
328 default: |
|
329 { |
|
330 CCamPreCaptureViewBase::HandleCommandL( aCommand ); |
|
331 break; |
|
332 } |
|
333 // --------------------------------------------------- |
|
334 } |
|
335 |
|
336 PRINT( _L("Camera <= CCamVideoPreCaptureView::HandleCommandL") ); |
|
337 } |
|
338 |
|
339 // ----------------------------------------------------------------------------- |
|
340 // CCamVideoPreCaptureView::HandleForegroundEventL |
|
341 // Handle foreground event |
|
342 // ----------------------------------------------------------------------------- |
|
343 // |
|
344 void |
|
345 CCamVideoPreCaptureView::HandleForegroundEventL( TBool aForeground ) |
|
346 { |
|
347 PRINT1( _L( "Camera => CCamVideoPreCaptureView::HandleForegroundEventL %d" ), aForeground ); |
|
348 |
|
349 CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() ); |
|
350 |
|
351 // ------------------------------------------------------- |
|
352 // reset menu and cba as appropriate |
|
353 if( aForeground ) |
|
354 { |
|
355 // ignore event if received in postcapture or if uiorientationoverride |
|
356 // is supported and going to stillmode |
|
357 if ( ECamViewStatePostCapture == appUi->CurrentViewState() || |
|
358 ( iController.UiConfigManagerPtr() && |
|
359 iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() && |
|
360 appUi->TargetMode() == ECamControllerImage ) ) |
|
361 { |
|
362 return; |
|
363 } |
|
364 |
|
365 if ( appUi->IsInPretendExit() ) |
|
366 { |
|
367 // The view can get a foreground event while the application is |
|
368 // actually in a pretend exit situation. This occurs when the view switch |
|
369 // was called before the exit event, but didn't complete until after the |
|
370 // exit event. In this case the view should not register an interest in |
|
371 // the engine as the application is really in the background and the resources |
|
372 // need to be released |
|
373 PRINT( _L( "Camera <= CCamVideoPreCaptureView::HandleForegroundEventL, in pretend exit" ) ); |
|
374 return; |
|
375 } |
|
376 // if foreground event is received while in videocall, go to standby with error |
|
377 if ( iController.InVideocallOrRinging() && ECamNoOperation == iController.CurrentOperation() ) |
|
378 { |
|
379 ExitAllModesL(); |
|
380 appUi->SetStandbyStatus( KErrInUse ); |
|
381 appUi->HandleCommandL( ECamCmdGoToStandby ); |
|
382 SetTitlePaneTextL(); |
|
383 return; |
|
384 } |
|
385 |
|
386 // make sure CBA is correct |
|
387 UpdateCbaL(); |
|
388 |
|
389 // check for silent profile whenever we come to foreground, we dont need it here, |
|
390 // but we keep track of this in appcontroller. |
|
391 iController.IsProfileSilent(); |
|
392 |
|
393 // set embedded flag here |
|
394 iEmbedded = appUi->IsEmbedded(); |
|
395 PRINT1( _L("Camera <> CCamVideoPreCaptureView::HandleForegroundEventL - iEmbedded:%d"), iEmbedded ); |
|
396 |
|
397 // update menu bar as required |
|
398 SetMenuBar(); |
|
399 |
|
400 // if video is currently saving, it can be in either of the states: |
|
401 // ECamVideoRecordInProgress orECamVideoRecordPaused |
|
402 // but the recording has already been stopped |
|
403 if ( iController.CurrentlySavingVideo() ) |
|
404 { |
|
405 UpdateCbaL(); |
|
406 // if the app was behind an eikon server window then the resources |
|
407 // were not released. |
|
408 if ( iContinueInBackground ) |
|
409 { |
|
410 iContinueInBackground = EFalse; |
|
411 PRINT( _L( "Camera <= CCamVideoPreCaptureView::HandleForegroundEvent, returned behind notification" ) ); |
|
412 return; |
|
413 } |
|
414 |
|
415 // Register that we want to use the engine |
|
416 IncrementCameraUsers(); |
|
417 PRINT( _L( "Camera <= CCamVideoPreCaptureView::HandleForegroundEvent, waiting for postcapture" ) ); |
|
418 return; |
|
419 } |
|
420 |
|
421 } |
|
422 // ------------------------------------------------------- |
|
423 // if going to the background, stop any current video recording |
|
424 // unless already saving or it is only an eikon server window |
|
425 else |
|
426 { |
|
427 TCamCaptureOperation operation( iController.CurrentVideoOperation() ); |
|
428 |
|
429 PRINT1( _L("Camera <> CCamVideoPreCaptureView::HandleForegroundEventL - operation=%d"), operation ); |
|
430 if( !iController.CurrentlySavingVideo() && |
|
431 ( ( ECamCapturing == operation || ECamPaused == operation ) |
|
432 && appUi->AppInBackground( EFalse ) |
|
433 || ( iController.UiConfigManagerPtr()->IsKeyLockWatcherSupported() && iController.IsKeyLockOn() ) ) ) |
|
434 { |
|
435 PRINT( _L("Camera <> CCamVideoPreCaptureView::HandleForegroundEventL stopping video") ); |
|
436 // If the video stops for an active call then inform the controller |
|
437 // this info is needed so that the stop tone isn't played |
|
438 if ( appUi->ForegroundAppIsPhoneApp() ) |
|
439 { |
|
440 PRINT( _L("Camera <> CCamVideoPreCaptureView::HandleForegroundEventL SetVideoStoppedForPhoneApp") ); |
|
441 iController.SetVideoStoppedForPhoneApp( ETrue ); |
|
442 } |
|
443 |
|
444 // If AknCapServer has NOT got foreground, (which would possibly |
|
445 // indicate a "charging" note) stop video recording |
|
446 iController.StopVideoRecording(); |
|
447 // reset the stopped for call flag |
|
448 iController.SetVideoStoppedForPhoneApp( EFalse ); |
|
449 } |
|
450 |
|
451 /* |
|
452 const TInt KWindowGroupId( iCoeEnv->WsSession().GetFocusWindowGroup() ); |
|
453 TCamCaptureOperation operation( iController.CurrentVideoOperation() ); |
|
454 |
|
455 if ( KWindowGroupId != iEikonServerWindowGroupId |
|
456 && KWindowGroupId != iBTServerWindowGroupId |
|
457 && ( ECamCapturing == operation |
|
458 || ECamPaused == operation ) ) |
|
459 { |
|
460 if ( !CamUtility::IdMatchesName( KWindowGroupId, KAknCapServer ) ) |
|
461 { |
|
462 // If the video stops for an active call then inform the controller |
|
463 // this info is needed so that the stop tone isn't played |
|
464 if ( appUi->ForegroundAppIsPhoneApp() ) |
|
465 { |
|
466 iController.SetVideoStoppedForPhoneApp( ETrue ); |
|
467 } |
|
468 |
|
469 // If AknCapServer has NOT got foreground, (which would possibly |
|
470 // indicate a "charging" note) stop video recording |
|
471 iController.StopVideoRecording(); |
|
472 // reset the stopped for call flag |
|
473 iController.SetVideoStoppedForPhoneApp( EFalse ); |
|
474 } |
|
475 } |
|
476 */ |
|
477 } |
|
478 // ------------------------------------------------------- |
|
479 |
|
480 CCamPreCaptureViewBase::HandleForegroundEventL( aForeground ); |
|
481 |
|
482 PRINT( _L( "Camera <= CCamVideoPreCaptureView::HandleForegroundEventL" ) ); |
|
483 } |
|
484 |
|
485 // ----------------------------------------------------------------------------- |
|
486 // CCamVideoPreCaptureView::HandleFocusLossL |
|
487 // Handle change of focus |
|
488 // ----------------------------------------------------------------------------- |
|
489 // |
|
490 void CCamVideoPreCaptureView::HandleFocusLossL() |
|
491 { |
|
492 PRINT( _L( "Camera => CCamVideoPreCaptureView::HandleFocusLossL" ) ); |
|
493 // if the application was already in the background, but behind an |
|
494 // eikon server window, then handle backgrounding properly now. |
|
495 // Otherwise the backgrounding will be handled in the normal |
|
496 // HandleForeground() method. |
|
497 if ( iContinueInBackground ) |
|
498 { |
|
499 const TCamCaptureOperation operation( iController.CurrentOperation() ); |
|
500 if ( ECamCapturing == operation |
|
501 || ECamPaused == operation ) |
|
502 { |
|
503 iController.StopVideoRecording(); |
|
504 } |
|
505 } |
|
506 CCamPreCaptureViewBase::HandleFocusLossL(); |
|
507 PRINT( _L( "Camera <= CCamVideoPreCaptureView::HandleFocusLossL" ) ); |
|
508 } |
|
509 |
|
510 // ----------------------------------------------------------------------------- |
|
511 // CCamVideoPreCaptureView::HandleControllerEventL |
|
512 // Handle controller events |
|
513 // ----------------------------------------------------------------------------- |
|
514 // |
|
515 void CCamVideoPreCaptureView::HandleControllerEventL( TCamControllerEvent aEvent, |
|
516 TInt aError ) |
|
517 { |
|
518 PRINT2( _L("Camera => CCamVideoPreCaptureView::HandleControllerEventL event (%d) error (%d)"), aEvent, aError ); |
|
519 switch( aEvent ) |
|
520 { |
|
521 // ----------------------------------------------------- |
|
522 // If the recording state of the camera has changed (started/paused/stopped) |
|
523 // we may need to update the CBA labels |
|
524 case ECamEventOperationStateChanged: |
|
525 { |
|
526 if( iController.IsAppUiAvailable() ) |
|
527 { |
|
528 const TCamCaptureOperation operation( iController.CurrentOperation() ); |
|
529 if ( ECamCapturing == operation ) |
|
530 { |
|
531 const TCamOrientation camOrientation = |
|
532 static_cast<CCamAppUiBase*>( AppUi() )->CamOrientation(); |
|
533 // if in camcorder mode need to show navi-ctr |
|
534 if( ECamOrientationCamcorder == camOrientation |
|
535 || ECamOrientationCamcorderLeft == camOrientation |
|
536 || ECamOrientationPortrait == camOrientation ) |
|
537 { |
|
538 iContainer->SetupNaviPanesL( CCamContainerBase::ECamPaneProgress ); |
|
539 } |
|
540 else |
|
541 { |
|
542 static_cast<CCamAppUiBase*>( AppUi() )->PushNaviPaneProgressBarL(); |
|
543 } |
|
544 } |
|
545 else if ( ECamCompleting == operation ) |
|
546 { |
|
547 iContainer->SetupNaviPanesL( CCamContainerBase::ECamPaneCounter ); |
|
548 } |
|
549 else |
|
550 { |
|
551 // empty else statement to remove LINT error |
|
552 } |
|
553 UpdateCbaL(); |
|
554 } |
|
555 break; |
|
556 } |
|
557 // ----------------------------------------------------- |
|
558 case ECamEventRecordComplete: |
|
559 { |
|
560 static_cast<CCamAppUiBase*>( AppUi() )->PushNaviPaneCounterL(); |
|
561 // if the recording failed due to a problem with the MMC |
|
562 if ( KErrNone != aError |
|
563 && iController.IntegerSettingValue( ECamSettingItemVideoMediaStorage ) |
|
564 == ECamMediaStorageCard |
|
565 && CamUtility::MemoryCardStatus() != ECamMemoryCardInserted ) |
|
566 { |
|
567 StopViewFinder(); |
|
568 StartViewFinder(); |
|
569 } |
|
570 if ( static_cast<CCamAppUi*>( AppUi() )->ShowPostCaptureView() == EFalse |
|
571 && !iController.IsCaptureStoppedForUsb() ) |
|
572 { |
|
573 // fixed toolbar is used only with touch devices |
|
574 if ( iController.IsTouchScreenSupported() ) |
|
575 { |
|
576 CAknToolbar* toolbar = Toolbar(); |
|
577 if ( toolbar ) |
|
578 { |
|
579 toolbar->SetToolbarVisibility( ETrue ); |
|
580 } |
|
581 } |
|
582 } |
|
583 |
|
584 if ( iController.IsCaptureStoppedForUsb() ) |
|
585 { |
|
586 iContainer->SetupNaviPanesL( CCamContainerBase::ECamPaneCounter ); |
|
587 } |
|
588 |
|
589 if ( EFalse == static_cast<CCamAppUi*>( AppUi() )->ShowPostCaptureView() ) |
|
590 { |
|
591 // Vf was stopped when stopping video recording, need to restart here |
|
592 // if postcapture is off. |
|
593 StartViewFinder(); |
|
594 if( iHdmiTimer->IsActive() ) |
|
595 iHdmiTimer->Cancel(); |
|
596 iHdmiTimer->StartTimer(); |
|
597 } |
|
598 break; |
|
599 } |
|
600 // ----------------------------------------------------- |
|
601 case ECamEventEngineStateChanged: |
|
602 { |
|
603 CCamPreCaptureViewBase::HandleControllerEventL( aEvent, aError ); |
|
604 break; |
|
605 } |
|
606 // ----------------------------------------------------- |
|
607 case ECamEventSliderOpen: |
|
608 { |
|
609 iController.StartViewFinder(); |
|
610 break; |
|
611 } |
|
612 default: |
|
613 { |
|
614 // Other events ignored |
|
615 break; |
|
616 } |
|
617 // ----------------------------------------------------- |
|
618 } |
|
619 PRINT ( _L("Camera <= CCamVideoPreCaptureView::HandleControllerEventL") ); |
|
620 } |
|
621 |
|
622 |
|
623 // --------------------------------------------------------------------------- |
|
624 // CCamVideoPreCaptureView::CCamVideoPreCaptureView |
|
625 // C++ constructor |
|
626 // --------------------------------------------------------------------------- |
|
627 // |
|
628 CCamVideoPreCaptureView::CCamVideoPreCaptureView( CCamAppController& aController ) |
|
629 : CCamPreCaptureViewBase( aController ) |
|
630 { |
|
631 } |
|
632 |
|
633 // --------------------------------------------------------------------------- |
|
634 // CCamVideoPreCaptureView::ConstructL |
|
635 // Symbian OS 2nd phase constructor |
|
636 // --------------------------------------------------------------------------- |
|
637 // |
|
638 void CCamVideoPreCaptureView::ConstructL() |
|
639 { |
|
640 BaseConstructL( ROID(R_CAM_VIDEO_PRE_CAPTURE_VIEW_ID) ); |
|
641 CCamPreCaptureViewBase::ConstructL(); |
|
642 iHdmiTimer = CCamTimer::NewL( KHdmiTimeout, TCallBack(HdmiTimerCallback, this)); |
|
643 } |
|
644 |
|
645 // --------------------------------------------------------------------------- |
|
646 // CCamVideoPreCaptureView::UpdateCbaL |
|
647 // Update softkeys to reflect current state |
|
648 // --------------------------------------------------------------------------- |
|
649 // |
|
650 void CCamVideoPreCaptureView::UpdateCbaL() |
|
651 { |
|
652 PRINT( _L("Camera => CCamVideoPreCaptureView::UpdateCbaL") ); |
|
653 |
|
654 CCamAppUi* appui = static_cast<CCamAppUi*>( AppUi() ); |
|
655 |
|
656 // if videocall is active, set the softkeys already here |
|
657 if ( iController.InVideocallOrRinging() ) |
|
658 { |
|
659 SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT ); |
|
660 } |
|
661 // if the view is in capture setup menu mode |
|
662 if ( iCaptureSetupMenuModeActive |
|
663 && !iCaptureSetupModeActive |
|
664 && !iSceneSettingModeActive ) |
|
665 { |
|
666 SetSoftKeysL( R_AVKON_SOFTKEYS_SELECT_BACK ); |
|
667 } |
|
668 // if the view is in capture setup mode |
|
669 else if ( iCaptureSetupModeActive ) |
|
670 { |
|
671 SetSoftKeysL( R_CAM_SOFTKEYS_SETTINGS_SELECT_BACK__CHANGE_TRANSPARENT ); |
|
672 } |
|
673 // if the view is in scene settings mode |
|
674 else if ( iSceneSettingModeActive ) |
|
675 { |
|
676 if( !iForceAvkonCBA ) |
|
677 { |
|
678 SetSoftKeysL( R_CAM_SOFTKEYS_SETTINGS_SELECT_BACK__CHANGE_TRANSPARENT ); |
|
679 } |
|
680 else |
|
681 { |
|
682 SetSoftKeysL( R_AVKON_SOFTKEYS_SELECT_CANCEL ); |
|
683 } |
|
684 } |
|
685 else if ( iStandbyModeActive ) |
|
686 { |
|
687 if( KErrNone == appui->StandbyStatus() ) |
|
688 SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__CONTINUE ); |
|
689 else |
|
690 SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT ); |
|
691 } |
|
692 |
|
693 else // otherwise, show the default softkeys |
|
694 { |
|
695 switch ( iController.CurrentVideoOperation() ) |
|
696 { |
|
697 // ------------------------------- |
|
698 case ECamCapturing: |
|
699 { |
|
700 if(appui->IsSecondCameraEnabled() && !appui->IsQwerty2ndCamera()) |
|
701 { |
|
702 SetSoftKeysL( R_CAM_SOFTKEYS_PAUSE_STOP_SECONDARY ); |
|
703 } |
|
704 else |
|
705 { |
|
706 SetSoftKeysL( R_CAM_SOFTKEYS_PAUSE_STOP ); |
|
707 } |
|
708 break; |
|
709 } |
|
710 // ------------------------------- |
|
711 case ECamPaused: |
|
712 { |
|
713 if(appui->IsSecondCameraEnabled() && !appui->IsQwerty2ndCamera()) |
|
714 { |
|
715 SetSoftKeysL( R_CAM_SOFTKEYS_CONTINUE_STOP_SECONDARY ); |
|
716 } |
|
717 else |
|
718 { |
|
719 SetSoftKeysL( R_CAM_SOFTKEYS_CONTINUE_STOP ); |
|
720 } |
|
721 break; |
|
722 } |
|
723 // ------------------------------- |
|
724 case ECamNoOperation: |
|
725 { |
|
726 if ( iController.CaptureModeTransitionInProgress() ) |
|
727 { |
|
728 if(iEmbedded ) |
|
729 { |
|
730 if(appui->IsSecondCameraEnabled() && !appui->IsQwerty2ndCamera()) |
|
731 { |
|
732 SetSoftKeysL(R_CAM_SOFTKEYS_BACK_SECONDARY); |
|
733 } |
|
734 else |
|
735 { |
|
736 SetSoftKeysL(R_CAM_SOFTKEYS_BACK); |
|
737 } |
|
738 } |
|
739 else |
|
740 { |
|
741 if(appui->IsSecondCameraEnabled() && !appui->IsQwerty2ndCamera()) |
|
742 { |
|
743 SetSoftKeysL(R_CAM_SOFTKEYS_BLANK_EXIT_SECONDARY); |
|
744 } |
|
745 else |
|
746 { |
|
747 SetSoftKeysL(R_CAM_SOFTKEYS_BLANK_EXIT); |
|
748 } |
|
749 } |
|
750 } |
|
751 else |
|
752 { |
|
753 if ( appui->TargetViewState() != ECamViewStatePostCapture ) |
|
754 { |
|
755 if ( iEmbedded ) |
|
756 { |
|
757 if(appui->IsSecondCameraEnabled() && !appui->IsQwerty2ndCamera()) |
|
758 { |
|
759 SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_BACK__RECORD_SECONDARY ); |
|
760 } |
|
761 else |
|
762 { |
|
763 SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_BACK__RECORD ); |
|
764 } |
|
765 |
|
766 } |
|
767 else |
|
768 { |
|
769 if ( !appui->IsToolBarVisible() |
|
770 && appui->IsSecondCameraEnabled() |
|
771 && !appui->IsQwerty2ndCamera()) |
|
772 { |
|
773 SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__RECORD_TXT ); |
|
774 } |
|
775 else if ( appui->DrawPreCaptureCourtesyUI() ) |
|
776 { |
|
777 if(appui->IsSecondCameraEnabled() && !appui->IsQwerty2ndCamera()) |
|
778 { |
|
779 SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__RECORD_SECONDARY ); |
|
780 } |
|
781 else |
|
782 { |
|
783 SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__RECORD ); |
|
784 } |
|
785 } |
|
786 else |
|
787 { |
|
788 SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); |
|
789 } |
|
790 } |
|
791 } |
|
792 } |
|
793 break; |
|
794 } |
|
795 // ------------------------------- |
|
796 case ECamCompleting: |
|
797 { |
|
798 if ( iController.IntegerSettingValue( ECamSettingItemVideoShowCapturedVideo ) == ECamSettOn && |
|
799 !iController.IsCaptureStoppedForUsb() && appui->TargetViewState() == ECamViewStatePostCapture ) |
|
800 { |
|
801 //We need to blank the precapture view CBA here to prevent |
|
802 //blinking when changing back to precapture from postcapture. |
|
803 SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); |
|
804 } |
|
805 break; |
|
806 } |
|
807 // ------------------------------- |
|
808 default: |
|
809 { |
|
810 // do nothing |
|
811 break; |
|
812 } |
|
813 // ------------------------------- |
|
814 } |
|
815 } |
|
816 PRINT( _L("Camera <= CCamVideoPreCaptureView::UpdateCbaL") ); |
|
817 } |
|
818 |
|
819 // --------------------------------------------------------------------------- |
|
820 // CCamVideoPreCaptureView::SetTitlePaneTextL |
|
821 // Set the view's title text |
|
822 // --------------------------------------------------------------------------- |
|
823 // |
|
824 void CCamVideoPreCaptureView::SetTitlePaneTextL() |
|
825 { |
|
826 CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() ); |
|
827 #ifndef __WINS__ |
|
828 if ( iEmbedded /*&& !appUi->IsInCallSend()*/ ) |
|
829 { |
|
830 // only set the title if the construction is complete |
|
831 // otherwise the application is not yet set up correctly |
|
832 // as embedded |
|
833 if ( appUi->IsConstructionComplete() ) |
|
834 { |
|
835 // set title to name of embedding application |
|
836 appUi->SetTitleEmbeddedL(); |
|
837 } |
|
838 } |
|
839 else |
|
840 #endif |
|
841 { |
|
842 TInt titleResourceId = R_CAM_VIDEO_PRE_CAPTURE_TITLE_NAME; |
|
843 |
|
844 if ( iCaptureSetupModeActive || iSceneSettingModeActive ) |
|
845 { |
|
846 titleResourceId = CCamCaptureSetupViewBase::SetupModeTitlePaneResourceId(); |
|
847 } |
|
848 |
|
849 appUi->SetTitleL( titleResourceId ); |
|
850 } |
|
851 } |
|
852 |
|
853 // --------------------------------------------------------------------------- |
|
854 // CCamVideoPreCaptureView::StartViewFinder |
|
855 // Enter viewfinder mode |
|
856 // --------------------------------------------------------------------------- |
|
857 // |
|
858 void CCamVideoPreCaptureView::StartViewFinder() |
|
859 { |
|
860 iController.EnterViewfinderMode( ECamControllerVideo ); |
|
861 } |
|
862 |
|
863 // --------------------------------------------------------------------------- |
|
864 // CCamVideoPreCaptureView::StopViewFinder |
|
865 // Exit viewfinder mode |
|
866 // --------------------------------------------------------------------------- |
|
867 // |
|
868 void CCamVideoPreCaptureView::StopViewFinder() |
|
869 { |
|
870 iController.ExitViewfinderMode( ECamControllerVideo ); |
|
871 } |
|
872 |
|
873 // --------------------------------------------------------------------------- |
|
874 // CCamVideoPreCaptureView::CreateContainerL |
|
875 // Create container control |
|
876 // --------------------------------------------------------------------------- |
|
877 // |
|
878 void CCamVideoPreCaptureView::CreateContainerL() |
|
879 { |
|
880 PRINT( _L("Camera => CCamVideoPreCaptureView::CreateContainerL" ) ) |
|
881 |
|
882 TRect screen; |
|
883 AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen ); |
|
884 |
|
885 iContainer = CCamVideoPreCaptureContainer::NewL( |
|
886 iController, |
|
887 *this, |
|
888 screen ); |
|
889 |
|
890 iContainer->SetMopParent( this ); |
|
891 |
|
892 CCamPreCaptureViewBase::CreateContainerL(); |
|
893 PRINT( _L("Camera <= CCamVideoPreCaptureView::CreateContainerL" ) ) |
|
894 } |
|
895 |
|
896 // --------------------------------------------------------------------------- |
|
897 // CCamVideoPreCaptureView::DynInitMenuPaneL |
|
898 // Changes MenuPane dynamically |
|
899 // --------------------------------------------------------------------------- |
|
900 // |
|
901 void CCamVideoPreCaptureView::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ) |
|
902 { |
|
903 PRINT( _L("Camera => CCamVideoPreCaptureView::DynInitMenuPaneL" )); |
|
904 |
|
905 if ( iContainer ) |
|
906 { |
|
907 iContainer->Window().SetNonFading( ETrue ); |
|
908 } |
|
909 |
|
910 CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() ); |
|
911 __ASSERT_DEBUG(appUi, CamPanic(ECamPanicNullPointer)); |
|
912 TInt itemPos(0); |
|
913 if( aMenuPane->MenuItemExists(ECamCmdToggleCourtesyUI, itemPos) ) |
|
914 { |
|
915 if ( !appUi->AlwaysDrawPreCaptureCourtesyUI() ) |
|
916 { |
|
917 aMenuPane->SetItemTextL( ECamCmdToggleCourtesyUI, |
|
918 R_CAM_CAPTURE_DISPLAY_ON_TEXT); |
|
919 } |
|
920 } |
|
921 |
|
922 // if ( aResourceId == R_CAM_STANDBY_MENU && iStandbyError != KErrNone ) |
|
923 if ( aResourceId == R_CAM_STANDBY_MENU && appUi->StandbyStatus() != KErrNone ) |
|
924 { |
|
925 aMenuPane->SetItemDimmed( ECamCmdExitStandby, ETrue ); |
|
926 } |
|
927 else if ( aResourceId == ROID(R_CAM_VIDEO_PRE_CAPTURE_MENU_ID)) |
|
928 { |
|
929 DynInitSwitchCameraMenuItemL( aMenuPane ); |
|
930 } |
|
931 else // otherwise, not in burst mode or menu pane is not default |
|
932 { |
|
933 // if embedded video set mute/unmute option appropriately, and set up |
|
934 // Switch camera item |
|
935 if( aResourceId == ROID(R_CAM_VIDEO_EMBEDDED_PRE_CAPTURE_MENU_ID)) |
|
936 { |
|
937 DynInitSwitchCameraMenuItemL( aMenuPane ); |
|
938 iAudioEnabled = iController.IntegerSettingValue( ECamSettingItemVideoAudioRec ); |
|
939 // if audio off replace mute with unmute |
|
940 if( iAudioEnabled == ECamSettOff ) |
|
941 { |
|
942 aMenuPane->SetItemDimmed( ECamCmdMute, ETrue ); |
|
943 aMenuPane->SetItemDimmed( ECamCmdUnmute, EFalse ); |
|
944 } |
|
945 else |
|
946 { |
|
947 aMenuPane->SetItemDimmed( ECamCmdMute, EFalse ); |
|
948 aMenuPane->SetItemDimmed( ECamCmdUnmute, ETrue ); |
|
949 } |
|
950 /*#ifndef __WINS__ |
|
951 // if embedded and not in in-call send |
|
952 if ( !appUi->IsInCallSend() ) |
|
953 #endif*/ |
|
954 // { |
|
955 aMenuPane->SetItemDimmed( ECamCmdNewPhoto, ETrue ); |
|
956 // } |
|
957 } |
|
958 |
|
959 CCamCaptureSetupViewBase::DynInitMenuPaneL( aResourceId, aMenuPane ); |
|
960 } |
|
961 PRINT( _L("Camera <= CCamVideoPreCaptureView::DynInitMenuPaneL" )) |
|
962 } |
|
963 |
|
964 |
|
965 // --------------------------------------------------------------------------- |
|
966 // CCamVideoPreCaptureView::CreateCaptureSetupMenuL |
|
967 // Creates a video capture setup menu |
|
968 // --------------------------------------------------------------------------- |
|
969 // |
|
970 void CCamVideoPreCaptureView::CreateCaptureSetupMenuL() |
|
971 { |
|
972 TInt resource; |
|
973 // check if we are Western or Arabic/Hebrew layout |
|
974 if ( !AknLayoutUtils::LayoutMirrored() ) |
|
975 { |
|
976 if( AknLayoutUtils::Variant() == EApacVariant ) |
|
977 { |
|
978 resource = ROID(R_CAM_CAPTURE_SETUP_MENU_VIDEO_DATA_APAC_ID); |
|
979 } |
|
980 else |
|
981 { |
|
982 // use Western resource |
|
983 resource = ROID(R_CAM_CAPTURE_SETUP_MENU_VIDEO_DATA_ID); |
|
984 } |
|
985 } |
|
986 else |
|
987 { |
|
988 resource = ROID(R_CAM_CAPTURE_SETUP_MENU_VIDEO_DATA_AH_ID); |
|
989 } |
|
990 |
|
991 // Use capture setup menu for second camera |
|
992 if ( static_cast<CCamAppUiBase*>( AppUi() )->IsSecondCameraEnabled() ) |
|
993 { |
|
994 resource = ROID(R_CAM_CAPTURE_SETUP_MENU_VIDEO_DATA_ID); |
|
995 } |
|
996 |
|
997 iCaptureSetupMenuContainer = |
|
998 CCamCaptureSetupMenu::NewL( iController, *this, AppUi()->ClientRect(), |
|
999 resource, iCaptureSetupMenuLastItemIndex ); |
|
1000 |
|
1001 } |
|
1002 |
|
1003 // --------------------------------------------------------------------------- |
|
1004 // CCamPreCaptureViewBase::SwitchToSceneSettingModeL |
|
1005 // Switches the current mode to scene setting and activates a |
|
1006 // specific control. |
|
1007 // --------------------------------------------------------------------------- |
|
1008 // |
|
1009 void CCamVideoPreCaptureView::SwitchToSceneSettingModeL() |
|
1010 { |
|
1011 if ( !iSceneSettingContainer ) |
|
1012 { |
|
1013 // Create the scene setting container for video mode. |
|
1014 iSceneSettingContainer = CCamShootingModeContainer::NewL( AppUi()->ApplicationRect(), |
|
1015 ETrue, //Skinned background |
|
1016 *this, |
|
1017 ECamControllerVideo, |
|
1018 iController, |
|
1019 EFalse ); |
|
1020 |
|
1021 iSceneSettingContainer->DrawableWindow()->SetOrdinalPosition(-1); |
|
1022 } |
|
1023 |
|
1024 iSettingModeTitleResourceId = R_CAM_VIDEO_SCENE_SETTING_TITLE; |
|
1025 |
|
1026 if ( iEmbedded ) |
|
1027 { |
|
1028 iPreviousMenuResourceId = ROID(R_CAM_VIDEO_EMBEDDED_PRE_CAPTURE_MENUBAR_ID); |
|
1029 } |
|
1030 else |
|
1031 { |
|
1032 iPreviousMenuResourceId = ROID(R_CAM_VIDEO_PRE_CAPTURE_MENUBAR_ID); |
|
1033 } |
|
1034 // Remove the view's main container, and add the capture setup |
|
1035 // control associated with the input command to the container stack. |
|
1036 CCamCaptureSetupViewBase::SwitchToSceneSettingModeL(); |
|
1037 |
|
1038 // only remove the capture setup menu container after |
|
1039 // the switch completes successfully |
|
1040 RemoveCaptureSetupMenuContainers(); |
|
1041 |
|
1042 // Stop the viewfinder as it isn't required for scene settings |
|
1043 StopViewFinder(); |
|
1044 |
|
1045 } |
|
1046 |
|
1047 |
|
1048 // --------------------------------------------------------------------------- |
|
1049 // CCamVideoPreCaptureView::DoActivateL |
|
1050 // Activate this view |
|
1051 // --------------------------------------------------------------------------- |
|
1052 // |
|
1053 void |
|
1054 CCamVideoPreCaptureView::DoActivateL( const TVwsViewId& aPrevViewId, |
|
1055 TUid aCustomMessageId, |
|
1056 const TDesC8& aCustomMessage ) |
|
1057 { |
|
1058 OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMVIDEOPRECAPTUREVIEW_DOACTIVATEL, "e_CCamVideoPreCaptureView_DoActivateL 1" ); |
|
1059 PRINT( _L("Camera => CCamVideoPreCaptureView::DoActivateL") ); |
|
1060 PERF_EVENT_START_L2( EPerfEventVideoPreCaptureViewActivation ); |
|
1061 // Ensure the correct menu is used for the current mode. |
|
1062 CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() ); |
|
1063 // Toolbar is created here. |
|
1064 // fixed toolbar is used only with touch devices |
|
1065 if ( iController.IsTouchScreenSupported() ) |
|
1066 { |
|
1067 CAknToolbar* toolbar = Toolbar(); |
|
1068 if( !toolbar ) |
|
1069 { |
|
1070 PRINT( _L("Camera <> CCamVideoPreCaptureView::DoActivateL - Not toolbar -> Create one" ) ); |
|
1071 if(iController.UiConfigManagerPtr()->IsXenonFlashSupported()) |
|
1072 { |
|
1073 CreateAndSetToolbarL(R_CAM_VIDEO_PRECAPTURE_TOOLBAR); |
|
1074 } |
|
1075 else |
|
1076 { |
|
1077 CreateAndSetToolbarL(R_CAM_VIDEO_PRECAPTURE_TOOLBAR_VIDEOLIGHT); |
|
1078 } |
|
1079 } |
|
1080 } |
|
1081 |
|
1082 |
|
1083 // fixed toolbar is used only with touch devices |
|
1084 if ( iController.IsTouchScreenSupported() ) |
|
1085 { |
|
1086 if ( appUi->IsEmbedded() ) |
|
1087 { |
|
1088 CAknToolbar* toolbar = Toolbar(); |
|
1089 toolbar->SetToolbarVisibility(EFalse); |
|
1090 } |
|
1091 } |
|
1092 else |
|
1093 { |
|
1094 // handled in CamPreCaptureViewBase |
|
1095 } |
|
1096 |
|
1097 // Check if view is activated internally or externally |
|
1098 TUid appUid = aPrevViewId.iAppUid; |
|
1099 if( appUid != appUi->Application()->AppDllUid() ) |
|
1100 { |
|
1101 // set capture mode |
|
1102 appUi->SetCaptureMode( ECamControllerVideo ); |
|
1103 } |
|
1104 |
|
1105 SetMenuBar(); |
|
1106 |
|
1107 CCamPreCaptureViewBase::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage ); |
|
1108 |
|
1109 PERF_EVENT_END_L2( EPerfEventVideoPreCaptureViewActivation ); |
|
1110 PRINT( _L("Camera <= CCamVideoPreCaptureView::DoActivateL") ); |
|
1111 OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMVIDEOPRECAPTUREVIEW_DOACTIVATEL, "e_CCamVideoPreCaptureView_DoActivateL 0" ); |
|
1112 } |
|
1113 |
|
1114 // --------------------------------------------------------------------------- |
|
1115 // SetMenuBar <<virtual>> |
|
1116 // --------------------------------------------------------------------------- |
|
1117 // |
|
1118 void |
|
1119 CCamVideoPreCaptureView::SetMenuBar() |
|
1120 { |
|
1121 PRINT( _L("Camera => CCamVideoPreCaptureView::SetMenuBar") ); |
|
1122 CEikMenuBar* menuBar = MenuBar(); |
|
1123 if ( menuBar ) |
|
1124 { |
|
1125 if ( iStandbyModeActive ) |
|
1126 { |
|
1127 PRINT( _L("Camera <> CCamVideoPreCaptureView::SetMenuBar: setting standby menubar..") ); |
|
1128 menuBar->SetMenuTitleResourceId( R_CAM_STANDBY_MENUBAR ); |
|
1129 } |
|
1130 else if ( iEmbedded ) |
|
1131 { |
|
1132 PRINT( _L("Camera <> CCamVideoPreCaptureView::SetMenuBar: setting menu resource to R_CAM_VIDEO_EMBEDDED_PRE_CAPTURE_MENUBAR_ID") ); |
|
1133 menuBar->SetMenuTitleResourceId( ROID(R_CAM_VIDEO_EMBEDDED_PRE_CAPTURE_MENUBAR_ID)); |
|
1134 } |
|
1135 else |
|
1136 { |
|
1137 PRINT( _L("Camera <> CCamVideoPreCaptureView::SetMenuBar: setting menu resource to R_CAM_VIDEO_PRE_CAPTURE_MENUBAR_ID") ); |
|
1138 menuBar->SetMenuTitleResourceId( ROID(R_CAM_VIDEO_PRE_CAPTURE_MENUBAR_ID) ); |
|
1139 } |
|
1140 } |
|
1141 PRINT( _L("Camera <= CCamVideoPreCaptureView::SetMenuBar") ); |
|
1142 } |
|
1143 |
|
1144 |
|
1145 // --------------------------------------------------------------------------- |
|
1146 // CCamVideoPreCaptureView::GetHelpContext |
|
1147 // Called to identify the help context for this view |
|
1148 // --------------------------------------------------------------------------- |
|
1149 // |
|
1150 void CCamVideoPreCaptureView::GetHelpContext( TCoeHelpContext& aContext ) const |
|
1151 { |
|
1152 aContext.iMajor = TUid::Uid( KCameraappUID ); |
|
1153 |
|
1154 // First check to see if the scene settings list is open |
|
1155 if ( iSceneSettingModeActive ) |
|
1156 { |
|
1157 aContext.iContext = KLCAM_HLP_SCENES_VIDEO; |
|
1158 } |
|
1159 // Else check for standby mode |
|
1160 else if ( iStandbyModeActive ) |
|
1161 { |
|
1162 // Also check to see if this is embedded standby |
|
1163 if ( iEmbedded ) |
|
1164 { |
|
1165 aContext.iContext = KLCAM_HLP_STANDYBY_EM; |
|
1166 } |
|
1167 else |
|
1168 { |
|
1169 aContext.iContext = KLCAM_HLP_STANDYBY_EM; |
|
1170 } |
|
1171 } |
|
1172 // Else check for embedded mode |
|
1173 else if ( iEmbedded ) |
|
1174 { |
|
1175 aContext.iContext = KLCAM_HLP_VIEWFINDER_VIDEO_EM; |
|
1176 } |
|
1177 // Else this is the plain photo viewfinder |
|
1178 else |
|
1179 { |
|
1180 aContext.iContext = KLCAM_HLP_VIEWFINDER_VIDEO; |
|
1181 } |
|
1182 } |
|
1183 |
|
1184 // --------------------------------------------------------------------------- |
|
1185 // CCamVideoPreCaptureView::MuteEmbeddedAudioL |
|
1186 // Mute or unmute audio for embedded video |
|
1187 // --------------------------------------------------------------------------- |
|
1188 // |
|
1189 void CCamVideoPreCaptureView::MuteEmbeddedAudioL( TBool aMuteAudio ) |
|
1190 { |
|
1191 if( aMuteAudio ) |
|
1192 { |
|
1193 iController.SetIntegerSettingValueL( ECamSettingItemVideoAudioRec, ECamSettOff ); |
|
1194 } |
|
1195 else |
|
1196 { |
|
1197 iController.SetIntegerSettingValueL( ECamSettingItemVideoAudioRec, ECamSettOn ); |
|
1198 } |
|
1199 } |
|
1200 |
|
1201 // --------------------------------------------------------------------------- |
|
1202 // CCamVideoPreCaptureView::DynInitToolbarL |
|
1203 // Dynamically initialize toolbar contents |
|
1204 // --------------------------------------------------------------------------- |
|
1205 // |
|
1206 void CCamVideoPreCaptureView::DynInitToolbarL( TInt aResourceId, |
|
1207 CAknToolbar* aToolbar ) |
|
1208 { |
|
1209 PRINT2( _L("Camera => CCamVideoPreCaptureView::DynInitToolbarL(%d, 0x%X)" ), aResourceId, aToolbar ) |
|
1210 (void)aResourceId; // remove compiler warning |
|
1211 |
|
1212 CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() ); |
|
1213 |
|
1214 iController.StartIdleTimer(); |
|
1215 // fixed toolbar is used only with touch devices |
|
1216 if ( iController.IsTouchScreenSupported() ) |
|
1217 { |
|
1218 UpdateToolbarIconsL(); |
|
1219 if( aToolbar ) |
|
1220 { |
|
1221 if ( iEmbedded /* && appUi->IsSecondCameraEnabled()*/ ) |
|
1222 { |
|
1223 // Dim mode switch icon and disable tooltip |
|
1224 aToolbar->SetItemDimmed(ECamCmdNewPhoto, ETrue, ETrue); |
|
1225 CAknButton* imageModeButton = static_cast<CAknButton*>( |
|
1226 aToolbar->ControlOrNull( ECamCmdNewPhoto ) ); |
|
1227 if ( imageModeButton ) |
|
1228 { |
|
1229 imageModeButton->SetDimmedHelpTextL( KNullDesC ); |
|
1230 } |
|
1231 |
|
1232 if ( appUi && appUi->IsSecondCameraEnabled() ) |
|
1233 { |
|
1234 aToolbar->SetItemDimmed( ECamCmdPhotos, ETrue, ETrue ); |
|
1235 CAknButton* photosButton = static_cast<CAknButton*>( |
|
1236 aToolbar->ControlOrNull( ECamCmdPhotos ) ); |
|
1237 if ( photosButton ) |
|
1238 { |
|
1239 // do not show tooltip for dimmed item |
|
1240 photosButton->SetDimmedHelpTextL( KNullDesC ); |
|
1241 } |
|
1242 } |
|
1243 } |
|
1244 CAknToolbarExtension* extension = aToolbar->ToolbarExtension(); |
|
1245 if( extension ) |
|
1246 { |
|
1247 if ( iEmbedded ) |
|
1248 { |
|
1249 extension->HideItemL( ECamCmdNewPhoto, ETrue ); |
|
1250 extension->HideItemL( ECamCmdPhotos, ETrue ); |
|
1251 } |
|
1252 else |
|
1253 { |
|
1254 extension->HideItemL( ECamCmdNewPhoto, EFalse ); |
|
1255 extension->HideItemL( ECamCmdPhotos, EFalse ); |
|
1256 } |
|
1257 if(aResourceId == ECamCmdToolbarExtension) |
|
1258 { |
|
1259 appUi->ZoomPane()->MakeVisible(EFalse,ETrue); |
|
1260 } |
|
1261 } |
|
1262 } |
|
1263 } |
|
1264 |
|
1265 |
|
1266 PRINT2( _L("Camera <= CCamVideoPreCaptureView::DynInitToolbarL(%d, 0x%X)" ), aResourceId, aToolbar ) |
|
1267 } |
|
1268 |
|
1269 // --------------------------------------------------------------------------- |
|
1270 // CCamVideoPreCaptureView::UpdateToolbarIconsL |
|
1271 // Update fixed toolbar icons according to current settings |
|
1272 // --------------------------------------------------------------------------- |
|
1273 // |
|
1274 void CCamVideoPreCaptureView::UpdateToolbarIconsL() |
|
1275 { |
|
1276 PRINT( _L("Camera => CCamVideoPreCaptureView::UpdateToolbarIconsL") ); |
|
1277 // fixed toolbar is used only with touch devices |
|
1278 if (!iController.IsTouchScreenSupported() ) |
|
1279 return; |
|
1280 UpdateVideoFlashIconsL(); |
|
1281 UpdateVideoSceneModeIconsL(); |
|
1282 UpdateVideoColorToneIconsL(); |
|
1283 UpdateVideoWhitebalanceIconsL(); |
|
1284 RedrawToolBar(); |
|
1285 PRINT( _L("Camera <= CCamVideoPreCaptureView::UpdateToolbarIconsL") ); |
|
1286 } |
|
1287 |
|
1288 // --------------------------------------------------------------------------- |
|
1289 // CCamVideoPreCaptureView::OfferToolbarEventL |
|
1290 // Handle commands from toolbar |
|
1291 // --------------------------------------------------------------------------- |
|
1292 // |
|
1293 void CCamVideoPreCaptureView::OfferToolbarEventL( TInt aCommand ) |
|
1294 { |
|
1295 PRINT1( _L("Camera => CCamVideoPreCaptureView::OfferToolbarEventL(%d)" ), aCommand ); |
|
1296 |
|
1297 iController.StartIdleTimer(); |
|
1298 // fixed toolbar is used only with touch devices |
|
1299 if ( iController.IsTouchScreenSupported() ) |
|
1300 { |
|
1301 CCamPreCaptureViewBase::OfferToolbarEventL( aCommand ); |
|
1302 |
|
1303 |
|
1304 // Redraw video light button |
|
1305 CAknToolbar* toolbar = Toolbar(); |
|
1306 if ( aCommand == ECamCmdToggleVideoFlash && |
|
1307 toolbar ) |
|
1308 { |
|
1309 CAknButton* button = static_cast<CAknButton*>( |
|
1310 toolbar->ControlOrNull( aCommand ) ); |
|
1311 if ( button ) |
|
1312 { |
|
1313 button->DrawDeferred(); |
|
1314 } |
|
1315 } |
|
1316 } |
|
1317 |
|
1318 PRINT1( _L("Camera <= CCamVideoPreCaptureView::OfferToolbarEventL(%d)" ), aCommand ); |
|
1319 } |
|
1320 |
|
1321 |
|
1322 // --------------------------------------------------------------------------- |
|
1323 // CCamVideoPreCaptureView::StartMskCapture() |
|
1324 // Try to start the capture with MSK command. Return true if started. |
|
1325 // --------------------------------------------------------------------------- |
|
1326 // |
|
1327 TBool CCamVideoPreCaptureView::StartMskCaptureL() |
|
1328 { |
|
1329 CCamAppUi* appUi = static_cast<CCamAppUi*>( iEikonEnv->AppUi() ); |
|
1330 TCamOrientation orientation = appUi->CamOrientation(); |
|
1331 TBool startedCapture(EFalse); |
|
1332 if( orientation == ECamOrientationCamcorder || |
|
1333 orientation == ECamOrientationCamcorderLeft || |
|
1334 orientation == ECamOrientationPortrait ) |
|
1335 { |
|
1336 if ( appUi && !appUi->IsToolBarVisible() |
|
1337 && iController.UiConfigManagerPtr() |
|
1338 && !iController.UiConfigManagerPtr()->IsOpticalJoyStickSupported() ) |
|
1339 { |
|
1340 // In case of MSK if no AP on screen, it should work as record |
|
1341 // If optical joystic is not available, we will start the |
|
1342 // recording here. Otherwise it is handled |
|
1343 // in CCamVideoPreCaptureContainer |
|
1344 TInt callType( EPSCTsyCallTypeUninitialized ); |
|
1345 RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallType, callType ); |
|
1346 if( iController.IntegerSettingValue( ECamSettingItemStopRecordingInHdmiMode) && |
|
1347 iController.IsHdmiCableConnected() ) |
|
1348 { |
|
1349 appUi->HandleHdmiEventL( ECamHdmiCableConnectedBeforeRecording ); |
|
1350 } |
|
1351 else if ( callType != EPSCTsyCallTypeH324Multimedia && iController.IsViewFinding() && appUi->CheckMemoryL() ) |
|
1352 { |
|
1353 SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); |
|
1354 iController.StartVideoRecordingL(); |
|
1355 startedCapture = ETrue; |
|
1356 // fixed toolbar is used only with touch devices |
|
1357 if ( iController.IsTouchScreenSupported() ) |
|
1358 { |
|
1359 CAknToolbar* fixedToolbar = Toolbar(); |
|
1360 if ( fixedToolbar ) |
|
1361 { |
|
1362 fixedToolbar->SetToolbarVisibility( EFalse ); |
|
1363 } |
|
1364 } |
|
1365 } |
|
1366 } |
|
1367 // else let the calling function take care of capturing |
|
1368 } |
|
1369 return startedCapture; |
|
1370 } |
|
1371 |
|
1372 |
|
1373 // --------------------------------------------------------------------------- |
|
1374 // CCamVideoPreCaptureView::UpdateVideoFlashIconsL() |
|
1375 // --------------------------------------------------------------------------- |
|
1376 // |
|
1377 void CCamVideoPreCaptureView::UpdateVideoFlashIconsL() |
|
1378 { |
|
1379 CAknButton* button = ToolbarButtonById(ECamCmdToggleVideoFlash); |
|
1380 if(!button) |
|
1381 return; |
|
1382 MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); |
|
1383 TFileName iconFileName; |
|
1384 CamUtility::ResourceFileName( iconFileName ); |
|
1385 TCamFlashId flash = static_cast< TCamFlashId > |
|
1386 ( iController.IntegerSettingValue( |
|
1387 ECamSettingItemDynamicVideoFlash ) ); |
|
1388 |
|
1389 CAknButtonState* state = button->State(); |
|
1390 if ( state ) |
|
1391 { |
|
1392 switch ( flash ) |
|
1393 { |
|
1394 case ECamFlashOff: |
|
1395 { |
|
1396 SetIconL( |
|
1397 button, |
|
1398 iconFileName, |
|
1399 EMbmCameraappQgn_indi_cam4_tb_light_off, |
|
1400 EMbmCameraappQgn_indi_cam4_tb_light_off_mask, |
|
1401 skinInstance, |
|
1402 KAknsIIDQgnIndiCam4TbLightOff ); |
|
1403 HBufC* tooltipText = |
|
1404 StringLoader::LoadLC( R_QTN_LCAM_TT_VIDEOFLASH ); |
|
1405 state->SetHelpTextL( *tooltipText ); |
|
1406 CleanupStack::PopAndDestroy( tooltipText ); |
|
1407 break; |
|
1408 } |
|
1409 case ECamFlashForced: |
|
1410 { |
|
1411 SetIconL( |
|
1412 button, |
|
1413 iconFileName, |
|
1414 EMbmCameraappQgn_indi_cam4_tb_light, |
|
1415 EMbmCameraappQgn_indi_cam4_tb_light_mask, |
|
1416 skinInstance, |
|
1417 KAknsIIDQgnIndiCam4TbLight ); |
|
1418 HBufC* tooltipText = |
|
1419 StringLoader::LoadLC( R_QTN_LCAM_TT_FLASHOFF ); |
|
1420 state->SetHelpTextL( *tooltipText ); |
|
1421 CleanupStack::PopAndDestroy( tooltipText ); |
|
1422 break; |
|
1423 } |
|
1424 default: |
|
1425 break; |
|
1426 } |
|
1427 } |
|
1428 } |
|
1429 |
|
1430 // --------------------------------------------------------------------------- |
|
1431 // CCamVideoPreCaptureView::UpdateVideoSceneModeIconsL() |
|
1432 // --------------------------------------------------------------------------- |
|
1433 // |
|
1434 void CCamVideoPreCaptureView::UpdateVideoSceneModeIconsL() |
|
1435 { |
|
1436 CAknButton* button = ToolbarButtonById(ECamCmdCaptureSetupSceneVideo); |
|
1437 if(!button) |
|
1438 { |
|
1439 return; |
|
1440 } |
|
1441 |
|
1442 MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); |
|
1443 TFileName iconFileName; |
|
1444 CamUtility::ResourceFileName( iconFileName ); |
|
1445 TCamSceneId scene = static_cast< TCamSceneId > ( |
|
1446 iController.IntegerSettingValue( ECamSettingItemDynamicVideoScene ) ); |
|
1447 |
|
1448 // For use with scene indicator |
|
1449 TInt32 iconId = EMbmCameraappQgn_indi_cam4_mode_auto; |
|
1450 TInt32 maskId = EMbmCameraappQgn_indi_cam4_mode_auto_mask; |
|
1451 |
|
1452 switch ( scene ) |
|
1453 { |
|
1454 case ECamSceneAuto: |
|
1455 case ECamSceneNormal: |
|
1456 { |
|
1457 SetIconL( |
|
1458 button, |
|
1459 iconFileName, |
|
1460 EMbmCameraappQgn_indi_cam4_mode_auto, |
|
1461 EMbmCameraappQgn_indi_cam4_mode_auto_mask, |
|
1462 skinInstance, |
|
1463 KAknsIIDQgnIndiCam4ModeAuto ); |
|
1464 iconId = EMbmCameraappQgn_indi_cam4_mode_auto; |
|
1465 maskId = EMbmCameraappQgn_indi_cam4_mode_auto_mask; |
|
1466 break; |
|
1467 } |
|
1468 case ECamSceneNight: |
|
1469 { |
|
1470 SetIconL( |
|
1471 button, |
|
1472 iconFileName, |
|
1473 EMbmCameraappQgn_indi_cam4_mode_night, |
|
1474 EMbmCameraappQgn_indi_cam4_mode_night_mask, |
|
1475 skinInstance, |
|
1476 KAknsIIDQgnIndiCam4ModeNight ); |
|
1477 iconId = EMbmCameraappQgn_indi_cam4_mode_night; |
|
1478 maskId = EMbmCameraappQgn_indi_cam4_mode_night_mask; |
|
1479 break; |
|
1480 } |
|
1481 case ECamSceneLowLight: |
|
1482 { |
|
1483 SetIconL( |
|
1484 button, |
|
1485 iconFileName, |
|
1486 EMbmCameraappQgn_indi_cam4_wb_tungsten, |
|
1487 EMbmCameraappQgn_indi_cam4_wb_tungsten_mask, |
|
1488 skinInstance, |
|
1489 KAknsIIDQgnIndiCam4WbTungsten ); |
|
1490 iconId = EMbmCameraappQgn_indi_cam4_wb_tungsten; |
|
1491 maskId = EMbmCameraappQgn_indi_cam4_wb_tungsten_mask; |
|
1492 break; |
|
1493 } |
|
1494 default: |
|
1495 { |
|
1496 //Do Nothing |
|
1497 } |
|
1498 break; |
|
1499 } |
|
1500 |
|
1501 // Update the icon in the side pane |
|
1502 if ( iController.UiConfigManagerPtr()->IsCustomCaptureButtonSupported() ) |
|
1503 { |
|
1504 CCamAppUi* appUi = static_cast<CCamAppUi*>( iEikonEnv->AppUi() ); |
|
1505 CCamSidePane* sidePane = appUi->SidePane(); |
|
1506 |
|
1507 if ( sidePane ) |
|
1508 { |
|
1509 PRINT( _L("Camera <> CCamVideoPreCaptureView::UpdateVideoSceneModeIconsL - Updating side pane indicator") ); |
|
1510 sidePane->UpdateSceneIndicatorL( iconId, maskId ); |
|
1511 } |
|
1512 } |
|
1513 } |
|
1514 |
|
1515 // --------------------------------------------------------------------------- |
|
1516 // CCamVideoPreCaptureView::UpdateVideoColorToneIconsL() |
|
1517 // --------------------------------------------------------------------------- |
|
1518 // |
|
1519 void CCamVideoPreCaptureView::UpdateVideoColorToneIconsL() |
|
1520 { |
|
1521 CAknButton* button = ToolbarButtonById(ECamCmdCaptureSetupColourFilterVideo); |
|
1522 if(!button) |
|
1523 return; |
|
1524 if ( !iController.UiConfigManagerPtr()->IsColorToneFeatureSupported() ) |
|
1525 { |
|
1526 HideButton(ECamCmdCaptureSetupColourFilterVideo); |
|
1527 return; |
|
1528 } |
|
1529 MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); |
|
1530 TFileName iconFileName; |
|
1531 CamUtility::ResourceFileName( iconFileName ); |
|
1532 |
|
1533 TCamColourFilterId color = static_cast< TCamColourFilterId > |
|
1534 ( iController.IntegerSettingValue( ECamSettingItemDynamicVideoColourFilter ) ); |
|
1535 |
|
1536 switch ( color ) |
|
1537 { |
|
1538 case ECamColourFilterColour: |
|
1539 { |
|
1540 SetIconL( |
|
1541 button, |
|
1542 iconFileName, |
|
1543 EMbmCameraappQgn_indi_cam4_colour_normal, |
|
1544 EMbmCameraappQgn_indi_cam4_colour_normal_mask, |
|
1545 skinInstance, |
|
1546 KAknsIIDQgnIndiCam4ColourNormal ); |
|
1547 break; |
|
1548 } |
|
1549 case ECamColourFilterBlackAndWhite: |
|
1550 { |
|
1551 SetIconL( |
|
1552 button, |
|
1553 iconFileName, |
|
1554 EMbmCameraappQgn_indi_cam4_colour_bw, |
|
1555 EMbmCameraappQgn_indi_cam4_colour_bw_mask, |
|
1556 skinInstance, |
|
1557 KAknsIIDQgnIndiCam4ColourBw ); |
|
1558 break; |
|
1559 } |
|
1560 case ECamColourFilterSepia: |
|
1561 { |
|
1562 SetIconL( |
|
1563 button, |
|
1564 iconFileName, |
|
1565 EMbmCameraappQgn_indi_cam4_colour_sepia, |
|
1566 EMbmCameraappQgn_indi_cam4_colour_sepia_mask, |
|
1567 skinInstance, |
|
1568 KAknsIIDQgnIndiCam4ColourSepia ); |
|
1569 break; |
|
1570 } |
|
1571 case ECamColourFilterNegative: |
|
1572 { |
|
1573 SetIconL( |
|
1574 button, |
|
1575 iconFileName, |
|
1576 EMbmCameraappQgn_indi_cam4_colour_negative, |
|
1577 EMbmCameraappQgn_indi_cam4_colour_negative_mask, |
|
1578 skinInstance, |
|
1579 KAknsIIDQgnIndiCam4ColourNegative ); |
|
1580 break; |
|
1581 } |
|
1582 case ECamColourFilterVivid: |
|
1583 { |
|
1584 SetIconL( |
|
1585 button, |
|
1586 iconFileName, |
|
1587 EMbmCameraappQgn_indi_cam4_colour_vivid, |
|
1588 EMbmCameraappQgn_indi_cam4_colour_vivid_mask, |
|
1589 skinInstance, |
|
1590 KAknsIIDQgnIndiCam4ColourVivid ); |
|
1591 break; |
|
1592 } |
|
1593 default: |
|
1594 break; |
|
1595 } |
|
1596 } |
|
1597 |
|
1598 // --------------------------------------------------------------------------- |
|
1599 // CCamVideoPreCaptureView::UpdateVideoWhitebalanceIconsL() |
|
1600 // --------------------------------------------------------------------------- |
|
1601 // |
|
1602 void CCamVideoPreCaptureView::UpdateVideoWhitebalanceIconsL() |
|
1603 { |
|
1604 CAknButton* button = ToolbarButtonById(ECamCmdCaptureSetupWhiteBalanceVideo); |
|
1605 if(!button) |
|
1606 return; |
|
1607 MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); |
|
1608 TFileName iconFileName; |
|
1609 CamUtility::ResourceFileName( iconFileName ); |
|
1610 if ( !iController.UiConfigManagerPtr()->IsWhiteBalanceFeatureSupported() ) |
|
1611 { |
|
1612 HideButton( ECamCmdCaptureSetupWhiteBalanceVideo); |
|
1613 return; |
|
1614 } |
|
1615 TCamWhiteBalanceId wb = static_cast< TCamWhiteBalanceId > |
|
1616 ( iController.IntegerSettingValue( ECamSettingItemDynamicVideoWhiteBalance ) ); |
|
1617 |
|
1618 switch ( wb ) |
|
1619 { |
|
1620 case ECamWhiteBalanceAWB: |
|
1621 { |
|
1622 SetIconL( |
|
1623 button, |
|
1624 iconFileName, |
|
1625 EMbmCameraappQgn_indi_cam4_wb_auto, |
|
1626 EMbmCameraappQgn_indi_cam4_wb_auto_mask, |
|
1627 skinInstance, |
|
1628 KAknsIIDQgnIndiCam4WbAuto ); |
|
1629 break; |
|
1630 } |
|
1631 case ECamWhiteBalanceDaylight: |
|
1632 { |
|
1633 SetIconL( |
|
1634 button, |
|
1635 iconFileName, |
|
1636 EMbmCameraappQgn_indi_cam4_wb_sunny, |
|
1637 EMbmCameraappQgn_indi_cam4_wb_sunny_mask, |
|
1638 skinInstance, |
|
1639 KAknsIIDQgnIndiCam4WbSunny ); |
|
1640 break; |
|
1641 } |
|
1642 case ECamWhiteBalanceCloudy: |
|
1643 { |
|
1644 SetIconL( |
|
1645 button, |
|
1646 iconFileName, |
|
1647 EMbmCameraappQgn_indi_cam4_wb_cloudy, |
|
1648 EMbmCameraappQgn_indi_cam4_wb_cloudy_mask, |
|
1649 skinInstance, |
|
1650 KAknsIIDQgnIndiCam4WbCloudy ); |
|
1651 break; |
|
1652 } |
|
1653 case ECamWhiteBalanceTungsten: |
|
1654 { |
|
1655 SetIconL( |
|
1656 button, |
|
1657 iconFileName, |
|
1658 EMbmCameraappQgn_indi_cam4_wb_tungsten, |
|
1659 EMbmCameraappQgn_indi_cam4_wb_tungsten_mask, |
|
1660 skinInstance, |
|
1661 KAknsIIDQgnIndiCam4WbTungsten ); |
|
1662 break; |
|
1663 } |
|
1664 case ECamWhiteBalanceFlourescent: |
|
1665 { |
|
1666 SetIconL( |
|
1667 button, |
|
1668 iconFileName, |
|
1669 EMbmCameraappQgn_indi_cam4_wb_fluorecent, |
|
1670 EMbmCameraappQgn_indi_cam4_wb_fluorecent_mask, |
|
1671 skinInstance, |
|
1672 KAknsIIDQgnIndiCam4WbFluorecent ); |
|
1673 break; |
|
1674 } |
|
1675 default: |
|
1676 break; |
|
1677 } |
|
1678 } |
|
1679 |
|
1680 // --------------------------------------------------------------------------- |
|
1681 // CCamVideoPostCaptureView::HdmiTimerCallback |
|
1682 // --------------------------------------------------------------------------- |
|
1683 // |
|
1684 TInt CCamVideoPreCaptureView::HdmiTimerCallback( TAny* aSelf ) |
|
1685 { |
|
1686 CCamVideoPreCaptureView* self = static_cast<CCamVideoPreCaptureView*>(aSelf); |
|
1687 TInt err(0); |
|
1688 if( self ) |
|
1689 { |
|
1690 TRAP(err, self->DoHdmiTimerCallbackL() ); |
|
1691 } |
|
1692 PRINT1( _L("Camera <> CCamVideoPreCaptureView::HdmiTimerCallback err=%d"), err); |
|
1693 return err; |
|
1694 } |
|
1695 |
|
1696 // --------------------------------------------------------------------------- |
|
1697 // CCamVideoPostCaptureView::DoHdmlTimerCallbackL |
|
1698 // --------------------------------------------------------------------------- |
|
1699 // |
|
1700 void CCamVideoPreCaptureView::DoHdmiTimerCallbackL() |
|
1701 { |
|
1702 iController.HandlePostHdmiConnectDuringRecordingEventL(); |
|
1703 } |
|
1704 |
|
1705 |
|
1706 // End of File |
|