epoc32/include/stereowideningbase.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@4
     5
* under the terms of "Eclipse Public License v1.0"
williamr@2
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description:  This is the definition of the Stereo Widening effect class.
williamr@2
    15
*
williamr@2
    16
*/
williamr@2
    17
williamr@2
    18
williamr@2
    19
#ifndef CSTEREOWIDENING_H
williamr@2
    20
#define CSTEREOWIDENING_H
williamr@2
    21
williamr@2
    22
// INCLUDES
williamr@2
    23
williamr@2
    24
#include <e32base.h>
williamr@2
    25
#include <AudioEffectBase.h>
williamr@2
    26
#include <StereoWideningData.h>
williamr@2
    27
#include <MCustomInterface.h>
williamr@2
    28
williamr@2
    29
const TUid KUidStereoWideningEffect = {0x10203836};
williamr@2
    30
williamr@2
    31
// FORWARD DELCARATION
williamr@2
    32
class CMdaAudioConvertUtility;
williamr@2
    33
class CMdaAudioPlayerUtility;
williamr@2
    34
class CMdaAudioRecorderUtility;
williamr@2
    35
class CMdaAudioInputStream;
williamr@2
    36
class CMdaAudioOutputStream;
williamr@2
    37
class CMdaAudioToneUtility;
williamr@2
    38
class CCustomCommandUtility;
williamr@2
    39
class CCustomInterfaceUtility;
williamr@2
    40
class CMMFDevSound;
williamr@2
    41
class CMidiClientUtility;
williamr@2
    42
class CDrmPlayerUtility;
williamr@2
    43
class CVideoPlayerUtility;
williamr@2
    44
williamr@2
    45
// CLASS DECLARATION
williamr@2
    46
williamr@2
    47
/**
williamr@2
    48
*  This is the Stereo Widening effect class for managing audio Stereo Widening settings.
williamr@2
    49
*
williamr@2
    50
*  @lib StereoWidening.lib
williamr@2
    51
*  @since 3.0
williamr@2
    52
*/
williamr@2
    53
williamr@2
    54
