mmserv/audioeffectsui/equalizer/inc/EqualizerFreqBand.h
changeset 16 43d09473c595
parent 14 80975da52420
child 22 128eb6a32b84
equal deleted inserted replaced
14:80975da52420 16:43d09473c595
     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:    Declares classes related to Equalizer Settings
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef EQUALIZERFREQBAND_H
       
    22 #define EQUALIZERFREQBAND_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <AknDialog.h> 
       
    26 #include "EqualizerPrivateConstants.h"
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CAudioEqualizerUtility;
       
    30 class CAudioEqualizer;
       
    31 
       
    32 // CLASS DECLARATIONS
       
    33 
       
    34 NONSHARABLE_CLASS(CEqualizerFreqBand)  : public CCoeControl
       
    35     {
       
    36     public:      // Constructors and destructor
       
    37         /**
       
    38         * This function is called to create an object of 
       
    39         * type CEqualizerFreqBand - Two phase Construction
       
    40         * @since 3.0
       
    41         * @param aaEqEditingDialog a reference to CEqualizerEditingDialog
       
    42         * @param aAudEqUtility a reference to CAudioEqualizerUtility 
       
    43         * @param aPresetIndex the index of the Preset being edited
       
    44         * @param aIsActivePreset whether the preset is active or not?
       
    45         * @param aBandIndex the index of the Frequncy band
       
    46         * @param aContainerRect the CEqualizerFreqBandContainer rectangle
       
    47         */
       
    48         static CEqualizerFreqBand* NewL(CEqualizerEditingDialog* aEqEditingDialog,
       
    49          CAudioEqualizerUtility*& aAudEqUtility, 
       
    50          const TInt aPresetIndex, const TBool aIsActivePreset, const TInt aBandIndex, 
       
    51          TRect& aContainerRect);
       
    52         /**
       
    53         * This function is called to create an object of 
       
    54         * type CEqualizerFreqBand - Two phase Construction
       
    55         * @since 3.0
       
    56         * @param aaEqEditingDialog a reference to CEqualizerEditingDialog
       
    57         * @param aAudEqUtility a reference to CAudioEqualizerUtility 
       
    58         * @param aPresetIndex the index of the Preset being edited
       
    59         * @param aIsActivePreset whether the preset is active or not?
       
    60         * @param aBandIndex the index of the Frequncy band
       
    61         * @param aContainerRect the CEqualizerFreqBandContainer rectangle
       
    62         */
       
    63         static CEqualizerFreqBand* NewLC(CEqualizerEditingDialog* aEqEditingDialog,
       
    64          CAudioEqualizerUtility*& aAudEqUtility, 
       
    65          const TInt aPresetIndex, const TBool aIsActivePreset, const TInt aBandIndex, 
       
    66          TRect& aContainerRect);
       
    67         /**
       
    68         * Destructor
       
    69         * @since 3.0
       
    70         */
       
    71         virtual ~CEqualizerFreqBand();
       
    72 
       
    73     public:     // Functions from base classes 
       
    74         /**
       
    75         * From CCoeControl Called when user presses a key
       
    76         */
       
    77         TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,
       
    78            TEventCode aType);
       
    79     
       
    80     public:
       
    81     
       
    82 		/**
       
    83 		* Function to return the Rect of the controls from the 
       
    84 		* layout [read from the CDL file].
       
    85 		* TRect aRect :  parent controls rect
       
    86 		* TInt aVariety : equalizer variety based on the number 
       
    87 		* of frequnecy bands
       
    88 		* TInt aComponentNumber : Controls which are enumerated for
       
    89 		* which the rectangle is required from the layout
       
    90 		*/
       
    91         static TRect ComponentRect(const TRect& aRect, TInt aVariety, 
       
    92                                                 TInt aComponentNumber);
       
    93     
       
    94     private://Constructors
       
    95         /**
       
    96         * This function is called to create an object of 
       
    97         * type CEqualizerFreqBand - First phase Constructor
       
    98         * @since 3.0
       
    99         * @param aaEqEditingDialog a reference to CEqualizerEditingDialog
       
   100         * @param aAudEqUtility a reference to CAudioEqualizerUtility 
       
   101         * @param aPresetIndex the index of the Preset being edited
       
   102         * @param aIsActivePreset whether the preset is active or not?
       
   103         * @param aBandIndex the index of the Frequncy band
       
   104         * @param aContainerRect the CEqualizerFreqBandContainer rectangle
       
   105         */
       
   106         CEqualizerFreqBand(CEqualizerEditingDialog* aEqEditingDialog,CAudioEqualizerUtility*& aAudEqUtility, 
       
   107          const TInt aPresetIndex, const TBool aIsActivePreset, 
       
   108          const TInt aBandIndex,
       
   109          TRect& aContainerRect); 
       
   110 
       
   111         /*
       
   112         * Second Phase Constructor
       
   113         */
       
   114         void ConstructL();    
       
   115         
       
   116     private: // New functions 
       
   117         /**
       
   118         *This function is called to load the bitmaps from the icons file
       
   119         */
       
   120         void LoadBitmapsL();
       
   121         
       
   122         /**
       
   123         * This member is called by the Equalizer UI to update the new band
       
   124         * level in the engine 
       
   125         * a new preset. 
       
   126         * @ since Series 60 3.0
       
   127         * lastIncFlag : Flag which indicates that the slider has reached the
       
   128         * the limits
       
   129         */
       
   130         void UpdateBandLevelInEngineL(TBool lastIncFlag);
       
   131     public: // New functions 
       
   132        /**
       
   133         * This function is used to set new values for CAudioEqualizerUtility* 
       
   134         * @since 3.0
       
   135         * @param aAudEqUtility New pointer to CAudioEqualizerUtility
       
   136         */
       
   137         void SetAudioEqualizerL(CAudioEqualizerUtility* aAudEqUtility);
       
   138 
       
   139 #ifdef RD_SCALABLE_UI_V2
       
   140        /**
       
   141         * This function is used by the frequency band container to send 
       
   142         * pointer events to individual bands 
       
   143         * @since 3.2
       
   144         * @param aPointerEvent pointer event 
       
   145         */
       
   146         void HandlePointerEventL(const TPointerEvent& aPointerEvent);
       
   147 #endif //RD_SCALABLE_UI_V2
       
   148 
       
   149     private: // Functions from base classes      
       
   150         /**
       
   151         * From CCoeControl Called to draw a control
       
   152         */
       
   153         void Draw(const TRect& aRect) const;
       
   154         /**
       
   155         * From CCoeControl Called when the control's size is changed
       
   156         */
       
   157         void SizeChanged();   
       
   158         /**
       
   159         * From CCoeControl Called when a control's focus is changed
       
   160         */
       
   161         void FocusChanged(TDrawNow aDrawNow);
       
   162             
       
   163         /**
       
   164         * From CCoeControl
       
   165         * This function is called when there is a skin change or
       
   166         * change in the layout
       
   167         */
       
   168         void HandleResourceChange(TInt aType);      
       
   169     
       
   170     private:   //Data
       
   171         //Pointers to hold the equalizer backgroung bitmap and mask
       
   172         CFbsBitmap * iBgBitmap;
       
   173         CFbsBitmap * iBgBitmapMask;
       
   174 
       
   175         //Pointers to hold the equalizer scale bitmap and mask
       
   176         CFbsBitmap * iSliderBitmap;
       
   177         CFbsBitmap * iSliderBitmapMask;
       
   178         
       
   179         // Stores the zero position of mover
       
   180         TInt iZeroPos;
       
   181         // Minimum frequency band decibel level 
       
   182         TInt32 iMinBandLevel;
       
   183         // Maximum frequency band decibel level 
       
   184         TInt32 iMaxBandLevel;        
       
   185         // Used to store a pointer to CEqualizerEditingDialog 
       
   186         CEqualizerEditingDialog* iEqEditingDialog;
       
   187         // Used to store a pointer to CAudioEqualizerUtility 
       
   188         CAudioEqualizerUtility* iAudEqUtility;
       
   189         // Used to store a pointer to CAudioEqualizer 
       
   190         CAudioEqualizer* iAudioEqualizer;
       
   191         // The index of the preset in the array returned by
       
   192         // CAudioEqualizerUtility::Presets()
       
   193         const TInt iPresetIndex;
       
   194         // Used to store the name of the preset
       
   195         TPresetName iPresetName;
       
   196         // Whether the preset displayed is an active preset?
       
   197         const TBool iIsActivePreset;
       
   198         // Index of the Frequency Band as passed to Engine
       
   199         const TInt iBandIndex;
       
   200         // Position of the mover
       
   201         TInt iMoverPos;
       
   202         //Stores the container's rect value
       
   203         TRect& iContainerRect;  
       
   204         //Stores the freq band Scale's rectangle
       
   205         TRect iScaleRect;
       
   206         //Stores the slider's rectangle
       
   207         TRect iSliderRect;
       
   208         //Stores the background rectangle
       
   209         TRect iBackgroundRect;
       
   210 		//Stores the step count of the slider
       
   211         TInt32 iStepCount;
       
   212         };
       
   213 
       
   214 
       
   215 #endif //EQUALIZERFREQBAND_H
       
   216 // End of File