os/mm/mm_pub/audio_effects_api/inc/RoomLevelBase.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
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 RoomLevel effect class.
sl@0
    15
*
sl@0
    16
*/
sl@0
    17
sl@0
    18
sl@0
    19
#ifndef CROOMLEVEL_H
sl@0
    20
#define CROOMLEVEL_H
sl@0
    21
sl@0
    22
// INCLUDES
sl@0
    23
sl@0
    24
#include <e32base.h>
sl@0
    25
#include <AudioEffectBase.h>
sl@0
    26
#include <RoomLevelData.h>
sl@0
    27
#include <MCustomInterface.h>
sl@0
    28
sl@0
    29
const TUid KUidRoomLevelEffect = {0x10207B3C};
sl@0
    30
sl@0
    31
// FORWARD DELCARATION
sl@0
    32
class CMdaAudioConvertUtility;
sl@0
    33
class CMdaAudioPlayerUtility;
sl@0
    34
class CMdaAudioRecorderUtility;
sl@0
    35
class CMdaAudioInputStream;
sl@0
    36
class CMdaAudioOutputStream;
sl@0
    37
class CMdaAudioToneUtility;
sl@0
    38
class CCustomCommandUtility;
sl@0
    39
class CCustomInterfaceUtility;
sl@0
    40
class CMMFDevSound;
sl@0
    41
class  CMidiClientUtility;
sl@0
    42
class CEnvironmentalReverb;
sl@0
    43
class CDrmPlayerUtility;
sl@0
    44
class CVideoPlayerUtility;
sl@0
    45
sl@0
    46
// CLASS DECLARATION
sl@0
    47
sl@0
    48
/**
sl@0
    49
*  This is the Environmental RoomLevel effect class for managing RoomLevel settings.
sl@0
    50
*
sl@0
    51
*  @lib RoomLevelEffect.lib
sl@0
    52
*  @since 3.0
sl@0
    53
*/
sl@0
    54
sl@0
    55
