mmsharing/mmshengine/inc/musengcamerahandler.h
branchRCL_3
changeset 33 bc78a40cd63c
parent 32 73a1feb507fb
child 35 6c57ef9392d2
equal deleted inserted replaced
32:73a1feb507fb 33:bc78a40cd63c
     1 /*
       
     2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MUSHENGCAMERAHANDLER_H
       
    20 #define MUSHENGCAMERAHANDLER_H
       
    21 
       
    22 // USER
       
    23 #include "musunittesting.h"
       
    24 #include "mussettings.h"
       
    25 
       
    26 // SYSTEM
       
    27 #include <lccameracontrol.h>
       
    28 #include <lcbrightnesscontrol.h>
       
    29 #include <lczoomcontrol.h>
       
    30 #include <ecam.h>
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 class CMceCameraSource;
       
    34 class CMceSession;
       
    35 
       
    36 // CLASS
       
    37 
       
    38 class TMusEngCameraHandler :    
       
    39     public MLcCameraControl,
       
    40     public MLcBrightnessControl,
       
    41     public MLcZoomControl
       
    42     {
       
    43     MUS_UNITTEST( UT_CMusEngOutSession )
       
    44     MUS_UNITTEST( UT_CMusEngLiveSession )
       
    45     MUS_UNITTEST( UT_CMusEngTwoWaySession )
       
    46     MUS_UNITTEST( UT_CMusEngTwoWayRecvSession )
       
    47     MUS_UNITTEST( UT_TMusEngCameraHandler )       
       
    48         
       
    49     public: // From MLcCameraControl
       
    50         
       
    51         TInt LcCameraCountL();
       
    52 
       
    53         TInt CurrentLcCameraIndex();
       
    54         
       
    55         void ToggleLcCameraL();       
       
    56 
       
    57     public: // From MLcBrightnessControl
       
    58         
       
    59         TInt MinLcBrightnessL();
       
    60 
       
    61         TInt MaxLcBrightnessL();
       
    62 
       
    63         TInt LcBrightnessL();
       
    64 
       
    65         void SetLcBrightnessL( TInt aValue );
       
    66         
       
    67         void IncreaseLcBrightnessL();
       
    68         
       
    69         void DecreaseLcBrightnessL();
       
    70         
       
    71     public: // From MLcZoomControl
       
    72         
       
    73         TInt MinLcZoomL();
       
    74 
       
    75         TInt MaxLcZoomL();
       
    76 
       
    77         TInt LcZoomValueL();
       
    78 
       
    79         void SetLcZoomValueL( TInt aValue );
       
    80         
       
    81         void LcZoomInL();
       
    82         
       
    83         void LcZoomOutL();     
       
    84     
       
    85     public:
       
    86         
       
    87         /**
       
    88         * Resumes previously paused session. 
       
    89         * Continues using viewfinder and enables streaming video.
       
    90         *
       
    91         */
       
    92         void PlayL();
       
    93         
       
    94         /**
       
    95         * Pauses session.
       
    96         * Holds display and disables streaming video to network.
       
    97         *
       
    98         */
       
    99         void PauseL();
       
   100         
       
   101         /**
       
   102         * Tells whether session is paused or not
       
   103         */
       
   104         TBool IsPlayingL();
       
   105                        
       
   106     public:
       
   107         
       
   108         TMusEngCameraHandler();
       
   109         
       
   110         void SetSession( CMceSession* aSession );
       
   111         
       
   112         void InitializeL( CMceCameraSource& aCamera );
       
   113         
       
   114         void InitializeZoomStepSize();
       
   115         
       
   116         void ReadCameraUsageKeyL();
       
   117         
       
   118         TInt ZoomStepSize( TInt64& aTime );
       
   119 
       
   120     private:
       
   121     
       
   122         enum TCurrentCamera
       
   123             {
       
   124             ECameraNotAvailable = KErrNotFound,
       
   125             EBackCamera = 0, 
       
   126             EFrontCamera = 1
       
   127             };         
       
   128    
       
   129     private: // New functions
       
   130         
       
   131         TInt CamerasAvailableL( TCurrentCamera& aCurrentCamera );
       
   132 
       
   133         void ChangeCameraL( TCurrentCamera aCurrentCamera );
       
   134         
       
   135         void ChangeActiveCameraL( TCurrentCamera aNewCamera );
       
   136         
       
   137     private: // Data
       
   138         
       
   139         CMceSession* iSession; // Not owned
       
   140         
       
   141         TCameraInfo iCameraInfo;
       
   142 
       
   143         TInt iDefaultBrightness;
       
   144         
       
   145         TInt64 iZoomInTime;
       
   146         
       
   147         TInt64 iZoomOutTime;        
       
   148                       
       
   149         TInt iSmallZoomStep;
       
   150         
       
   151         TInt iBigZoomStep;
       
   152         
       
   153         TCurrentCamera iCurrentCamera;
       
   154         
       
   155         MusSettingsKeys::TUseCamera iCameraUsage;    
       
   156     };
       
   157 
       
   158 #endif
       
   159