javauis/amms_qt/ammscontrol/audioeffect/inc/cammsreverbcontrolgroup.h
changeset 23 98ccebc37403
equal deleted inserted replaced
21:2a9601315dfc 23:98ccebc37403
       
     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:  Group for reverb controls
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CAMMSREVERBCONTROLGROUP_H
       
    20 #define CAMMSREVERBCONTROLGROUP_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include "cammseffectcontrolgroup.h"
       
    25 #include <EnvironmentalReverbData.h>
       
    26 
       
    27 // CONSTANTS
       
    28 _LIT(KAMMSReverbControlClassName, ".amms.control.audioeffect.ReverbControl");
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class CAMMSBaseReverbControl;
       
    32 class CEnvironmentalReverbUtility;
       
    33 
       
    34 
       
    35 // CLASS DECLARATION
       
    36 /**
       
    37  *  Group for reverb controls
       
    38  *
       
    39  *  @since 3.0
       
    40  */
       
    41 NONSHARABLE_CLASS(CAMMSReverbControlGroup): public CAMMSEffectControlGroup
       
    42 {
       
    43 public:  // Constructors and destructor
       
    44 
       
    45     /**
       
    46      * Two-phased constructor.
       
    47      */
       
    48     static CAMMSReverbControlGroup* NewLC();
       
    49 
       
    50     /**
       
    51      * destructor
       
    52      */
       
    53     ~CAMMSReverbControlGroup();
       
    54 
       
    55 public: // New functions
       
    56 
       
    57     /**
       
    58      * Gets the gain level of the reverberation
       
    59      *
       
    60      * @return the gain level of the reverberation
       
    61      */
       
    62     TInt ReverbLevel();
       
    63 
       
    64     /**
       
    65      * Gets the reverberation time, as set either explicitly via
       
    66      * setReverbTime or implicitly via setPreset (whichever was called last).
       
    67      *
       
    68      * @return the reverberation time
       
    69      */
       
    70     TInt ReverbTime();
       
    71 
       
    72     /**
       
    73      * Sets the gain level of the reverberation
       
    74      *
       
    75      * @param the gain level of the reverberation to be set
       
    76      */
       
    77     void SetReverbLevelL(TInt aLevel);
       
    78 
       
    79     /**
       
    80      * Sets the reverberation time of the reverb
       
    81      *
       
    82      * @param the reverberation time to be set
       
    83      */
       
    84     void SetReverbTimeL(TInt aTime);
       
    85 
       
    86 private: // New functions
       
    87     /**
       
    88      * Gets control. Ownership is not tranferred.
       
    89      *
       
    90      * @param aIndex Control index.
       
    91      */
       
    92     CAMMSBaseReverbControl* TypeSafeControl(TInt aIndex) const;
       
    93 
       
    94     /**
       
    95      * Gets reverb data for the given preset index from the central
       
    96      * repository.
       
    97      * @param aPresetIndex Index of the preset whose reverb is asked.
       
    98      * @param aReverbData Returned data.
       
    99      */
       
   100     void GetReverbDataFromCenRepL(TUint aPresetIndex,
       
   101                                   TEfEnvReverbDataPckg& aReverbData);
       
   102 
       
   103 public: // Functions from base classes
       
   104     /**
       
   105      * Returns class name that identifies this control group.
       
   106      *
       
   107      * @return Control group name.
       
   108      */
       
   109     const TDesC16& ClassName();
       
   110 
       
   111 protected:
       
   112     /**
       
   113      * Called by when a new player is added
       
   114      *
       
   115      * @param aPlayer   The player being added
       
   116      * @param aControl  The player's control relevant to this group
       
   117      */
       
   118     void NotifyPlayerAddedL(CMMAPlayer *aPlayer, CMMAControl* aControl);
       
   119 
       
   120     /**
       
   121      * Called when the current preset changes
       
   122      */
       
   123     void PresetChangedL();
       
   124 
       
   125     /**
       
   126      * Finish initialization (after the 1st player is added)
       
   127      */
       
   128     void InitializeL();
       
   129 
       
   130     /**
       
   131      * Creates utilities that can be used to obtain preset names
       
   132      * and preset data (needed when the group has no controls).
       
   133      * Does nothing if the utility already exists.
       
   134      */
       
   135     void PrepareEmptyGroupUtilitiesL();
       
   136 
       
   137     /**
       
   138      * Deletes utilities that are used to obtain preset names
       
   139      * and preset data (needed when the group has no controls).
       
   140      * Does nothing if the utilities have already been deleted.
       
   141      */
       
   142     void DeleteEmptyGroupUtilities();
       
   143 
       
   144     /**
       
   145      * Gets list of preset names available.
       
   146      * @param aPresetNames Returned preset names
       
   147      */
       
   148     void GetPresetNamesL(CDesCArray& aPresetNames);
       
   149 
       
   150 protected:
       
   151     /**
       
   152      * C++ default constructor.
       
   153      */
       
   154     CAMMSReverbControlGroup();
       
   155 
       
   156     /**
       
   157      * Symbian 2nd phase constructor.
       
   158      */
       
   159     void ConstructL();
       
   160 
       
   161 protected: // data
       
   162 
       
   163     // Needed to get preset names when the group has no controls.
       
   164     CEnvironmentalReverbUtility* iEmptyEnvironmentalReverbUtility; // Owned.
       
   165 
       
   166     TInt iReverbLevel;
       
   167     TInt iReverbTime;
       
   168     TInt iReverbMinLevel;
       
   169     TInt iReverbMaxLevel;
       
   170 
       
   171 };
       
   172 
       
   173 #endif // CAMMSREVERBCONTROLGROUP_H