class CRoomLevel : public CAudioEffect
sl@0
    56
    {
sl@0
    57
sl@0
    58
    public:     //New Functions
sl@0
    59
        /**
sl@0
    60
        * Factory function for creating the audio RoomLevel object.
sl@0
    61
        * @since 3.0
sl@0
    62
        * @param aUtility A reference to a convert utility
sl@0
    63
        * @param aReverb A reference to a environmental reverb utility
sl@0
    64
        * @return pointer to CRoomLevel object
sl@0
    65
        */
sl@0
    66
        IMPORT_C static CRoomLevel* NewL( CMdaAudioConvertUtility& aUtility, CEnvironmentalReverb& aReverb);
sl@0
    67
sl@0
    68
        /**
sl@0
    69
        * Factory function for creating the audio RoomLevel object.
sl@0
    70
        * @since 3.0
sl@0
    71
        * @param aUtility A reference to an audio input stream utility
sl@0
    72
        * @param aReverb A reference to a environmental reverb utility
sl@0
    73
        * @return pointer to CRoomLevel object
sl@0
    74
        */
sl@0
    75
        IMPORT_C static CRoomLevel* NewL( CMdaAudioInputStream& aUtility, CEnvironmentalReverb& aReverb );
sl@0
    76
sl@0
    77
        /**
sl@0
    78
        * Factory function for creating the audio RoomLevel object.
sl@0
    79
        * @since 3.0
sl@0
    80
        * @param aUtility A reference to an audio output stream utility
sl@0
    81
        * @param aReverb A reference to a environmental reverb utility
sl@0
    82
        * @return pointer to CRoomLevel object
sl@0
    83
        */
sl@0
    84
        IMPORT_C static CRoomLevel* NewL( CMdaAudioOutputStream& aUtility, CEnvironmentalReverb& aReverb);
sl@0
    85
sl@0
    86
        /**
sl@0
    87
        * Factory function for creating the audio RoomLevel object.
sl@0
    88
        * @since 3.0
sl@0
    89
        * @param aUtility A reference to an audio player utility
sl@0
    90
        * @param aReverb A reference to a environmental reverb utility
sl@0
    91
        * @return pointer to CRoomLevel object
sl@0
    92
        */
sl@0
    93
        IMPORT_C static CRoomLevel* NewL( CMdaAudioPlayerUtility& aUtility, CEnvironmentalReverb& aReverb );
sl@0
    94
sl@0
    95
        /**
sl@0
    96
        * Factory function for creating the audio RoomLevel object.
sl@0
    97
        * @since 3.0
sl@0
    98
        * @param aUtility A reference to an audio record utility
sl@0
    99
        * @param aRecordStream ETrue if the effect is to be applied to the recording,
sl@0
   100
        *                      EFalse if the effect is to be applied only to the playback
sl@0
   101
        * @param aReverb A reference to a environmental reverb utility
sl@0
   102
        * @return pointer to CRoomLevel object
sl@0
   103
        */
sl@0
   104
        IMPORT_C static CRoomLevel* NewL( CMdaAudioRecorderUtility& aUtility, TBool aRecordStream, CEnvironmentalReverb& aReverb);
sl@0
   105
sl@0
   106
        /**
sl@0
   107
        * Factory function for creating the audio RoomLevel object.
sl@0
   108
        * @since 3.0
sl@0
   109
        * @param aUtility A reference to an audio tone utility
sl@0
   110
        * @param aReverb A reference to a environmental reverb utility
sl@0
   111
        * @return pointer to CRoomLevel object
sl@0
   112
        */
sl@0
   113
        IMPORT_C static CRoomLevel* NewL( CMdaAudioToneUtility& aUtility, CEnvironmentalReverb& aReverb );
sl@0
   114
sl@0
   115
        /**
sl@0
   116
        * Factory function for creating the audio RoomLevel object.
sl@0
   117
        * @since 3.0
sl@0
   118
        * @param aDevSound A reference to a DevSound instance
sl@0
   119
        * @param aReverb A reference to a environmental reverb utility
sl@0
   120
        * @return pointer to CRoomLevel object
sl@0
   121
        */
sl@0
   122
        IMPORT_C static CRoomLevel* NewL( CMMFDevSound& aDevSound, CEnvironmentalReverb& aReverb);
sl@0
   123
sl@0
   124
        /**
sl@0
   125
        * Factory function for creating the audio RoomLevel object.
sl@0
   126
        * @since 3.0
sl@0
   127
        * @param aUtility A reference to a custom command utility
sl@0
   128
        * @param aReverb A reference to a environmental reverb utility
sl@0
   129
        * @return pointer to CRoomLevel object
sl@0
   130
        */
sl@0
   131
        IMPORT_C static CRoomLevel* NewL( CCustomCommandUtility* aUtility, CEnvironmentalReverb& aReverb );
sl@0
   132
sl@0
   133
        /**
sl@0
   134
        * Factory function for creating the audio RoomLevel object.
sl@0
   135
        * @since 3.0
sl@0
   136
        * @param aCustomInterface A reference to a custom interface
sl@0
   137
        * @param aReverb A reference to a environmental reverb utility
sl@0
   138
        * @return pointer to CRoomLevel object
sl@0
   139
        */
sl@0
   140
        IMPORT_C static CRoomLevel* NewL( MCustomInterface& aCustomInterface, CEnvironmentalReverb& aReverb );
sl@0
   141
sl@0
   142
        /**
sl@0
   143
        * Factory function for creating the audio RoomLevel object.
sl@0
   144
        * @since 3.0
sl@0
   145
        * @param aUtility A reference to a CMidiClientUtility object
sl@0
   146
        * @param aReverb A reference to a environmental reverb utility
sl@0
   147
        * @return pointer to CRoomLevel object
sl@0
   148
        */
sl@0
   149
        IMPORT_C static CRoomLevel* NewL( CMidiClientUtility& aUtility, CEnvironmentalReverb& aReverb);
sl@0
   150
sl@0
   151
        /**
sl@0
   152
        * Factory function for creating the RoomLevel object.
sl@0
   153
        * @since 3.0
sl@0
   154
        * @param CDrmPlayerUtility A reference to a CDrmPlayerUtility object
sl@0
   155
        * @return pointer to CRoomLevel object
sl@0
   156
        */
sl@0
   157
        IMPORT_C static CRoomLevel* NewL( CDrmPlayerUtility& aUtility, CEnvironmentalReverb& aReverb );
sl@0
   158
sl@0
   159
        /**
sl@0
   160
        * Factory function for creating the RoomLevel object.
sl@0
   161
        * @since 3.2
sl@0
   162
        * @param CVideoPlayerUtility A reference to a CVideoPlayerUtility object
sl@0
   163
        * @return pointer to CRoomLevel object
sl@0
   164
        */
sl@0
   165
        IMPORT_C static CRoomLevel* NewL( CVideoPlayerUtility& aUtility, CEnvironmentalReverb& aReverb );
sl@0
   166
sl@0
   167
        /**
sl@0
   168
        *
sl@0
   169
        * Destructor
sl@0
   170
        */
sl@0
   171
        IMPORT_C virtual ~CRoomLevel();
sl@0
   172
sl@0
   173
        /**
sl@0
   174
        * Gets the RoomLevel current level in mB
sl@0
   175
        * @since 3.0
sl@0
   176
        * @return RoomLevel current level
sl@0
   177
        */
sl@0
   178
        IMPORT_C TInt32 Level() const;
sl@0
   179
sl@0
   180
        /**
sl@0
   181
        * Gets the RoomLevel current level maximum and minimum in mB
sl@0
   182
        * @since 3.0
sl@0
   183
        * @param aMin Minimum current level
sl@0
   184
        * @param aMax Maximum current level
sl@0
   185
        * @return -
sl@0
   186
        */
sl@0
   187
        IMPORT_C void LevelRange( TInt32& aMin, TInt32& aMax );
sl@0
   188
sl@0
   189
        /**
sl@0
   190
        * Sets the RoomLevel level, it will leave if aRoomLevel is not within range of Min and Max
sl@0
   191
        * @since 3.0
sl@0
   192
        * @param aRoomLevelLevel The RoomLevel level in mB
sl@0
   193
        */
sl@0
   194
        IMPORT_C void SetRoomLevelL( TInt32 aRoomLevel );
sl@0
   195
sl@0
   196
sl@0
   197
    public: // functions from base class
sl@0
   198
sl@0
   199
        /*
sl@0
   200
        * From CAudioEffect
sl@0
   201
        * Get the unique identifier of the audio effect
sl@0
   202
        * @since 3.0
sl@0
   203
        * @return Unique identifier
sl@0
   204
        */
sl@0
   205
        IMPORT_C TUid Uid() const;
sl@0
   206
sl@0
   207
    protected:  // Functions from base classes
sl@0
   208
sl@0
   209
        /**
sl@0
   210
        * From CAudioEffect
sl@0
   211
        * Create a package of the effect data
sl@0
   212
        * @since 3.0
sl@0
   213
        * @return A descriptor containing the effect data.
sl@0
   214
        */
sl@0
   215
        IMPORT_C const TDesC8& DoEffectData();
sl@0
   216
sl@0
   217
        /**
sl@0
   218
        * From CAudioEffect
sl@0
   219
        * Internal function to unpack effect data
sl@0
   220
        * @since 3.0
sl@0
   221
        * @param aEffectDataBuffer Descriptor containing packed effect data
sl@0
   222
        * @return -
sl@0
   223
        */
sl@0
   224
        IMPORT_C void SetEffectData( const TDesC8& aEffectDataBuffer );
sl@0
   225
sl@0
   226
sl@0
   227
sl@0
   228
sl@0
   229
sl@0
   230
sl@0
   231
    protected:
sl@0
   232
sl@0
   233
        /**
sl@0
   234
        * Private C++ constructor for this class.
sl@0
   235
        * @since 3.0
sl@0
   236
        * @return   -
sl@0
   237
        */
sl@0
   238
        IMPORT_C CRoomLevel();
sl@0
   239
sl@0
   240
    protected:
sl@0
   241
        CEnvironmentalReverb* iClientReverb;
sl@0
   242
        // RoomLevel data structure
sl@0
   243
        TEfRoomLevel iRoomLevelData;
sl@0
   244
        // Data package sent to server
sl@0
   245
        TEfRoomLevelDataPckg iDataPckgTo;
sl@0
   246
        // Data package received from server
sl@0
   247
        TEfRoomLevelDataPckg iDataPckgFrom;
sl@0
   248
sl@0
   249
    friend class CRoomLevelMessageHandler;
sl@0
   250
//    friend class CEnvironmentalReverbImpl;
sl@0
   251
sl@0
   252
    };
sl@0
   253
sl@0
   254
#endif  // of CROOMLEVEL_H
sl@0
   255
sl@0
   256
// End of File