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