os/mm/mm_pub/audio_effects_api/inc/AudioEffectBase.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) 2004 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 effects base class.
sl@0
    15
*
sl@0
    16
*
sl@0
    17
*/
sl@0
    18
sl@0
    19
sl@0
    20
#ifndef CAUDIOEFFECT_H
sl@0
    21
#define CAUDIOEFFECT_H
sl@0
    22
sl@0
    23
// INCLUDES
sl@0
    24
#include <e32base.h>
sl@0
    25
sl@0
    26
// FORWARD DECLARATION
sl@0
    27
class MAudioEffectObserver;
sl@0
    28
sl@0
    29
// CLASS DECLARATION
sl@0
    30
sl@0
    31
/**
sl@0
    32
*  This is the base class for audio effects.
sl@0
    33
*
sl@0
    34
*  @lib AudioEffectBase.lib
sl@0
    35
*  @since 3.0
sl@0
    36
*/
sl@0
    37
sl@0
    38
class CAudioEffect : public CBase
sl@0
    39
	{
sl@0
    40
sl@0
    41
	public: // Constructors and destructor
sl@0
    42
sl@0
    43
		/**
sl@0
    44
        *	Destructor
sl@0
    45
        */
sl@0
    46
		IMPORT_C virtual ~CAudioEffect();
sl@0
    47
sl@0
    48
    public: // New functions
sl@0
    49
sl@0
    50
		/**
sl@0
    51
        * Apply effect settings
sl@0
    52
        * @since 3.0
sl@0
    53
        */
sl@0
    54
		virtual void ApplyL() = 0;
sl@0
    55
sl@0
    56
		/**
sl@0
    57
        * Disable the effect
sl@0
    58
        * @since 3.0
sl@0
    59
        */
sl@0
    60
		IMPORT_C virtual void DisableL();
sl@0
    61
sl@0
    62
		/**
sl@0
    63
        * Enable the effect
sl@0
    64
        * @since 3.0
sl@0
    65
        */
sl@0
    66
		IMPORT_C virtual void EnableL();
sl@0
    67
sl@0
    68
		/**
sl@0
    69
        * Enforce the effect.
sl@0
    70
        * @since 3.0
sl@0
    71
        * @param aEnforced Indicate the effect is to be enforced or not. ETrue = Enforced.
sl@0
    72
        */
sl@0
    73
		IMPORT_C virtual void EnforceL( TBool aEnforced );
sl@0
    74
sl@0
    75
		/**
sl@0
    76
        * Check if this effect object currently has update rights.
sl@0
    77
        * A client can lose update rights in some hardware platforms where there are a limited
sl@0
    78
        * number of instances of an effect that can exist at the same time. When an effect instance
sl@0
    79
        * has lost update rights the user can still change settings, but any calls to Apply the
sl@0
    80
        * settings will be deferred until update rights are regained.
sl@0
    81
        * @since 3.0
sl@0
    82
        * @return ETrue if this object currently has rights to update the settings of this effect,
sl@0
    83
        *         EFalse otherwise.
sl@0
    84
        */
sl@0
    85
		IMPORT_C virtual TBool HaveUpdateRights() const;
sl@0
    86
sl@0
    87
		/**
sl@0
    88
        * Check if the effect is enabled
sl@0
    89
        * @since 3.0
sl@0
    90
        * @return ETrue if the effect is enabled, EFalse if the effect is disabled.
sl@0
    91
        */
sl@0
    92
		IMPORT_C virtual TBool IsEnabled() const;
sl@0
    93
sl@0
    94
		/**
sl@0
    95
        * Check if the effect is enforced.
sl@0
    96
        * @since 3.0
sl@0
    97
        * @return ETrue if the effect is enforced, EFalse if the effect isn ot enforced.
sl@0
    98
        */
sl@0
    99
		IMPORT_C virtual TBool IsEnforced() const;
sl@0
   100
sl@0
   101
		/**
sl@0
   102
        * Adds the specified observer to the list of observers to be notified when
sl@0
   103
        * the effect object changes state.
sl@0
   104
        * @since 3.0
sl@0
   105
        * @param aObserver Object to be added to notifier list.
sl@0
   106
        */
sl@0
   107
		IMPORT_C void RegisterObserverL( MAudioEffectObserver& aObserver );
sl@0
   108
sl@0
   109
		/*
sl@0
   110
        * Get the unique identifier of the audio effect
sl@0
   111
        * @since 3.0
sl@0
   112
        * @return Unique identifier of the audio effect object.
sl@0
   113
        */
sl@0
   114
		virtual TUid Uid() const = 0 ;
sl@0
   115
sl@0
   116
		/**
sl@0
   117
        * Removes the specified observer from the list of observers.
sl@0
   118
        * @since 3.0
sl@0
   119
        * @param aObserver object to be removed.
sl@0
   120
        */
sl@0
   121
		IMPORT_C void UnRegisterObserver( MAudioEffectObserver& aObserver );
sl@0
   122
sl@0
   123
	protected:
sl@0
   124
sl@0
   125
		/**
sl@0
   126
		* Private C++ constructor for this class.
sl@0
   127
        * @since 3.0
sl@0
   128
        * @param aEffectObserver	reference to event observer object
sl@0
   129
        * @return -
sl@0
   130
        */
sl@0
   131
		IMPORT_C CAudioEffect();
sl@0
   132
sl@0
   133
		/**
sl@0
   134
		* Internal function to package data into a descriptor.
sl@0
   135
        * @since 3.0
sl@0
   136
        * @return A descriptor containing the effect data.
sl@0
   137
        */
sl@0
   138
		virtual const TDesC8& DoEffectData() = 0 ;
sl@0
   139
sl@0
   140
		/**
sl@0
   141
		* Internal function to unpack effect data
sl@0
   142
        * @since 3.0
sl@0
   143
        * @param aEffectDataBuffer Descriptor containing packed effect data
sl@0
   144
        */
sl@0
   145
        virtual void SetEffectData( const TDesC8& aEffectDataBuffer ) = 0;
sl@0
   146
sl@0
   147
	protected: // Data
sl@0
   148
sl@0
   149
		// Flag to indicate whether the effect is enabled or not
sl@0
   150
		TBool iEnabled;
sl@0
   151
		// Flag to indicate wheter the effect is enforced
sl@0
   152
		TBool iEnforced;
sl@0
   153
		// Flag to indicate wheter the effect current has update rights
sl@0
   154
		TBool iHaveUpdateRights;
sl@0
   155
		// Pointer to Observers
sl@0
   156
		RPointerArray<MAudioEffectObserver> iObservers;
sl@0
   157
	};
sl@0
   158
sl@0
   159
#endif	// of CAUDIOEFFECT_H
sl@0
   160
sl@0
   161
// End of File