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