class CStereoWidening : public CAudioEffect
williamr@2
    55
    {
williamr@2
    56
williamr@2
    57
    public:     //New Functions
williamr@2
    58
williamr@2
    59
        /**
williamr@2
    60
        * Factory function for creating the stereo widening object.
williamr@2
    61
        * @since 3.0
williamr@2
    62
        * @return pointer to CStereoWidening object
williamr@2
    63
        */
williamr@2
    64
        IMPORT_C static CStereoWidening* NewL();
williamr@2
    65
williamr@2
    66
        /**
williamr@2
    67
        * Factory function for creating the stereo widening object.
williamr@2
    68
        * @since 3.0
williamr@2
    69
        * @param aUtility A reference to a convert utility
williamr@2
    70
        * @param aEnable Indicate whether the effect will be automatically enabled after creation.
williamr@2
    71
        * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue
williamr@2
    72
        * @return pointer to CStereoWidening object
williamr@2
    73
        */
williamr@2
    74
        IMPORT_C static CStereoWidening* NewL(CMdaAudioConvertUtility& aUtility, 
williamr@2
    75
                                              TBool aEnable = EFalse,
williamr@2
    76
                                              TInt8 aInitialLevel = 0);
williamr@2
    77
williamr@2
    78
        /**
williamr@2
    79
        * Factory function for creating the stereo widening object.
williamr@2
    80
        * @since 3.0
williamr@2
    81
        * @param aUtility A reference to an audio input stream utility
williamr@2
    82
        * @param aEnable Indicate whether the effect will be automatically enabled after creation.
williamr@2
    83
        * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue
williamr@2
    84
        * @return pointer to CStereoWidening object
williamr@2
    85
        */
williamr@2
    86
        IMPORT_C static CStereoWidening* NewL(CMdaAudioInputStream& aUtility,   
williamr@2
    87
                                              TBool aEnable = EFalse,
williamr@2
    88
                                              TInt8 aInitialLevel = 0);
williamr@2
    89
williamr@2
    90
        /**
williamr@2
    91
        * Factory function for creating the stereo widening object.
williamr@2
    92
        * @since 3.0
williamr@2
    93
        * @param aUtility A reference to an audio output stream utility
williamr@2
    94
        * @param aEnable Indicate whether the effect will be automatically enabled after creation.
williamr@2
    95
        * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue
williamr@2
    96
        * @return pointer to CStereoWidening object
williamr@2
    97
        */
williamr@2
    98
        IMPORT_C static CStereoWidening* NewL(CMdaAudioOutputStream& aUtility, 
williamr@2
    99
                                              TBool aEnable = EFalse,
williamr@2
   100
                                              TInt8 aInitialLevel = 0);
williamr@2
   101
williamr@2
   102
        /**
williamr@2
   103
        * Factory function for creating the stereo widening object.
williamr@2
   104
        * @since 3.0
williamr@2
   105
        * @param aUtility A reference to an audio player utility
williamr@2
   106
        * @param aEnable Indicate whether the effect will be automatically enabled after creation.
williamr@2
   107
        * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue
williamr@2
   108
        * @return pointer to CStereoWidening object
williamr@2
   109
        */
williamr@2
   110
        IMPORT_C static CStereoWidening* NewL(CMdaAudioPlayerUtility& aUtility,
williamr@2
   111
                                              TBool aEnable = EFalse,
williamr@2
   112
                                              TInt8 aInitialLevel = 0);
williamr@2
   113
williamr@2
   114
        /**
williamr@2
   115
        * Factory function for creating the stereo widening object.
williamr@2
   116
        * @since 3.0
williamr@2
   117
        * @param aUtility A reference to an audio record utility
williamr@2
   118
        * @param aRecordStream ETrue if the effect is to be applied to the recording,
williamr@2
   119
        *                      EFalse if the effect is to be applied only to the playback
williamr@2
   120
        * @param aEnable Indicate whether the effect will be automatically enabled after creation.
williamr@2
   121
        * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue
williamr@2
   122
        * @return pointer to CStereoWidening object
williamr@2
   123
        */
williamr@2
   124
        IMPORT_C static CStereoWidening* NewL(CMdaAudioRecorderUtility& aUtility,
williamr@2
   125
                                              TBool aRecordStream,
williamr@2
   126
                                              TBool aEnable = EFalse,
williamr@2
   127
                                              TInt8 aInitialLevel = 0);
williamr@2
   128
williamr@2
   129
        /**
williamr@2
   130
        * Factory function for creating the stereo widening object.
williamr@2
   131
        * @since 3.0
williamr@2
   132
        * @param aUtility A reference to an audio tone utility
williamr@2
   133
        * @param aEnable Indicate whether the effect will be automatically enabled after creation.
williamr@2
   134
        * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue
williamr@2
   135
        * @return pointer to CStereoWidening object
williamr@2
   136
        */
williamr@2
   137
        IMPORT_C static CStereoWidening* NewL(CMdaAudioToneUtility& aUtility,
williamr@2
   138
                                              TBool aEnable = EFalse,
williamr@2
   139
                                              TInt8 aInitialLevel = 0);
williamr@2
   140
williamr@2
   141
        /**
williamr@2
   142
        * Factory function for creating the stereo widening object.
williamr@2
   143
        * @since 3.0
williamr@2
   144
        * @param aDevSound A reference to a DevSound instance
williamr@2
   145
        * @param aEnable Indicate whether the effect will be automatically enabled after creation.
williamr@2
   146
        * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue
williamr@2
   147
        * @return pointer to CStereoWidening object
williamr@2
   148
        */
williamr@2
   149
        IMPORT_C static CStereoWidening* NewL(CMMFDevSound& aDevSound,
williamr@2
   150
                                              TBool aEnable = EFalse,
williamr@2
   151
                                              TInt8 aInitialLevel = 0);
williamr@2
   152
williamr@2
   153
        /**
williamr@2
   154
        * Factory function for creating the stereo widening object.
williamr@2
   155
        * @since 3.0
williamr@2
   156
        * @param aUtility A reference to a custom command utility
williamr@2
   157
        * @param aEnable Indicate whether the effect will be automatically enabled after creation.
williamr@2
   158
        * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue
williamr@2
   159
        * @return pointer to CStereoWidening object
williamr@2
   160
        */
williamr@2
   161
        IMPORT_C static CStereoWidening* NewL(CCustomCommandUtility* aUtility,
williamr@2
   162
                                              TBool aEnable = EFalse,
williamr@2
   163
                                              TInt8 aInitialLevel = 0);
williamr@2
   164
williamr@2
   165
        /**
williamr@2
   166
        * Factory function for creating the stereo widening object.
williamr@2
   167
        * @since 3.0
williamr@2
   168
        * @param aCustomInterface A reference to a custom interface
williamr@2
   169
        * @param aEnable Indicate whether the effect will be automatically enabled after creation.
williamr@2
   170
        * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue
williamr@2
   171
        * @return pointer to CStereoWidening object
williamr@2
   172
        */
williamr@2
   173
        IMPORT_C static CStereoWidening* NewL(MCustomInterface& aCustomInterface,
williamr@2
   174
                                              TBool aEnable = EFalse,
williamr@2
   175
                                              TInt8 aInitialLevel = 0);
williamr@2
   176
williamr@2
   177
        /**
williamr@2
   178
        * Factory function for creating the stereo widening object.
williamr@2
   179
        * @since 3.0
williamr@2
   180
        * @param aUtility A reference to a CMidiClientUtility
williamr@2
   181
        * @param aEnable Indicate whether the effect will be automatically enabled after creation.
williamr@2
   182
        * @param aInitialLevel Initial value of stereo widening to be used when aEnable = ETrue
williamr@2
   183
        * @return pointer to CStereoWidening object
williamr@2
   184
        */
williamr@2
   185
        IMPORT_C static CStereoWidening* NewL(CMidiClientUtility& aUtility,
williamr@2
   186
                                              TBool aEnable = EFalse, 
williamr@2
   187
                                              TInt8 aInitialLevel = 0);
williamr@2
   188
williamr@2
   189
        /**
williamr@2
   190
        * Factory function for creating the stereo widening object.
williamr@2
   191
        * @since 3.0
williamr@2
   192
        * @param CDrmPlayerUtility A reference to a CDrmPlayerUtility object
williamr@2
   193
        * @return pointer to CStereoWidening object
williamr@2
   194
        */
williamr@2
   195
        IMPORT_C static CStereoWidening* NewL(CDrmPlayerUtility& aUtility,
williamr@2
   196
                                              TBool aEnable = EFalse,
williamr@2
   197
                                              TInt8 aInitialLevel = 0);
williamr@2
   198
williamr@2
   199
        /**
williamr@2
   200
        * Factory function for creating the stereo widening object.
williamr@2
   201
        * @since 3.2
williamr@2
   202
        * @param CVideoPlayerUtility A reference to a CVideoPlayerUtility object
williamr@2
   203
        * @return pointer to CStereoWidening object
williamr@2
   204
        */
williamr@2
   205
        IMPORT_C static CStereoWidening* NewL(CVideoPlayerUtility& aUtility,
williamr@2
   206
                                              TBool aEnable = EFalse,
williamr@2
   207
                                              TInt8 aInitialLevel = 0);
williamr@2
   208
williamr@2
   209
        /**
williamr@2
   210
        *
williamr@2
   211
        * Destructor
williamr@2
   212
        */
williamr@2
   213
        IMPORT_C virtual ~CStereoWidening();
williamr@2
   214
williamr@2
   215
        /**
williamr@2
   216
        * Check if continuous level is supported for stereo widening.
williamr@2
   217
        * @since 3.0
williamr@2
   218
        * @return ETrue if continuous level is supported for stereo widening.  If this returns
williamr@2
   219
        *         EFalse, then the adaptation is actually setting the level to the nearest supported discrete
williamr@2
   220
        *         value, when SetStereoWidenlingLevelL is called.
williamr@2
   221
        */
williamr@2
   222
        IMPORT_C TBool IsContinuousLevelSupported() const;
williamr@2
   223
williamr@2
   224
        /**
williamr@2
   225
        * Set stereo widening level.
williamr@2
   226
        * @since 3.0
williamr@2
   227
        * @param aLevel Stereo widening level ranges from 0-100, where 0 is None and 100 is Maximum widening.
williamr@2
   228
        */
williamr@2
   229
        IMPORT_C void SetStereoWideningLevelL( TUint8 aLevel );
williamr@2
   230
williamr@2
   231
        /**
williamr@2
   232
        * Get the stereo widening settings.
williamr@2
   233
        * @since 3.0
williamr@2
   234
        * @return Level of widening
williamr@2
   235
        */
williamr@2
   236
        IMPORT_C TUint8 StereoWideningLevel() const;
williamr@2
   237
williamr@2
   238
williamr@2
   239
    public: // functions from base class
williamr@2
   240
williamr@2
   241
        /*
williamr@2
   242
        * From CAudioEffect
williamr@2
   243
        * Get the unique identifier of the audio effect
williamr@2
   244
        * @since 3.0
williamr@2
   245
        * @return Unique identifier
williamr@2
   246
        */
williamr@2
   247
        IMPORT_C TUid Uid() const;
williamr@2
   248
williamr@2
   249
    protected:  // Functions from base classes
williamr@2
   250
williamr@2
   251
        /**
williamr@2
   252
        * From CAudioEffect
williamr@2
   253
        * Create a package of the effect data
williamr@2
   254
        * @since 3.0
williamr@2
   255
        * @return A descriptor containing the effect data.
williamr@2
   256
        */
williamr@2
   257
        IMPORT_C const TDesC8& DoEffectData();
williamr@2
   258
williamr@2
   259
        /**
williamr@2
   260
        * From CAudioEffect
williamr@2
   261
        * Internal function to unpack effect data
williamr@2
   262
        * @since 3.0
williamr@2
   263
        * @param aEffectDataBuffer Descriptor containing packed effect data
williamr@2
   264
        * @return -
williamr@2
   265
        */
williamr@2
   266
        IMPORT_C void SetEffectData( const TDesC8& aEffectDataBuffer );
williamr@2
   267
williamr@2
   268
    protected:
williamr@2
   269
williamr@2
   270
        /**
williamr@2
   271
        * Private C++ constructor for this class.
williamr@2
   272
        * @since    3.0
williamr@2
   273
        * @param    aEffectObserver reference to event observer object
williamr@2
   274
        * @return   -
williamr@2
   275
        */
williamr@2
   276
        IMPORT_C CStereoWidening();
williamr@2
   277
williamr@2
   278
    protected:
williamr@2
   279
williamr@2
   280
        // Balance data structure
williamr@2
   281
        TEfStereoWidening iStereoWideningData;
williamr@2
   282
        // Data package sent to server
williamr@2
   283
        TEfStereoWideningDataPckg iDataPckgTo;
williamr@2
   284
        // Data package received from server
williamr@2
   285
        TEfStereoWideningDataPckg iDataPckgFrom;
williamr@2
   286
williamr@2
   287
    protected:    // Friend classes
williamr@2
   288
        friend class CStereoWideningMessageHandler;
williamr@2
   289
williamr@2
   290
    };
williamr@2
   291
williamr@2
   292
#endif  // of CSTEREOWIDENING_H
williamr@2
   293
williamr@2
   294
// End of File