os/mm/mm_pub/audio_effects_api/inc/DistanceAttenuationBase.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 Distance Attenuation effect class.
sl@0
    15
*
sl@0
    16
*/
sl@0
    17
sl@0
    18
sl@0
    19
#ifndef CDISTANCEATTENUATION_H
sl@0
    20
#define CDISTANCEATTENUATION_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 <DistanceAttenuationData.h>
sl@0
    27
#include <MCustomInterface.h>
sl@0
    28
sl@0
    29
sl@0
    30
const TUid KUidDistanceAttenuationEffect = {0x1020382C};
sl@0
    31
sl@0
    32
// FORWARD DELCARATION
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 CMidiClientUtility;
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 Distance Attenuation effect class for managing audio Distance Attenuation settings.
sl@0
    50
*
sl@0
    51
*  @lib DistanceAttenuationEffect.lib
sl@0
    52
*  @since 3.0
sl@0
    53
*/
sl@0
    54
sl@0
    55
class CDistanceAttenuation : public CAudioEffect
sl@0
    56
    {
sl@0
    57
sl@0
    58
    public:     //New Functions
sl@0
    59
sl@0
    60
        /**
sl@0
    61
        * Factory function for creating the distance attenuation object.
sl@0
    62
        * @since 3.0
sl@0
    63
        * @param aUtility A reference to a convert utility
sl@0
    64
        * @return pointer to CDistanceAttenuation object
sl@0
    65
        */
sl@0
    66
        IMPORT_C static CDistanceAttenuation* NewL( CMdaAudioConvertUtility& aUtility );
sl@0
    67
sl@0
    68
        /**
sl@0
    69
        * Factory function for creating the distance attenuation object.
sl@0
    70
        * @since 3.0
sl@0
    71
        * @param aUtility A reference to an audio input stream utility
sl@0
    72
        * @return pointer to CDistanceAttenuation object
sl@0
    73
        */
sl@0
    74
        IMPORT_C static CDistanceAttenuation* NewL( CMdaAudioInputStream& aUtility );
sl@0
    75
sl@0
    76
        /**
sl@0
    77
        * Factory function for creating the distance attenuation object.
sl@0
    78
        * @since 3.0
sl@0
    79
        * @param aUtility A reference to an audio output stream utility
sl@0
    80
        * @return pointer to CDistanceAttenuation object
sl@0
    81
        */
sl@0
    82
        IMPORT_C static CDistanceAttenuation* NewL( CMdaAudioOutputStream& aUtility );
sl@0
    83
sl@0
    84
        /**
sl@0
    85
        * Factory function for creating the distance attenuation object.
sl@0
    86
        * @since 3.0
sl@0
    87
        * @param aUtility A reference to an audio player utility
sl@0
    88
        * @return pointer to CDistanceAttenuation object
sl@0
    89
        */
sl@0
    90
        IMPORT_C static CDistanceAttenuation* NewL( CMdaAudioPlayerUtility& aUtility );
sl@0
    91
sl@0
    92
        /**
sl@0
    93
        * Factory function for creating the distance attenuation object.
sl@0
    94
        * @since 3.0
sl@0
    95
        * @param aUtility A reference to an audio record utility
sl@0
    96
        * @param aRecordStream ETrue if the effect is to be applied to the recording,
sl@0
    97
        *                      EFalse if the effect is to be applied only to the playback
sl@0
    98
        * @return pointer to CDistanceAttenuation object
sl@0
    99
        */
sl@0
   100
        IMPORT_C static CDistanceAttenuation* NewL( CMdaAudioRecorderUtility& aUtility, TBool aRecordStream );
sl@0
   101
sl@0
   102
        /**
sl@0
   103
        * Factory function for creating the distance attenuation object.
sl@0
   104
        * @since 3.0
sl@0
   105
        * @param aDevSound A reference to a DevSound instance
sl@0
   106
        * @return pointer to CDistanceAttenuation object
sl@0
   107
        */
sl@0
   108
        IMPORT_C static CDistanceAttenuation* NewL( CMMFDevSound& aDevSound );
sl@0
   109
sl@0
   110
        /**
sl@0
   111
        * Factory function for creating the distance attenuation object.
sl@0
   112
        * @since 3.0
sl@0
   113
        * @param aUtility A reference to an audio tone utility
sl@0
   114
        * @return pointer to CDistanceAttenuation object
sl@0
   115
        */
sl@0
   116
        IMPORT_C static CDistanceAttenuation* NewL( CMdaAudioToneUtility& aUtility );
sl@0
   117
sl@0
   118
        /**
sl@0
   119
        * Factory function for creating the distance attenuation object.
sl@0
   120
        * @since 3.0
sl@0
   121
        * @param aUtility A reference to a custom command utility
sl@0
   122
        * @return pointer to CDistanceAttenuation object
sl@0
   123
        */
sl@0
   124
        IMPORT_C static CDistanceAttenuation* NewL( CCustomCommandUtility* aUtility );
sl@0
   125
sl@0
   126
        /**
sl@0
   127
        * Factory function for creating the distance attenuation object.
sl@0
   128
        * @since 3.0
sl@0
   129
        * @param aCustomInterface A reference to a custom interface
sl@0
   130
        * @return pointer to CDistanceAttenuation object
sl@0
   131
        */
sl@0
   132
        IMPORT_C static CDistanceAttenuation* NewL( MCustomInterface& aCustomInterface );
sl@0
   133
sl@0
   134
        /**
sl@0
   135
        * Factory function for creating the distance attenuation object.
sl@0
   136
        * @since 3.0
sl@0
   137
        * @param aUtility A reference to a CMidiClientUtility
sl@0
   138
        * @return pointer to CDistanceAttenuation object
sl@0
   139
        */
sl@0
   140
        IMPORT_C static CDistanceAttenuation* NewL( CMidiClientUtility& aUtility );
sl@0
   141
sl@0
   142
sl@0
   143
        /**
sl@0
   144
        * Factory function for creating the distance attenuation object.
sl@0
   145
        * @since 3.0
sl@0
   146
        * @param CDrmPlayerUtility A reference to a CDrmPlayerUtility object
sl@0
   147
        * @return pointer to CDistanceAttenuation object
sl@0
   148
        */
sl@0
   149
        IMPORT_C static CDistanceAttenuation* NewL( CDrmPlayerUtility& aUtility );
sl@0
   150
sl@0
   151
        /**
sl@0
   152
        * Factory function for creating the distance attenuation object.
sl@0
   153
        * @since 3.2
sl@0
   154
        * @param CVideoPlayerUtility A reference to a CVideoPlayerUtility object
sl@0
   155
        * @return pointer to CDistanceAttenuation object
sl@0
   156
        */
sl@0
   157
        IMPORT_C static CDistanceAttenuation* NewL( CVideoPlayerUtility& aUtility );
sl@0
   158
sl@0
   159
        /**
sl@0
   160
        *
sl@0
   161
        * Destructor
sl@0
   162
        */
sl@0
   163
        IMPORT_C virtual ~CDistanceAttenuation();
sl@0
   164
sl@0
   165
        /**
sl@0
   166
        * Gets the Distance Attenuation of the listener.
sl@0
   167
        * @since 3.0
sl@0
   168
        * @param aRMin The source-to-listener distance below which the sound level is constant
sl@0
   169
        * @param aRMax The source-to-listener distance above which the sound level is constant or zero
sl@0
   170
        * @param aMuteAfterMax Indicate if the sound is muted beyond RMax
sl@0
   171
        * @param aRollOffFactor Multiplier factor to source-to-listener distance
sl@0
   172
        * @param aRoomRollOffFactor Multiplier factor to source-to-listener distance for Room effect.
sl@0
   173
        * @return -
sl@0
   174
        */
sl@0
   175
        IMPORT_C void DistanceAttenuation( TInt32& aRMin, TInt32& aRMax, TBool& aMuteAfterMax,
sl@0
   176
                                           TUint32& aRollOffFactor, TUint32& aRoomRollOffFactor );
sl@0
   177
sl@0
   178
        /**
sl@0
   179
        * Get roll off factor maximum value.
sl@0
   180
        * @since 3.0
sl@0
   181
        * @param aRollOffFactor The maximum multiplier factor to source-to-listener distance for Room effect.
sl@0
   182
        * @return -
sl@0
   183
        */
sl@0
   184
        IMPORT_C void RollOffFactorMax( TUint32& aRollOfFactorMax );
sl@0
   185
sl@0
   186
        /**
sl@0
   187
        * Get room roll off factor maximum value.
sl@0
   188
        * @since 3.0
sl@0
   189
        * @param aRollOffFactor The maximum multiplier factor to source-to-listener distance for Room effect.
sl@0
   190
        * @return -
sl@0
   191
        */
sl@0
   192
        IMPORT_C void RoomRollOffFactorMax( TUint32& aRoomRollOfFactorMax );
sl@0
   193
sl@0
   194
        /**
sl@0
   195
        * Sets the Distance Attenuation
sl@0
   196
        * @since 3.0
sl@0
   197
        * @param aRMin The source-to-listener distance below which the sound level is constant
sl@0
   198
        * @param aRMax The source-to-listener distance above which the sound level is constant or zero
sl@0
   199
        * @param aMuteAfterMax Indicate if the sound is muted beyond RMax
sl@0
   200
        * @param aRollOffFactor Multiplier factor to source-to-listener distance
sl@0
   201
        * @param aRoomRollOffFactor Multiplier factor to source-to-listener distance for Room effect.
sl@0
   202
        * @return -
sl@0
   203
        */
sl@0
   204
        IMPORT_C void SetDistanceAttenuationL( TInt32 aRMin, TInt32 aRMax, TBool aMuteAfterMax,
sl@0
   205
                                               TUint32 aRollOffFactor, TUint32 aRoomRollOffFactor );
sl@0
   206
sl@0
   207
    public: // functions from base class
sl@0
   208
sl@0
   209
        /*
sl@0
   210
        * From CAudioEffect
sl@0
   211
        * Get the unique identifier of the audio effect
sl@0
   212
        * @since 3.0
sl@0
   213
        * @return Unique identifier
sl@0
   214
        */
sl@0
   215
        IMPORT_C TUid Uid() const;
sl@0
   216
sl@0
   217
    protected:  // Functions from base classes
sl@0
   218
sl@0
   219
        /**
sl@0
   220
        * From CAudioEffect
sl@0
   221
        * Create a package of the effect data
sl@0
   222
        * @since 3.0
sl@0
   223
        * @return A descriptor containing the effect data.
sl@0
   224
        */
sl@0
   225
        IMPORT_C const TDesC8& DoEffectData();
sl@0
   226
sl@0
   227
        /**
sl@0
   228
        * From CAudioEffect
sl@0
   229
        * Internal function to unpack effect data
sl@0
   230
        * @since 3.0
sl@0
   231
        * @param aEffectDataBuffer Descriptor containing packed effect data
sl@0
   232
        * @return -
sl@0
   233
        */
sl@0
   234
        IMPORT_C void SetEffectData( const TDesC8& aEffectDataBuffer );
sl@0
   235
sl@0
   236
    protected:
sl@0
   237
sl@0
   238
        /**
sl@0
   239
        * Private C++ constructor for this class.
sl@0
   240
        * @since    3.0
sl@0
   241
        * @param    aEffectObserver reference to event observer object
sl@0
   242
        * @return   -
sl@0
   243
        */
sl@0
   244
        IMPORT_C CDistanceAttenuation();
sl@0
   245
sl@0
   246
    protected:
sl@0
   247
sl@0
   248
        // Distance Attenuation data structure
sl@0
   249
        TEfDistanceAttenuation iDistanceAttenuationData;
sl@0
   250
        // Data package sent to server
sl@0
   251
        TEfDistanceAttenuationDataPckg iDataPckgTo;
sl@0
   252
        // Data package received from server
sl@0
   253
        TEfDistanceAttenuationDataPckg iDataPckgFrom;
sl@0
   254
sl@0
   255
   protected:    // Friend classes
sl@0
   256
sl@0
   257
        friend class CDistanceAttenuationMessageHandler;
sl@0
   258
sl@0
   259
    };
sl@0
   260
sl@0
   261
#endif  // of CDISTANCEATTENUATION_H
sl@0
   262
sl@0
   263
// End of File