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