camerauis/cameraapp/generic/src/CamSelfTimer.cpp
changeset 0 1ddebce53859
child 13 38fb6f7eacd5
equal deleted inserted replaced
-1:000000000000 0:1ddebce53859
       
     1 /*
       
     2 * Copyright (c) 2007-2008 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:  Provides the flashing icon/LED & timing capability of the*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <e32base.h>
       
    21 #include <e32std.h>
       
    22 #include <eikbtgpc.h>
       
    23 #include <cameraapp.rsg>
       
    24 #include <vgacamsettings.rsg>
       
    25 #include "CamSelfTimer.h"
       
    26 #include "CamPanic.h"
       
    27 #include "CamAppUi.h"
       
    28 #include "CamUtility.h"
       
    29 #include "Cam.hrh"  // For ECamSelfTimerSoundId def
       
    30 #include "OstTraceDefinitions.h"
       
    31 #ifdef OST_TRACE_COMPILER_IN_USE
       
    32 #include "CamSelfTimerTraces.h"
       
    33 #endif
       
    34 
       
    35 // CONSTANTS
       
    36 const TInt    KCamSelfTimerToneHz  = 1760;         
       
    37 const TReal32 KCamSelfTimerToneVol = 0.75f;    
       
    38 
       
    39 
       
    40 // MACROS
       
    41 
       
    42 // LOCAL CONSTANTS AND MACROS
       
    43 
       
    44 // MODULE DATA STRUCTURES
       
    45 
       
    46 // LOCAL FUNCTION PROTOTYPES
       
    47 
       
    48 // FORWARD DECLARATIONS
       
    49 
       
    50 // ============================= LOCAL FUNCTIONS ===============================
       
    51 
       
    52 
       
    53 
       
    54 
       
    55 // ============================ MEMBER FUNCTIONS ===============================
       
    56 
       
    57 // -----------------------------------------------------------------------------
       
    58 // CCamSelfTimer::NewL
       
    59 // Two-phased constructor.
       
    60 // -----------------------------------------------------------------------------
       
    61 //
       
    62 CCamSelfTimer* CCamSelfTimer::NewL( CCamAppController& aController )
       
    63     {
       
    64     CCamSelfTimer* self = new( ELeave ) CCamSelfTimer( aController );
       
    65     CleanupStack::PushL( self );
       
    66     self->ConstructL();
       
    67     CleanupStack::Pop( self );
       
    68     return self;
       
    69     }
       
    70 
       
    71     
       
    72 // Destructor
       
    73 CCamSelfTimer::~CCamSelfTimer()
       
    74   {
       
    75   PRINT( _L("Camera => ~CCamSelfTimer") );
       
    76   // If self-timer is active, stop it
       
    77   if ( IsActive() )
       
    78       {
       
    79       Cancel();
       
    80       }
       
    81 
       
    82   // close up observers array
       
    83   iObservers.Close();
       
    84 
       
    85   delete iPeriodicTimer;    
       
    86   PRINT( _L("Camera <= ~CCamSelfTimer") );
       
    87   }
       
    88 
       
    89 // -----------------------------------------------------------------------------
       
    90 // CCamSelfTimer::StartSelfTimer
       
    91 // Will be called to start self timer.  If self timer is already running, the 
       
    92 // timer is cancelled and the capture operation is run immediately.
       
    93 // -----------------------------------------------------------------------------
       
    94 //
       
    95 void CCamSelfTimer::StartSelfTimer()
       
    96   {
       
    97   // Check it is not already running
       
    98   if ( ECamSelfTimerStandby == iState )
       
    99     {
       
   100     ChangeState( ECamSelfTimerActive1 );
       
   101     }
       
   102   // If the timer is already running, then we must cancel the timer
       
   103   // and do the capture operation now!
       
   104   else  
       
   105     { 
       
   106     // Cancel the timer
       
   107     Cancel();
       
   108 
       
   109     if( ECamControllerImage == iMode )
       
   110       {
       
   111       switch ( iImageMode )
       
   112         {
       
   113         case ECamImageCaptureBurst:
       
   114         case ECamImageCaptureTimeLapse:
       
   115           {
       
   116           // Start the autofocus operation now, the capture will be queued
       
   117           // after focus completes
       
   118           OstTrace0( CAMERAAPP_PERFORMANCE, DUP7_CCAMSELFTIMER_STARTSELFTIMER, "e_CAM_APP_AF 1" );
       
   119           iController.StartAutoFocus();
       
   120           // Softkeys are blank/cancel if doing burst capture
       
   121           // but cancel means cancel ongoing burst, not cancel self-timer
       
   122           // replace the buttons with the correct command set
       
   123           CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() );
       
   124           if ( appUi )
       
   125             {
       
   126             // blank the softkeys in preparation for capture
       
   127             TRAP_IGNORE( appUi->SetSoftKeysL( R_CAM_SOFTKEYS_BLANK_STOP ) );
       
   128             }
       
   129           }
       
   130           //lint -fallthrough
       
   131         case ECamImageCaptureSingle: 
       
   132           {
       
   133           // If still Self-Timer is interrupted, take the photo NOW.
       
   134           // If we were in multi-shot, this capture is queued
       
   135           OstTrace0( CAMERAAPP_PERFORMANCE, CCAMSELFTIMER_STARTSELFTIMER, "e_CAM_APP_SHOT_TO_SNAPSHOT 1" );
       
   136           OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMSELFTIMER_STARTSELFTIMER, "e_CAM_PRI_SHOT_TO_SNAPSHOT 1" );
       
   137           OstTrace0( CAMERAAPP_PERFORMANCE, DUP2_CCAMSELFTIMER_STARTSELFTIMER, "e_CAM_PRI_SHOT_TO_SAVE 1" );
       
   138           OstTrace0( CAMERAAPP_PERFORMANCE, DUP3_CCAMSELFTIMER_STARTSELFTIMER, "e_CAM_PRI_SHOT_TO_SHOT 1" );
       
   139           OstTrace0( CAMERAAPP_PERFORMANCE, DUP4_CCAMSELFTIMER_STARTSELFTIMER, "e_CAM_APP_SHOT_TO_STILL 1" );
       
   140           OstTrace0( CAMERAAPP_PERFORMANCE, DUP5_CCAMSELFTIMER_STARTSELFTIMER, "e_CAM_APP_CAPTURE_START 1" );
       
   141           OstTrace0( CAMERAAPP_PERFORMANCE, DUP6_CCAMSELFTIMER_STARTSELFTIMER, "e_CAM_PRI_SERIAL_SHOOTING 1" );
       
   142 
       
   143           iController.Capture();
       
   144           break;
       
   145           }
       
   146         default:
       
   147           break;
       
   148         }
       
   149       }
       
   150     else
       
   151       {
       
   152       // Start recording now
       
   153       TRAP_IGNORE( iController.StartVideoRecordingL() );
       
   154       }
       
   155     }
       
   156   }
       
   157 
       
   158 // -----------------------------------------------------------------------------
       
   159 // CCamSelfTimer::SetModeL
       
   160 // Called when the current capture method (Video or Still) changes.
       
   161 // Updates the internal state (so correct capture method is called when self
       
   162 // timer expires) and if timer is already running, cancels the outstanding
       
   163 // timer (as the view has changed).
       
   164 // -----------------------------------------------------------------------------
       
   165 //
       
   166 void CCamSelfTimer::SetModeL( TCamCameraMode         aMode, 
       
   167                              TCamImageCaptureMode   aImageMode,
       
   168                              TCamSelfTimerFunctions aFunc )
       
   169   {
       
   170   iMode      = aMode;
       
   171   iImageMode = aImageMode;
       
   172   
       
   173   // Based on the supplied selftimer function (specifying periods) load the 
       
   174   // individual data from PSI.
       
   175   TPckgBuf <TSelfTimerSetting> pckg;
       
   176   
       
   177   TInt ret = KErrNone;
       
   178   switch ( aFunc )
       
   179     {
       
   180     case ECamSelfTimerMode1:
       
   181       ret = CamUtility::GetPsiAnyL( ECamPsiSelfTimerPeriod1, &pckg );
       
   182       break;
       
   183     case ECamSelfTimerMode2:
       
   184       ret = CamUtility::GetPsiAnyL( ECamPsiSelfTimerPeriod2, &pckg );
       
   185       break;
       
   186     case ECamSelfTimerMode3:
       
   187       ret = CamUtility::GetPsiAnyL( ECamPsiSelfTimerPeriod3, &pckg );
       
   188       break;            
       
   189     case ECamSelfTimerDisabled:
       
   190       //Fall-through
       
   191     default:
       
   192       break;
       
   193     }
       
   194   // Check it is supported.  
       
   195   __ASSERT_ALWAYS( ret == KErrNone, CamPanic( ECamPanicUnhandledCommand ) );
       
   196 
       
   197   iSettings = pckg();
       
   198   // Set time remaining and update observers.
       
   199   iTimeRemaining = iSettings.iThreshold[ECamSelfTimerMode1];    
       
   200   NotifyObservers( ECamSelfTimerEventTimerOn );
       
   201   }
       
   202 
       
   203 // -----------------------------------------------------------------------------
       
   204 // CCamSelfTimer::Cancel
       
   205 // Cancels the timer if already running, and returns the self timer to 
       
   206 // self-timer standby state.
       
   207 // -----------------------------------------------------------------------------
       
   208 //
       
   209 void CCamSelfTimer::Cancel()
       
   210     {
       
   211     ChangeState( ECamSelfTimerStandby );
       
   212     }
       
   213 
       
   214 // -----------------------------------------------------------------------------
       
   215 // CCamSelfTimer::IsActive
       
   216 // Returns whether or not the SelfTimer is currently active (counting down)
       
   217 // -----------------------------------------------------------------------------
       
   218 //
       
   219 TBool CCamSelfTimer::IsActive()
       
   220     {
       
   221     if ( iState == ECamSelfTimerStandby )
       
   222         {
       
   223         return EFalse;
       
   224         }
       
   225     else
       
   226         {
       
   227         return ETrue;        
       
   228         }           
       
   229     }
       
   230 
       
   231 // -----------------------------------------------------------------------------
       
   232 // CCamSelfTimer::CCamSelfTimer
       
   233 // C++ default constructor can NOT contain any code, that
       
   234 // might leave.
       
   235 // -----------------------------------------------------------------------------
       
   236 //
       
   237 CCamSelfTimer::CCamSelfTimer( CCamAppController& aController ) :                                 
       
   238                                  iState( ECamSelfTimerStandby ),
       
   239                                  iController( aController )
       
   240     {                                     
       
   241     iCallback = TCallBack( TimerCallback, this );
       
   242     }
       
   243 
       
   244 // -----------------------------------------------------------------------------
       
   245 // CCamSelfTimer::ConstructL
       
   246 // Symbian 2nd phase constructor can leave.
       
   247 // -----------------------------------------------------------------------------
       
   248 //
       
   249 void CCamSelfTimer::ConstructL()
       
   250     {
       
   251     iPeriodicTimer = CPeriodic::NewL( CActive::EPriorityHigh );    
       
   252     }
       
   253 
       
   254 // -----------------------------------------------------------------------------
       
   255 // CCamSelfTimer::ChangeState
       
   256 // Called to move between the internal self-timer states.
       
   257 // -----------------------------------------------------------------------------
       
   258 //
       
   259 void CCamSelfTimer::ChangeState( TCamSelfTimer aState )
       
   260     {  
       
   261     // if the timer object has not been created
       
   262     __ASSERT_DEBUG( iPeriodicTimer != NULL, CamPanic( ECamPanicNullPointer ) );
       
   263 
       
   264     // If the state has been changed
       
   265     iState = aState;
       
   266 
       
   267     switch ( iState )
       
   268         {
       
   269         case ECamSelfTimerActive1:
       
   270             iController.StopIdleTimer(); // no standby mode if time is running
       
   271             iIndication = ETrue;
       
   272             //lint -fallthrough
       
   273         case ECamSelfTimerActive2:
       
   274         case ECamSelfTimerActive3:
       
   275             iTimeRemaining = iSettings.iThreshold[iState];    
       
   276             // Use smallest time period as tick period. This assumes that
       
   277             // smallest time period is divisble into larger time period.
       
   278             iTimerTickPeriod = iSettings.iFlashPeriod[iState];    // Need half-periods
       
   279             if ( iTimerTickPeriod.Int() > iSettings.iBeepPeriod[iState] )
       
   280                 {
       
   281                 iTimerTickPeriod = iSettings.iBeepPeriod[iState];
       
   282                 }
       
   283             
       
   284             if ( iTimerTickPeriod.Int() == KMaxTInt ) // If state is timer based (always on)
       
   285               {
       
   286               iIndication = ETrue;
       
   287               iPeriodicTimer->Cancel();
       
   288               iTimerTickPeriod = iTimeRemaining;// Force period to be time left
       
   289 
       
   290               // Reschedule the timer to go off when the remaining time has completed
       
   291               iPeriodicTimer->Start( iTimeRemaining, iTimeRemaining, iCallback );
       
   292               }
       
   293             else if ( iTimerTickPeriod.Int() == 0 ) // Always off
       
   294               {
       
   295               iIndication = EFalse;
       
   296               iPeriodicTimer->Cancel();
       
   297               iTimerTickPeriod = iTimeRemaining;// Force period to be time left
       
   298 
       
   299               // Reschedule the timer to go off when the remaining time has completed
       
   300               iPeriodicTimer->Start( iTimeRemaining, iTimeRemaining, iCallback );
       
   301               }
       
   302             else if ( iTimerTickPeriod.Int() != KErrNotSupported )    // This is a valid period
       
   303               {
       
   304               TInt period = iTimerTickPeriod.Int();
       
   305               iPeriodicTimer->Cancel();
       
   306               iPeriodicTimer->Start( period, period, iCallback );
       
   307               }
       
   308             // otherwise, do nothing
       
   309             else
       
   310               {
       
   311               // empty statement to remove Lint error.
       
   312               }
       
   313             
       
   314             // Check if we need to start autofocus
       
   315             if ( iSettings.iAutoFocus != KErrNotSupported && 
       
   316                  iTimeRemaining.Int() == iSettings.iAutoFocus )
       
   317               {
       
   318               if ( ECamControllerVideo != iMode )
       
   319                 {
       
   320                 // Start the AutoFocus operation
       
   321                 OstTrace0( CAMERAAPP_PERFORMANCE, CCAMSELFTIMER_CHANGESTATE, "e_CAM_APP_AF 1" );
       
   322                 iController.StartAutoFocus();
       
   323                 }
       
   324               }
       
   325             DoIndication( iIndication );
       
   326             break;
       
   327         
       
   328         case ECamSelfTimerStandby:           
       
   329             iPeriodicTimer->Cancel();
       
   330             if ( !iController.IsSlideInSelfTimerPreview() )
       
   331               {
       
   332               iController.SetDynamicSettingToDefault(ECamSettingItemDynamicSelfTimer);
       
   333               }
       
   334             NotifyObservers( ECamSelfTimerEventTimerOff );
       
   335             break;
       
   336 
       
   337         default:
       
   338             break;
       
   339         }    
       
   340     }
       
   341 
       
   342 // -----------------------------------------------------------------------------
       
   343 // TimerCallback Callback used for self timer class to be informed of periodic
       
   344 // timer events
       
   345 // Returns: TInt: KErrNone if successful.
       
   346 // -----------------------------------------------------------------------------
       
   347 //
       
   348 TInt CCamSelfTimer::TimerCallback( TAny* aPtr )
       
   349     {
       
   350     CCamSelfTimer* timer = static_cast< CCamSelfTimer* >( aPtr );
       
   351     __ASSERT_DEBUG( timer != NULL, CamPanic( ECamPanicNullPointer ) ); 
       
   352 
       
   353     timer->Tick();        
       
   354 
       
   355     return KErrNone;
       
   356     }
       
   357 
       
   358 // -----------------------------------------------------------------------------
       
   359 // CCamSelfTimer::Tick
       
   360 // Called when the periodic timer "ticks", used to 
       
   361 // -----------------------------------------------------------------------------
       
   362 //
       
   363 void CCamSelfTimer::Tick()
       
   364   {
       
   365   PRINT(_L("Camera => CCamSelfTimer::Tick()"));    
       
   366   // Adjust the time remaining
       
   367   iTimeRemaining = iTimeRemaining.Int() - iTimerTickPeriod.Int();
       
   368 
       
   369   // Adjust the time elapsed since last beep and indicator state change.
       
   370   iTimeElapsedSinceIndication += iTimerTickPeriod.Int();
       
   371 
       
   372   // Adjust the indicator state if necessary.
       
   373   __ASSERT_DEBUG( iState < ECamSelfTimerStandby, CamPanic( ECamPanicUnhandledCreateSettingItem ) );
       
   374   if ( iTimeElapsedSinceIndication >= iSettings.iFlashPeriod[iState] )
       
   375     {
       
   376     iIndication = !iIndication;
       
   377     iTimeElapsedSinceIndication = 0;
       
   378     }
       
   379   
       
   380   // If we have reached the end of the timer period...
       
   381   if ( iTimeRemaining == TTimeIntervalMicroSeconds32( 0 ) )
       
   382     {
       
   383     // Cancel the timer, reset internal state.
       
   384     Cancel();
       
   385 
       
   386     // The Controller takes care of the synchronisation of this.
       
   387     // If AutoFocus is complete, start Capture now
       
   388     // If AutoFocus still ongoing, it will wait until autofocus is 
       
   389     // complete THEN Capture.
       
   390     if ( ECamControllerImage == iMode )
       
   391       {  
       
   392       CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() );
       
   393       if( appUi )
       
   394         {
       
   395         // Blank all softkeys if doing still capture
       
   396         if ( iImageMode == ECamImageCaptureSingle )
       
   397           {
       
   398           // blank the softkeys in preparation for capture
       
   399           TRAP_IGNORE( appUi->SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ) );
       
   400           }
       
   401                 
       
   402         // Softkeys are blank/cancel if doing burst capture
       
   403         // but cancel means cancel ongoing burst, not cancel self-timer        
       
   404         else if ( ECamImageCaptureBurst     == iImageMode 
       
   405                || ECamImageCaptureTimeLapse == iImageMode )
       
   406           {
       
   407           // blank the softkeys in preparation for capture
       
   408           TRAP_IGNORE( appUi->SetSoftKeysL( R_CAM_SOFTKEYS_BLANK_STOP ) )
       
   409           }
       
   410         }
       
   411 
       
   412       // Ensure everything is OFF
       
   413       DoIndication( EFalse );
       
   414 
       
   415       // Do capture
       
   416       OstTrace0( CAMERAAPP_PERFORMANCE, CCAMSELFTIMER_TICK, "e_CAM_APP_SHOT_TO_SNAPSHOT 1" );
       
   417       OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMSELFTIMER_TICK, "e_CAM_PRI_SHOT_TO_SNAPSHOT 1" );
       
   418       OstTrace0( CAMERAAPP_PERFORMANCE, DUP2_CCAMSELFTIMER_TICK, "e_CAM_PRI_SHOT_TO_SAVE 1" );
       
   419       OstTrace0( CAMERAAPP_PERFORMANCE, DUP3_CCAMSELFTIMER_TICK, "e_CAM_PRI_SHOT_TO_SHOT 1" );
       
   420       OstTrace0( CAMERAAPP_PERFORMANCE, DUP4_CCAMSELFTIMER_TICK, "e_CAM_APP_SHOT_TO_STILL 1" );
       
   421       OstTrace0( CAMERAAPP_PERFORMANCE, DUP5_CCAMSELFTIMER_TICK, "e_CAM_APP_CAPTURE_START 1" );
       
   422       OstTrace0( CAMERAAPP_PERFORMANCE, DUP6_CCAMSELFTIMER_TICK, "e_CAM_PRI_SERIAL_SHOOTING 1" );
       
   423 
       
   424       iController.Capture();
       
   425       }
       
   426     else // video mode
       
   427       {   
       
   428       TRAP_IGNORE( iController.StartVideoRecordingL() )
       
   429       }            
       
   430     }
       
   431 
       
   432   // The timer is ongoing
       
   433   else 
       
   434     {
       
   435     TInt remaining = iTimeRemaining.Int();
       
   436     // Work out if we need to change period.
       
   437     if ( remaining        == iSettings.iThreshold[ECamSelfTimerActive2] 
       
   438       && KErrNotSupported != iSettings.iThreshold[ECamSelfTimerActive2] )
       
   439       {
       
   440       ChangeState( ECamSelfTimerActive2 );
       
   441       }
       
   442     else if ( remaining        == iSettings.iThreshold[ECamSelfTimerActive3] 
       
   443            && KErrNotSupported != iSettings.iThreshold[ECamSelfTimerActive3])
       
   444       {
       
   445       ChangeState( ECamSelfTimerActive3 );
       
   446       }
       
   447     else
       
   448       {
       
   449       // Update the indicators (done as part of change state as well)
       
   450       DoIndication( iIndication );
       
   451       }
       
   452   
       
   453     // Check if we need to start autofocus
       
   454     if ( KErrNotFound != iSettings.iAutoFocus 
       
   455       && remaining    == iSettings.iAutoFocus )
       
   456       {
       
   457       if ( ECamControllerImage == iMode )
       
   458         {
       
   459         // Start the AutoFocus operation
       
   460         OstTrace0( CAMERAAPP_PERFORMANCE, DUP7_CCAMSELFTIMER_TICK, "e_CAM_APP_AF 1" );
       
   461         iController.StartAutoFocus();
       
   462         }
       
   463       }
       
   464     }
       
   465   PRINT(_L("Camera <= CCamSelfTimer::Tick()"));    
       
   466   }
       
   467 
       
   468 // -----------------------------------------------------------------------------
       
   469 // CCamSelfTimer::DoIndication
       
   470 // Send event to self timer observers
       
   471 // -----------------------------------------------------------------------------
       
   472 //                    
       
   473 void CCamSelfTimer::DoIndication( TBool aOn )
       
   474     {
       
   475     iIndication = aOn;
       
   476 
       
   477     if ( aOn )        
       
   478         {        
       
   479         NotifyObservers( ECamSelfTimerEventTimerOn );
       
   480         iController.PlayTone( KCamSelfTimerToneHz, iTimerTickPeriod.Int()/2, KCamSelfTimerToneVol, EFalse );
       
   481         }
       
   482     else
       
   483         {
       
   484         NotifyObservers( ECamSelfTimerEventTimerOff );
       
   485         }
       
   486     }
       
   487 
       
   488 // -----------------------------------------------------------------------------
       
   489 // CCamSelfTimer::AddObserverL
       
   490 // Add a self timer observer 
       
   491 // -----------------------------------------------------------------------------
       
   492 //
       
   493 void CCamSelfTimer::AddObserverL( const MCamSelfTimerObserver* aObserver )
       
   494     {
       
   495     User::LeaveIfError( iObservers.Append( aObserver ) );
       
   496     }
       
   497 
       
   498 // -----------------------------------------------------------------------------
       
   499 // CCamSelfTimer::RemoveObserver
       
   500 // Remove a self timer observer
       
   501 // -----------------------------------------------------------------------------
       
   502 //
       
   503 void CCamSelfTimer::RemoveObserver( const MCamSelfTimerObserver* aObserver )
       
   504     {
       
   505     TInt i;
       
   506     TInt numobservers = iObservers.Count();
       
   507     for ( i = 0; i < numobservers; i++ )
       
   508         {
       
   509         // if the observer is the one to remove
       
   510         if ( iObservers[i] == aObserver )
       
   511             {
       
   512             iObservers.Remove( i );
       
   513             return;
       
   514             }
       
   515         }
       
   516     }
       
   517 
       
   518 // -----------------------------------------------------------------------------
       
   519 // CCamSelfTimer::NotifyObservers
       
   520 // Send self timer event to observers
       
   521 // -----------------------------------------------------------------------------
       
   522 //
       
   523 void CCamSelfTimer::NotifyObservers( TCamSelfTimerEvent aEvent )
       
   524     {
       
   525     const TInt KMicroSecsPerSec = 1000000;
       
   526     TInt timeRem = iTimeRemaining.Int() / KMicroSecsPerSec;
       
   527     TInt i;
       
   528     TInt numobservers = iObservers.Count();
       
   529     for ( i = 0; i < numobservers; i++ )
       
   530         {
       
   531         iObservers[i]->HandleSelfTimerEvent( aEvent, timeRem );
       
   532         }
       
   533     }
       
   534 
       
   535 //  End of File