os/mm/mm_pub/audio_effects_presets_api/inc/EnvironmentalReverbUtility.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2 * Copyright (c) 2006 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:  This is the definition of the audio EnvironmentalReverb utility class.
    15 *
    16 */
    17 
    18 
    19 
    20 #ifndef CENVIRONMENTALREVERBUTILITY_H
    21 #define CENVIRONMENTALREVERBUTILITY_H
    22 
    23 //  INCLUDES
    24 #include <e32base.h>
    25 #include <e32svr.h>
    26 #include <EnvironmentalReverbBase.h>
    27 #include <centralrepository.h>
    28 #include "EnvironmentalReverbUtilityData.h"
    29 
    30 // FORWARD DECLARATIONS
    31 class TEfEnvironmentalReverbUtilityPreset;
    32 class CEnvironmentalReverb;
    33 class CMdaAudioConvertUtility;
    34 class CMdaAudioPlayerUtility;
    35 class CMdaAudioRecorderUtility;
    36 class CMdaAudioInputStream;
    37 class CMdaAudioOutputStream;
    38 class CMdaAudioToneUtility;
    39 class CCustomCommandUtility;
    40 class CCustomInterfaceUtility;
    41 class CMMFDevSound;
    42 class CRepository;
    43 class CMidiClientUtility;
    44 class CDrmPlayerUtility;
    45 class CVideoPlayerUtility;
    46 
    47 // CLASS DECLARATION
    48 
    49 /**
    50 *  This is the EnvironmentalReverb Utility class for managing audio EnvironmentalReverb presets.
    51 *
    52 *  @lib EnvironmentalReverbUtility.lib
    53 *  @since 3.0
    54 */
    55 
    56 class CEnvironmentalReverbUtility : public CBase
    57     {
    58     public:  // Constructors and destructor
    59 
    60 
    61         /**
    62         * Factory function for creating the audio EnvironmentalReverb utility object.
    63         * @since 3.0
    64         * @param aUtility A reference to a Devsound Instance
    65         * @return pointer to CEnvironmentalReverbUtility object
    66         */
    67         IMPORT_C static CEnvironmentalReverbUtility* NewL(CMMFDevSound& aDevSound);
    68 
    69         /**
    70         * Factory function for creating the audio EnvironmentalReverb utility object.
    71         * @since 3.0
    72         * @param aUtility A reference to a convert utility
    73         * @return pointer to CEnvironmentalReverbUtility object
    74         */
    75         IMPORT_C static CEnvironmentalReverbUtility* NewL(CMdaAudioConvertUtility& aUtility);
    76 
    77         /**
    78         * Factory function for creating the audio EnvironmentalReverb utility object.
    79         * @since 3.0
    80         * @param aUtility A reference to a audio input stream utility
    81         * @return pointer to CEnvironmentalReverbUtility object
    82         */
    83         IMPORT_C static CEnvironmentalReverbUtility* NewL(CMdaAudioInputStream& aUtility);
    84 
    85         /**
    86         * Factory function for creating the audio EnvironmentalReverb utility object.
    87         * @since 3.0
    88         * @param aUtility A reference to a audio output stream utility
    89         * @return pointer to CEnvironmentalReverbUtility object
    90         */
    91         IMPORT_C static CEnvironmentalReverbUtility* NewL(CMdaAudioOutputStream& aUtility);
    92 
    93         /**
    94         * Factory function for creating the audio EnvironmentalReverb utility object.
    95         * @since 3.0
    96         * @param aUtility A reference to a audio player utility
    97         * @return pointer to CEnvironmentalReverbUtility object
    98         */
    99         IMPORT_C static CEnvironmentalReverbUtility* NewL(CMdaAudioPlayerUtility& aUtility);
   100 
   101         /**
   102         * Factory function for creating the audio EnvironmentalReverb utility object.
   103         * @since 3.0
   104         * @param aUtility A reference to a audio recorder utility
   105         * @return pointer to CEnvironmentalReverbUtility object
   106         */
   107         IMPORT_C static CEnvironmentalReverbUtility* NewL(CMdaAudioRecorderUtility& aUtility);
   108 
   109         /**
   110         * Factory function for creating the audio EnvironmentalReverb utility object.
   111         * @since 3.0
   112         * @param aUtility A reference to a audio tone utility
   113         * @return pointer to CEnvironmentalReverbUtility object
   114         */
   115         IMPORT_C static CEnvironmentalReverbUtility* NewL(CMdaAudioToneUtility& aUtility);
   116 
   117         /**
   118         * Factory function for creating the audio EnvironmentalReverb utility object.
   119         * @since 3.0
   120         * @param aUtility A reference to custom command utility
   121         * @return pointer to CEnvironmentalReverbUtility object
   122         */
   123         IMPORT_C static CEnvironmentalReverbUtility* NewL(CCustomCommandUtility* aUtility);
   124 
   125         /**
   126         * Factory function for creating the audio EnvironmentalReverb utility object.
   127         * @since 3.0
   128         * @param aUtility A reference to custom interface utility
   129         * @return pointer to CEnvironmentalReverbUtility object
   130         */
   131         IMPORT_C static CEnvironmentalReverbUtility* NewL(MCustomInterface& aCustomInterface);
   132 
   133 
   134         /**
   135         * Factory function for creating the audio EnvironmentalReverb utility object.
   136         * @since 3.0
   137         * @param aUtility A reference to CMidiClientUtility
   138         * @return pointer to CEnvironmentalReverbUtility object
   139         */
   140         IMPORT_C static CEnvironmentalReverbUtility* NewL(CMidiClientUtility& aUtility);
   141 
   142 
   143         /**
   144         * Factory function for creating the audio equalizer object.
   145         * @since 3.0
   146         * @param CDrmPlayerUtility A reference to a CDrmPlayerUtility object
   147         * @return pointer to CAudioEqualizer object
   148         */
   149         IMPORT_C static CEnvironmentalReverbUtility* NewL(CDrmPlayerUtility& aUtility);
   150 
   151         /**
   152         * Factory function for creating the audio equalizer object.
   153         * @since 3.2
   154         * @param CVideoPlayerUtility A reference to a CVideoPlayerUtility object
   155         * @return pointer to CAudioEqualizer object
   156         */
   157         IMPORT_C static CEnvironmentalReverbUtility* NewL(CVideoPlayerUtility& aUtility);
   158 
   159          /**
   160         * Destructor.
   161         */
   162         virtual ~CEnvironmentalReverbUtility();
   163 
   164         /**
   165         * Apply the Preset Index value
   166         * @since 3.0
   167         * @param aPreset Preset Value
   168         */
   169         IMPORT_C void ApplyPresetL(TInt aPreset);
   170 
   171         /**
   172         * Disable the EnvironmentalReverb
   173         * @since 3.0
   174         */
   175         IMPORT_C void DisableEnvironmentalReverbL();
   176 
   177         /**
   178         * Create a Preset with the given Name and EnvironmentalReverb Settings
   179         * @since 3.0
   180         * @param aName Name of the Preset
   181         * @param aEnvironmentalReverb EnvironmentalReverb Settings for the Preset
   182         */
   183         IMPORT_C void CreatePresetL(TDesC& aName, CEnvironmentalReverb& aEnvironmentalReverbUI);
   184 
   185         /**
   186         * Delete a Preset with the given index in the Central Repository
   187         * @since 3.0
   188         * @param aPresetIndex Index of the Preset in the Array
   189         */
   190         IMPORT_C void DeletePresetL(TInt aPresetIndex);
   191 
   192         /**
   193         * Retrieves a Preset with the given index from the Central Repository
   194         * @since 3.0
   195         * @param aPresetIndex Index of the Preset in the Array
   196         */
   197         IMPORT_C  const TDesC& GetPresetL(TInt aPresetIndex);
   198 
   199         /**
   200         * Get the reference to the EnvironmentalReverb Object
   201         * @since 3.0
   202         * @return Reference to the EnvironmentalReverb Object.
   203         */
   204         IMPORT_C CEnvironmentalReverb& EnvironmentalReverb();
   205 
   206         /**
   207         * Modify a Preset with the given Name and EnvironmentalReverb Settings
   208         * @since 3.0
   209         * @param aPresetIndex Array Index of the Preset
   210         * @param aName Name of the Preset
   211         * @param aEnvironmentalReverb EnvironmentalReverb Settings for the Preset
   212         */
   213         IMPORT_C void ModifyPresetL(TInt aPresetIndex, TDesC& aName, CEnvironmentalReverb& aEnvironmentalReverbUI);
   214 
   215         /**
   216         * Get the number of Pre Defined Presets
   217         * @since 3.0
   218         * @return Number of Pre Defined Presets
   219         */
   220         IMPORT_C TUint32 NumberOfPreDefinedPresets() const;
   221 
   222         /**
   223         * Get all the Presets defined in the Central Repository
   224         * @since 3.0
   225         * @return Array of all Presets.
   226         */
   227         IMPORT_C TArray<TEfEnvironmentalReverbUtilityPreset> Presets();
   228 
   229         /**
   230          * Reset a System Defined Preset with the given index in the Array returned from Presets()
   231          * @since 3.0
   232          * @param aPresetIndex Index of the Preset in the Array
   233          */
   234         IMPORT_C void ResetPresetL(TInt aPresetIndex);
   235 
   236     private:
   237 
   238         /**
   239         * C++ default constructor.
   240         */
   241         CEnvironmentalReverbUtility();
   242 
   243         /**
   244         * By default Symbian 2nd phase constructor is private.
   245         */
   246 
   247         /**
   248         * Second Phase Costructor for DevSound Instance
   249         * @since 3.0
   250         * @param aDevSound DevSound Referece
   251         */
   252         void ConstructL(CMMFDevSound& aDevSound);
   253 
   254         /**
   255         * Second Phase Costructor for Audio Convert Utility
   256         * @since 3.0
   257         * @param aUtility CMdaAudioConvertUtility Referece
   258         */
   259         void ConstructL(CMdaAudioConvertUtility& aUtility);
   260 
   261         /**
   262         * Second Phase Costructor for CMdaAudioInputStream
   263         * @since 3.0
   264         * @param aUtility CMdaAudioInputStream Referece
   265         */
   266         void ConstructL(CMdaAudioInputStream& aUtility);
   267 
   268         /**
   269         * Second Phase Costructor for CMdaAudioOutputStream
   270         * @since 3.0
   271         * @param aUtilityCMdaAudioOutputStream Referece
   272         */
   273         void ConstructL(CMdaAudioOutputStream& aUtility);
   274 
   275         /**
   276         * Second Phase Costructor for CMdaAudioPlayerUtility
   277         * @since 3.0
   278         * @param aUtility CMdaAudioPlayerUtility Referece
   279         */
   280         void ConstructL(CMdaAudioPlayerUtility& aUtility);
   281 
   282         /**
   283         * Second Phase Costructor for CMdaAudioRecordUtility
   284         * @since 3.0
   285         * @param aUtility CMdaAudioRecordUtility Referece
   286         */
   287         void ConstructL(CMdaAudioRecorderUtility& aUtility);
   288 
   289         /**
   290         * Second Phase Costructor for CMdaAudioToneUtility
   291         * @since 3.0
   292         * @param aUtility CMdaAudioToneUtility Referece
   293         */
   294         void ConstructL(CMdaAudioToneUtility& aUtility);
   295 
   296         /**
   297         * Second Phase Costructor for MCustomCommand
   298         * @since 3.0
   299         * @param aUtility MCustomCommand Referece
   300         */
   301         void ConstructL(CCustomCommandUtility* aUtility);
   302 
   303         /**
   304         * Second Phase Costructor for MCustomInterface
   305         * @since 3.0
   306         * @param aUtility MCustomInterface Referece
   307         */
   308         void ConstructL(MCustomInterface& aCustomInterface);
   309 
   310         /**
   311         * Second Phase Costructor for CMidiClientUtility
   312         * @since 3.0
   313         * @param aUtility CMidiClientUtility Referece
   314         */
   315         void ConstructL(CMidiClientUtility& aUtility);
   316         
   317         /**
   318         * Second Phase Costructor for CDrmPlayerUtility
   319         * @since 3.0
   320         * @param aUtility CDrmPlayerUtility Referece
   321         */
   322         void ConstructL(CDrmPlayerUtility& aUtility);                
   323 
   324 		/**
   325 		* Second Phase Costructor for CVideoPlayerUtility
   326 		* @since 3.2
   327 		* @param aUtility CVideoPlayerUtility Referece
   328 		*/
   329 		void ConstructL(CVideoPlayerUtility& aUtility);		
   330 
   331         /**
   332         * Function for Updating the Array from the Central Repository
   333         * @since 3.0
   334         * @param aUtility MCustomInterface Referece
   335         */
   336         void UpdateFullPresetArrayFromCenRep(RArray<TEfEnvironmentalReverbUtilityPreset> &aFullPresetArray);
   337 
   338         /**
   339         * Function of Updating the Preset Array for the User
   340         * @since 3.0
   341         * @param aUtility MCustomInterface Referece
   342         */
   343         void UpdatePresetArray(RArray<TEfEnvironmentalReverbUtilityPreset>& aPresetArray,const RArray<TEfEnvironmentalReverbUtilityPreset> &aFullPresetArray);
   344 
   345 
   346     private: // Data
   347 
   348         // Array for Storing the Current State of the Repository
   349         // which has been compacted after the transaction
   350         // with the Central Repository
   351         RArray<TEfEnvironmentalReverbUtilityPreset> iPresetArray;
   352 
   353         // Array Which contains the full information from the
   354         // Central Repository except the Description Values
   355         RArray<TEfEnvironmentalReverbUtilityPreset> iFullPresetArray;
   356 
   357         // Pointer to the EnvironmentalReverb Object
   358         CEnvironmentalReverb* iEnvironmentalReverb;
   359 
   360         // Pointer to the EnvironmentalReverb Object
   361         // which is returned to the UI for Manipulation
   362         CEnvironmentalReverb* iTransEnvironmentalReverb;
   363 
   364         // Pointer to the Preset Repository
   365         CRepository* iPresetRepository;
   366    };
   367 
   368 #endif      // CENVIRONMENTALREVERBUTILITY_H
   369 
   370 // End of File