camerauis/cameraapp/generic/src/CamVideoPreCaptureContainer.cpp
branchRCL_3
changeset 16 53c8aa5d97a3
parent 12 51dda465e618
child 17 8f559c47d7fd
equal deleted inserted replaced
15:bf64cebf4673 16:53c8aa5d97a3
    46 #ifdef OST_TRACE_COMPILER_IN_USE
    46 #ifdef OST_TRACE_COMPILER_IN_USE
    47 #include "CamVideoPreCaptureContainerTraces.h"
    47 #include "CamVideoPreCaptureContainerTraces.h"
    48 #endif
    48 #endif
    49 
    49 
    50 
    50 
       
    51 // CONSTANTS
       
    52 _LIT(KCamBitmapFile, "z:\\resource\\apps\\cameraapp.mif");
       
    53 const TSize KIconSize(35, 35);
       
    54 
       
    55 
    51 // ================= MEMBER FUNCTIONS =======================
    56 // ================= MEMBER FUNCTIONS =======================
    52 
    57 
    53 // ---------------------------------------------------------------------------
    58 // ---------------------------------------------------------------------------
    54 // CCamVideoPreCaptureContainer::NewL
    59 // CCamVideoPreCaptureContainer::NewL
    55 // Symbian OS two-phased constructor
    60 // Symbian OS two-phased constructor
    77   if ( iFeedback )
    82   if ( iFeedback )
    78       {
    83       {
    79       iFeedback->RemoveFeedbackForControl( this );
    84       iFeedback->RemoveFeedbackForControl( this );
    80       }
    85       }
    81   delete iFileTypeIndicator;
    86   delete iFileTypeIndicator;
       
    87   
       
    88   if ( iCaptureIcon )
       
    89       {
       
    90       delete iCaptureIcon;
       
    91       delete iCaptureMask;
       
    92       }
    82   PRINT( _L("Camera <= ~CCamVideoPreCaptureContainer") );
    93   PRINT( _L("Camera <= ~CCamVideoPreCaptureContainer") );
    83   }
    94   }
    84 
    95 
    85 // ---------------------------------------------------------
    96 // ---------------------------------------------------------
    86 // CCamVideoPreCaptureContainer::ConstructL
    97 // CCamVideoPreCaptureContainer::ConstructL
   148         // Get pointer of touch feedback instance 
   159         // Get pointer of touch feedback instance 
   149         iFeedback = MTouchFeedback::Instance();
   160         iFeedback = MTouchFeedback::Instance();
   150         if ( !iFeedback )
   161         if ( !iFeedback )
   151             iFeedback = MTouchFeedback::CreateInstanceL();
   162             iFeedback = MTouchFeedback::CreateInstanceL();
   152         }
   163         }
       
   164     
       
   165     // Load record icon
       
   166     AknIconUtils::CreateIconL(
       
   167              iCaptureIcon,
       
   168              iCaptureMask,
       
   169              KCamBitmapFile(),
       
   170              EMbmCameraappQgn_indi_cam4_video,
       
   171              EMbmCameraappQgn_indi_cam4_video_mask );
       
   172     AknIconUtils::SetSize( iCaptureIcon, KIconSize, EAspectRatioPreserved );
       
   173     AknIconUtils::SetSize( iCaptureMask, KIconSize, EAspectRatioPreserved );
   153     }
   174     }
   154 
   175 
   155 // ---------------------------------------------------------------------------
   176 // ---------------------------------------------------------------------------
   156 // CCamVideoPreCaptureContainer::CCamVideoPreCaptureContainer
   177 // CCamVideoPreCaptureContainer::CCamVideoPreCaptureContainer
   157 // C++ constructor
   178 // C++ constructor
   185           {
   206           {
   186           case ECamCapturing:
   207           case ECamCapturing:
   187             {
   208             {
   188             if ( iController.IsTouchScreenSupported() && iFeedback )
   209             if ( iController.IsTouchScreenSupported() && iFeedback )
   189                 {
   210                 {
   190                 iFeedback->EnableFeedbackForControl( this, EFalse );
   211                 iFeedback->SetFeedbackEnabledForThisApp( EFalse );              
   191                 }
   212                 }
   192             iRecordState = ECamRecording;
   213             iRecordState = ECamRecording;
   193             iResolutionIndicators[iCurrentIndicator]->SetRect(iResolutionIndicatorVidcapPosition);
   214             iResolutionIndicators[iCurrentIndicator]->SetRect(iResolutionIndicatorVidcapPosition);
   194             break;
   215             break;
   195             }
   216             }
   238         {
   259         {
   239         iResolutionIndicators[iCurrentIndicator]->SetRect( ResolutionIndicatorRect() );
   260         iResolutionIndicators[iCurrentIndicator]->SetRect( ResolutionIndicatorRect() );
   240         iFileTypeIndicator->SetRect( iFileTypeIndicatorPosition );
   261         iFileTypeIndicator->SetRect( iFileTypeIndicatorPosition );
   241         if ( iController.IsTouchScreenSupported() && iFeedback )
   262         if ( iController.IsTouchScreenSupported() && iFeedback )
   242             {
   263             {
   243             iFeedback->EnableFeedbackForControl( this, ETrue );
   264             iFeedback->SetFeedbackEnabledForThisApp( ETrue, ETrue );
   244             }
   265             }
   245         break;
   266         break;
   246         }
   267         }
   247     // ---------------------------------------------------
   268     // ---------------------------------------------------
   248     case ECamEventInitReady:
   269     case ECamEventInitReady:
   413     // Do nothing if already pending
   434     // Do nothing if already pending
   414     keyResponse = EKeyWasConsumed;
   435     keyResponse = EKeyWasConsumed;
   415     }
   436     }
   416   else
   437   else
   417     {
   438     {
   418     // Blank out the softkeys if we are capturing
       
   419     if ( EKeyWasConsumed == keyResponse )
       
   420       {
       
   421       BlankSoftkeysL();
       
   422       }
       
   423 
       
   424     CCamAppUi* appUi = static_cast<CCamAppUi*>( iEikonEnv->AppUi() );
   439     CCamAppUi* appUi = static_cast<CCamAppUi*>( iEikonEnv->AppUi() );
   425     
   440     
   426     // neither recording nor paused
   441     // neither recording nor paused
   427     // so attempt to start recording
   442     // so attempt to start recording
   428     PRINT( _L("Camera <> starting capture") );
   443     PRINT( _L("Camera <> starting capture") );
   429     keyResponse = appUi->StartCaptureL( aKeyEvent );
   444     keyResponse = appUi->StartCaptureL( aKeyEvent );
   430 
   445 
   431     // Hide the toolbar if we are capturing
   446     // Hide the toolbar if we are capturing
   432     if( EKeyWasConsumed == keyResponse )
   447     if( EKeyWasConsumed == keyResponse )
   433       {
   448         {
   434       // Repeated key events (MSK) are ignored.
   449         // Hide capture button if we are capturing
   435       iController.SetDemandKeyRelease( ETrue );  
   450         iCaptureButtonShown = CaptureButtonActive();    
   436 
   451         DrawNow( iCaptureRect );
   437       // fixed toolbar is used only with touch devices
   452 
   438       if ( iController.IsTouchScreenSupported() )
   453         // Repeated key events (MSK) are ignored.
       
   454         iController.SetDemandKeyRelease( ETrue );  
       
   455         
       
   456         // fixed toolbar is used only with touch devices
       
   457         if ( iController.IsTouchScreenSupported() )
   439           {
   458           {
   440           CAknToolbar* fixedToolbar = appUi->CurrentFixedToolbar();
   459           CAknToolbar* fixedToolbar = appUi->CurrentFixedToolbar();
   441           if ( fixedToolbar )
   460           if ( fixedToolbar )
   442             {
   461             {
   443             fixedToolbar->SetToolbarVisibility( EFalse );
   462             fixedToolbar->SetToolbarVisibility( EFalse );
   444             }
   463             }
   445           }
   464           }
   446       }
   465         }
   447      } 
   466     } 
   448   PRINT( _L("Camera <= CCamVideoPreCaptureContainer::HandleCaptureKeyEventL") );
   467   PRINT( _L("Camera <= CCamVideoPreCaptureContainer::HandleCaptureKeyEventL") );
   449   return keyResponse;
   468   return keyResponse;
   450   }
   469   }
   451 
   470 
   452 
   471