1720 // Sequence capture is not in progress as capture failed |
1744 // Sequence capture is not in progress as capture failed |
1721 iSequenceCaptureInProgress = EFalse; |
1745 iSequenceCaptureInProgress = EFalse; |
1722 } |
1746 } |
1723 |
1747 |
1724 PRINT1( _L("Camera <> Tried to start capture, status:%d"), capture ); |
1748 PRINT1( _L("Camera <> Tried to start capture, status:%d"), capture ); |
1725 if ( capture ) |
|
1726 { |
|
1727 if( ECamActiveCameraPrimary == iInfo.iActiveCamera |
|
1728 && iConfigManager && iConfigManager->IsCaptureToneDelaySupported() ) |
|
1729 { |
|
1730 // first cancel to make sure |
|
1731 iCaptureToneDelayTimer->Cancel(); |
|
1732 // delay playing of capture tone |
|
1733 iCaptureToneDelayTimer->StartTimer(); |
|
1734 } |
|
1735 else |
|
1736 { |
|
1737 // Play capture sound |
|
1738 PlaySound( CaptureToneId(), EFalse ); |
|
1739 } |
|
1740 } |
|
1741 } |
1749 } |
1742 // ------------------------------------------------------- |
1750 // ------------------------------------------------------- |
1743 // Not ready for a capture |
1751 // Not ready for a capture |
1744 else |
1752 else |
1745 { |
1753 { |
1862 // |
1870 // |
1863 void CCamAppController::StartVideoRecordingL() |
1871 void CCamAppController::StartVideoRecordingL() |
1864 { |
1872 { |
1865 PRINT( _L("Camera => CCamAppController::StartVideoRecordingL") ); |
1873 PRINT( _L("Camera => CCamAppController::StartVideoRecordingL") ); |
1866 __ASSERT_DEBUG( iCameraController, CamPanic( ECamPanicInvalidState ) ); |
1874 __ASSERT_DEBUG( iCameraController, CamPanic( ECamPanicInvalidState ) ); |
1867 if( ECamControllerVideo == iInfo.iMode ) |
1875 if ( ECamControllerVideo == iInfo.iMode ) |
1868 { |
1876 { |
1869 if( !iVideoRequested |
1877 CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() ); |
1870 && ECamNoOperation == iInfo.iOperation ) |
1878 if ( IntegerSettingValue( ECamSettingItemStopRecordingInHdmiMode) && |
1871 { |
1879 IsHdmiCableConnected() ) |
1872 iVideoRequested = ETrue; |
1880 { |
|
1881 appUi->HandleHdmiEventL( ECamHdmiCableConnectedBeforeRecording ); |
|
1882 return; |
|
1883 } |
|
1884 if ( !iVideoRequested |
|
1885 && ECamNoOperation == iInfo.iOperation ) |
|
1886 { |
|
1887 iVideoRequested = ETrue; |
1873 if( !iSilentProfile || iShutterSndAlwaysOn ) |
1888 if( !iSilentProfile || iShutterSndAlwaysOn ) |
1874 { |
1889 { |
1875 // Load (and play) the start video sound |
1890 // Load (and play) the start video sound |
1876 PlaySound( ECamVideoStartSoundId , ETrue ); |
1891 PlaySound( ECamVideoStartSoundId , ETrue ); |
1877 } |
1892 } |
1878 |
1893 |
1879 // initialise the array accessing values |
1894 // initialise the array accessing values |
1880 iArrayUsageCount = KVideoArrayUsers; |
1895 iArrayUsageCount = KVideoArrayUsers; |
1881 iCurrentImageIndex = 0; |
1896 iCurrentImageIndex = 0; |
1882 |
1897 |
1883 if( ECamMediaStorageCard == |
1898 if ( ECamMediaStorageCard == |
1884 IntegerSettingValue( ECamSettingItemVideoMediaStorage ) ) |
1899 IntegerSettingValue( ECamSettingItemVideoMediaStorage ) ) |
1885 { |
1900 { |
1886 TRAPD( err, ReserveFileNamesL( iInfo.iMode, ECamImageCaptureNone ) ); |
1901 TRAPD( err, ReserveFileNamesL( iInfo.iMode, ECamImageCaptureNone ) ); |
1887 if ( err ) |
1902 if ( err ) |
|
1903 { |
|
1904 PRINT( _L("Camera <> invalid MMC") ); |
|
1905 NotifyControllerObservers( ECamEventInvalidMemoryCard ); |
|
1906 |
|
1907 // If we have got here, we can't access MMC. Switch to phone memory |
|
1908 TRAP_IGNORE( ForceUsePhoneMemoryL() ); //with multiple drive support, |
|
1909 //this actually uses the internal mass memory |
|
1910 // Ignore for now, let fail when recording. |
|
1911 TRAP_IGNORE( ReserveFileNamesL( iInfo.iMode, ECamImageCaptureNone, ETrue ) ); |
|
1912 } |
|
1913 } |
|
1914 else |
|
1915 { |
|
1916 // Ignore for now, let fail when recording. |
|
1917 TRAP_IGNORE( ReserveFileNamesL( iInfo.iMode, ECamImageCaptureNone ) ); |
|
1918 } |
|
1919 |
|
1920 if( iSilentProfile && !iShutterSndAlwaysOn ) |
|
1921 { |
|
1922 PlaySoundComplete(); |
|
1923 } |
|
1924 // Remember where are we recording |
|
1925 iInitialVideoStorageLocation = static_cast<TCamMediaStorage>( |
|
1926 IntegerSettingValue( ECamSettingItemVideoMediaStorage ) ); |
|
1927 } |
|
1928 else |
1888 { |
1929 { |
1889 PRINT( _L("Camera <> invalid MMC") ); |
1930 // Video already requested or other operation busy. |
1890 NotifyControllerObservers( ECamEventInvalidMemoryCard ); |
1931 // Request ignored. |
1891 |
|
1892 // If we have got here, we can't access MMC. Switch to phone memory |
|
1893 TRAP_IGNORE( ForceUsePhoneMemoryL() ); //with multiple drive support, |
|
1894 //this actually uses the internal mass memory |
|
1895 // Ignore for now, let fail when recording. |
|
1896 TRAP_IGNORE( ReserveFileNamesL( iInfo.iMode, ECamImageCaptureNone, ETrue ) ); |
|
1897 } |
1932 } |
1898 } |
1933 } |
1899 else |
|
1900 { |
|
1901 // Ignore for now, let fail when recording. |
|
1902 TRAP_IGNORE( ReserveFileNamesL( iInfo.iMode, ECamImageCaptureNone ) ); |
|
1903 } |
|
1904 |
|
1905 if( iSilentProfile && !iShutterSndAlwaysOn ) |
|
1906 { |
|
1907 PlaySoundComplete(); |
|
1908 } |
|
1909 // Remember where are we recording |
|
1910 iInitialVideoStorageLocation = static_cast<TCamMediaStorage>( |
|
1911 IntegerSettingValue( ECamSettingItemVideoMediaStorage ) ); |
|
1912 } |
|
1913 else |
|
1914 { |
|
1915 // Video already requested or other operation busy. |
|
1916 // Request ignored. |
|
1917 } |
|
1918 } |
|
1919 // Note: The code to actually START video recording has been moved |
1934 // Note: The code to actually START video recording has been moved |
1920 // to the PlaySoundComplete function so as to only start when |
1935 // to the PlaySoundComplete function so as to only start when |
1921 // sound playback has completed. |
1936 // sound playback has completed. |
1922 } |
1937 } |
1923 |
1938 |
3406 PRINT( _L("Camera => ECamSettingItemFaceTracking") ); |
3428 PRINT( _L("Camera => ECamSettingItemFaceTracking") ); |
3407 TCamCameraSettingId cameraId( |
3429 TCamCameraSettingId cameraId( |
3408 CCamSettingConversion::Map2CameraControllerSettingId( aSettingItem ) ); |
3430 CCamSettingConversion::Map2CameraControllerSettingId( aSettingItem ) ); |
3409 iCameraController->DirectSettingsChangeL( cameraId ); |
3431 iCameraController->DirectSettingsChangeL( cameraId ); |
3410 NotifyControllerObservers( ECamEventFaceTrackingStateChanged ); |
3432 NotifyControllerObservers( ECamEventFaceTrackingStateChanged ); |
|
3433 |
|
3434 // If Face tracking was turned off by user (not forced off by a scene mode) |
|
3435 // update iPreviousFaceTrack to the current state as we are not going to |
|
3436 // reset to the previous state automatically at any point. |
|
3437 TCamSceneId scene = static_cast< TCamSceneId > |
|
3438 ( IntegerSettingValue( ECamSettingItemDynamicPhotoScene ) ); |
|
3439 |
|
3440 if ( scene != ECamSceneMacro && |
|
3441 scene != ECamSceneScenery && |
|
3442 scene != ECamSceneSports && |
|
3443 !iSceneModeForcedBySecondaryCamera ) |
|
3444 { |
|
3445 PRINT1( _L("Camera MK: Changing face tracking state -> update iPreviousFaceTrack to %d"), aSettingValue ); |
|
3446 iSettingsModel->SetPreviousFaceTrack( static_cast<TCamSettingsOnOff>( aSettingValue ) ); |
|
3447 } |
|
3448 |
3411 break; |
3449 break; |
3412 } |
3450 } |
3413 case ECamSettingItemDynamicVideoFlash: |
3451 case ECamSettingItemDynamicVideoFlash: |
3414 { |
3452 { |
3415 PRINT( _L("Camera => ECamSettingItemDynamicVideoFlash") ); |
3453 PRINT( _L("Camera => ECamSettingItemDynamicVideoFlash") ); |
4722 : iBusyFlags( EBusyNone ) |
4760 : iBusyFlags( EBusyNone ) |
4723 , iDiskCriticalLevel ( KErrNotFound ) |
4761 , iDiskCriticalLevel ( KErrNotFound ) |
4724 , iRamDiskCriticalLevel( KErrNotFound ) |
4762 , iRamDiskCriticalLevel( KErrNotFound ) |
4725 , iImageOrientation( ECamOrientation0 ) |
4763 , iImageOrientation( ECamOrientation0 ) |
4726 , iLastImageOrientation( ECamOrientation0 ) |
4764 , iLastImageOrientation( ECamOrientation0 ) |
|
4765 , iPendingHdmiEvent( ECamHdmiNoEvent ) |
4727 { |
4766 { |
4728 } |
4767 } |
4729 |
4768 |
4730 // --------------------------------------------------------------------------- |
4769 // --------------------------------------------------------------------------- |
4731 // CCamAppController::ConstructL |
4770 // CCamAppController::ConstructL |
4823 KPSUidAvkonDomain, |
4862 KPSUidAvkonDomain, |
4824 KAknKeyguardStatus ); |
4863 KAknKeyguardStatus ); |
4825 // request notifications about key lock status |
4864 // request notifications about key lock status |
4826 iKeyLockStatusWatcher->Subscribe(); |
4865 iKeyLockStatusWatcher->Subscribe(); |
4827 } |
4866 } |
|
4867 |
|
4868 iProfileStatusWatcher = CCamPropertyWatcher::NewL( *this, |
|
4869 KPSUidProfileEngine, |
|
4870 KProEngActiveProfileChanged ); |
|
4871 // request notifications about profile status |
|
4872 iProfileStatusWatcher->Subscribe(); |
|
4873 IsProfileSilent(); |
|
4874 |
4828 // read central repository value indicating whether camera shutter sound |
4875 // read central repository value indicating whether camera shutter sound |
4829 // should be played always or depending on the current profile setting |
4876 // should be played always or depending on the current profile setting |
4830 CRepository* cr = CRepository::NewLC( KCRUidCamcorderFeatures ); |
4877 CRepository* cr = CRepository::NewLC( KCRUidCamcorderFeatures ); |
4831 TInt value; |
4878 TInt value; |
4832 TInt err; |
4879 TInt err; |
8338 // tones setting to determine whether silent or not |
8393 // tones setting to determine whether silent or not |
8339 // --------------------------------------------------------------------------- |
8394 // --------------------------------------------------------------------------- |
8340 // |
8395 // |
8341 TBool CCamAppController::IsProfileSilent() |
8396 TBool CCamAppController::IsProfileSilent() |
8342 { |
8397 { |
8343 TRAPD( ignore, iSilentProfile = IsProfileSilentL() ); |
8398 if ( !iShutterSndAlwaysOn ) |
8344 if ( ignore ) |
8399 { |
8345 { |
8400 TRAPD( ignore, iSilentProfile = IsProfileSilentL() ); |
8346 } |
8401 if ( ignore ) |
8347 return iSilentProfile; |
8402 { |
|
8403 // If reading the warning tone (= camera tones) value fails |
|
8404 // we set tones off by default |
|
8405 iSilentProfile = ETrue; |
|
8406 } |
|
8407 return iSilentProfile; |
|
8408 } |
|
8409 else |
|
8410 { |
|
8411 return EFalse; |
|
8412 } |
8348 } |
8413 } |
8349 |
8414 |
8350 |
8415 |
8351 // --------------------------------------------------------------------------- |
8416 // --------------------------------------------------------------------------- |
8352 // CCamAppController::IsProfileSilentL |
8417 // CCamAppController::IsProfileSilentL |
8354 // tones setting to determine whether silent or not |
8419 // tones setting to determine whether silent or not |
8355 // --------------------------------------------------------------------------- |
8420 // --------------------------------------------------------------------------- |
8356 // |
8421 // |
8357 TBool CCamAppController::IsProfileSilentL() |
8422 TBool CCamAppController::IsProfileSilentL() |
8358 { |
8423 { |
8359 // get current keypad volume as indication of whether |
8424 // If camera tones have been set off from settings, return true here |
|
8425 if ( iSettingsModel->IntegerSettingValue( ECamSettingItemPhotoCaptureTone ) |
|
8426 == ECamSettToneOff ) |
|
8427 { |
|
8428 return ETrue; |
|
8429 } |
|
8430 |
|
8431 // Get current keypad volume as an indication of whether |
8360 // or not we have a silent profile |
8432 // or not we have a silent profile |
8361 CRepository* cr = CRepository::NewLC( KCRUidProfileEngine ); |
8433 CRepository* cr = CRepository::NewLC( KCRUidProfileEngine ); |
8362 TInt value; |
8434 TInt value; |
8363 User::LeaveIfError( cr->Get( KProEngActiveWarningTones, value ) ); |
8435 User::LeaveIfError( cr->Get( KProEngActiveWarningTones, value ) ); |
|
8436 PRINT1(_L("Camera <> CCamAppController::IsProfileSilentL() value = %d"), value) |
8364 CleanupStack::PopAndDestroy( cr ); |
8437 CleanupStack::PopAndDestroy( cr ); |
8365 |
8438 |
8366 //In case the phone variant allows turning camera tones off, |
|
8367 // first check if that is the case here. |
|
8368 if ( iSettingsModel->IntegerSettingValue( ECamSettingItemPhotoCaptureTone ) |
|
8369 == ECamSettToneOff ) |
|
8370 { |
|
8371 return ETrue; |
|
8372 } |
|
8373 |
|
8374 return ( value == 0 ); |
8439 return ( value == 0 ); |
8375 } |
8440 } |
8376 |
8441 |
8377 |
8442 |
8378 // --------------------------------------------------------------------------- |
8443 // --------------------------------------------------------------------------- |
11361 NotifyControllerObservers( ECamEventSnapshotRotated ); |
11433 NotifyControllerObservers( ECamEventSnapshotRotated ); |
11362 } |
11434 } |
11363 PRINT( _L( "Camera <= CCamAppController::SnapshotRotationComplete" ) ); |
11435 PRINT( _L( "Camera <= CCamAppController::SnapshotRotationComplete" ) ); |
11364 } |
11436 } |
11365 |
11437 |
11366 |
11438 // --------------------------------------------------------------------------- |
|
11439 // CCamAppController::HandleTvAccessoryConnectedL |
|
11440 // |
|
11441 // --------------------------------------------------------------------------- |
|
11442 // |
|
11443 void CCamAppController::HandleTvAccessoryConnectedL() |
|
11444 { |
|
11445 PRINT(_L("Camera => CCamAppController::HandleTvAccessoryConnectedL ")); |
|
11446 if( IntegerSettingValue( ECamSettingItemStopRecordingInHdmiMode) |
|
11447 && IsHdmiCableConnected() ) |
|
11448 { |
|
11449 if( ECamCapturing == iInfo.iOperation || |
|
11450 ECamPaused == iInfo.iOperation ) |
|
11451 { |
|
11452 CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() ); |
|
11453 iHdmiCableConnectedDuringRecording = ETrue; |
|
11454 TVwsViewId activeView; |
|
11455 if ( appUi->GetActiveViewId( activeView ) == KErrNone ) |
|
11456 { |
|
11457 if( ECamViewIdVideoPreCapture == activeView.iViewUid.iUid ) |
|
11458 { |
|
11459 CCamVideoPreCaptureView* view = static_cast<CCamVideoPreCaptureView*>( appUi->View( activeView.iViewUid ) ); |
|
11460 view->HandleCommandL( ECamCmdStop ); |
|
11461 } |
|
11462 } |
|
11463 } |
|
11464 } |
|
11465 PRINT(_L("Camera <= CCamAppController::HandleTvAccessoryConnectedL ")); |
|
11466 } |
|
11467 |
|
11468 // --------------------------------------------------------------------------- |
|
11469 // CCamAppController::HandleTvAccessoryConnectedL |
|
11470 // |
|
11471 // --------------------------------------------------------------------------- |
|
11472 // |
|
11473 void CCamAppController::HandleTvAccessoryDisconnectedL() |
|
11474 { |
|
11475 |
|
11476 } |
|
11477 |
|
11478 // --------------------------------------------------------------------------- |
|
11479 // CCamAppController::IsHdmiCableConnected |
|
11480 // |
|
11481 // --------------------------------------------------------------------------- |
|
11482 // |
|
11483 TBool CCamAppController::IsHdmiCableConnected() |
|
11484 { |
|
11485 return iTvAccessoryMonitor->IsHdmiCableConnected(); |
|
11486 } |
11367 // End of File |
11487 // End of File |
11368 |
11488 |
|
11489 |
|
11490 // --------------------------------------------------------------------------- |
|
11491 // CCamAppController::RemainingVideoRecordingTime |
|
11492 // |
|
11493 // --------------------------------------------------------------------------- |
|
11494 // |
|
11495 TTimeIntervalMicroSeconds CCamAppController::RemainingVideoRecordingTime() |
|
11496 { |
|
11497 return iCameraController->RemainingVideoRecordingTime(); |
|
11498 } |
|
11499 |
|
11500 // --------------------------------------------------------------------------- |
|
11501 // CCamAppController::HandlePostHdmiConnectDuringRecordingEventL |
|
11502 // |
|
11503 // --------------------------------------------------------------------------- |
|
11504 // |
|
11505 void CCamAppController::HandlePostHdmiConnectDuringRecordingEventL() |
|
11506 { |
|
11507 if( iHdmiCableConnectedDuringRecording == TBool(ETrue) ) |
|
11508 { |
|
11509 iHdmiCableConnectedDuringRecording = EFalse; |
|
11510 CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() ); |
|
11511 appUi->HandleHdmiEventL( ECamHdmiCableConnectedDuringRecording ); |
|
11512 } |
|
11513 } |
|
11514 |
|
11515 |
|
11516 // --------------------------------------------------------------------------- |
|
11517 // CCamAppController::SetPendingHdmiEvent |
|
11518 // |
|
11519 // --------------------------------------------------------------------------- |
|
11520 // |
|
11521 void CCamAppController::SetPendingHdmiEvent( TCamHdmiEvent aPendingHdmiEvent ) |
|
11522 { |
|
11523 iPendingHdmiEvent = aPendingHdmiEvent; |
|
11524 } |
|
11525 |
|
11526 |
|
11527 // --------------------------------------------------------------------------- |
|
11528 // CCamAppController::HandlePendingHdmiEvent |
|
11529 // |
|
11530 // --------------------------------------------------------------------------- |
|
11531 // |
|
11532 void CCamAppController::HandlePendingHdmiEvent() |
|
11533 { |
|
11534 if( iPendingHdmiEvent != ECamHdmiNoEvent ) |
|
11535 { |
|
11536 CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() ); |
|
11537 appUi->HandleHdmiEventL( iPendingHdmiEvent ); |
|
11538 iPendingHdmiEvent = ECamHdmiNoEvent; |
|
11539 } |
|
11540 } |
|
11541 |
|
11542 |
|
11543 // --------------------------------------------------------------------------- |
|
11544 // CCamAppController::HandleSecondaryCameraExit |
|
11545 // |
|
11546 // Place here any extra things that need to be done when |
|
11547 // exiting camera app. in secondary camera mode |
|
11548 // --------------------------------------------------------------------------- |
|
11549 // |
|
11550 void CCamAppController::HandleSecondaryCameraExitL() |
|
11551 { |
|
11552 PRINT( _L( "Camera => CCamAppController::HandleSecondaryCameraExit" ) ); |
|
11553 |
|
11554 // Scene mode and face tracking issues ---> |
|
11555 CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() ); |
|
11556 // Do a switch to primary camera. |
|
11557 appUi->HandleCommandL( ECamCmdSwitchCamera ); |
|
11558 // Set correct settings for primary camera. |
|
11559 SetDynamicSettingsToDefaults(); |
|
11560 // Check if "User" scene mode should be on. |
|
11561 iSettingsModel->SetUserSceneDefault(); |
|
11562 // PhotoSceneHasChangedL() needs to be called to |
|
11563 // get also face tracking to the correct state. |
|
11564 iSettingsModel->PhotoSceneHasChangedL( IntegerSettingValue( ECamSettingItemDynamicPhotoScene ) ); |
|
11565 // StoreFaceTrackingValue() does nothing in 2ndary camera mode. |
|
11566 // (Because scene mode is forced to Auto while in 2ndary camera.) |
|
11567 // -> Always save face tracking state when exiting from 2ndary cam. |
|
11568 SetIntegerSettingValueL( ECamSettingItemFaceTracking, iSettingsModel->GetPreviousFaceTrack() ); |
|
11569 // <--- Scene mode and face tracking issues |
|
11570 |
|
11571 PRINT( _L( "Camera <= CCamAppController::HandleSecondaryCameraExit" ) ); |
|
11572 } |
|
11573 |
|
11574 // --------------------------------------------------------------------------- |
|
11575 // CCamAppController::SceneModeForcedBySecondaryCamera |
|
11576 // |
|
11577 // --------------------------------------------------------------------------- |
|
11578 // |
|
11579 TBool CCamAppController::SceneModeForcedBySecondaryCamera() |
|
11580 { |
|
11581 return iSceneModeForcedBySecondaryCamera; |
|
11582 } |
|
11583 |
|
11584 // End of File |
|
11585 |