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