os/mm/mm_plat/audio_effects_proxy_api/inc/AudioEqualizerProxy.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2004 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 "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:  This is the definition of the Audio Equalizer proxy class.
    15 *
    16 *
    17 */
    18 
    19 
    20 #ifndef CAUDIOEQUALIZERPROXY_H
    21 #define CAUDIOEQUALIZERPROXY_H
    22 
    23 // INCLUDES
    24 
    25 #include <e32base.h>
    26 #include <AudioEqualizerBase.h>
    27 #include <mmf/common/mmfcontrollerframework.h>
    28 #include <CustomCommandUtility.h>
    29 #include "AudioEqualizerMessageTypes.h"
    30 #include <MAudioEqualizerObserver.h>
    31 #include <MAudioEffectObserver.h>
    32 
    33 // FORWARD DECLARATION
    34 class CAudioEqualizerEventObserver;
    35 
    36 // CLASS DECLARATION
    37 
    38 /**
    39 *  Interface class to be implemented by objects that receives callbacks from Audio Equalizer Event Observer.
    40 *
    41 *  @since 3.0
    42 */
    43 class MAudioEqualizerCallback
    44     {
    45     public:
    46 
    47         /**
    48         * Invoked by the AudioEqualizer Event Observer when the AudioEqualizer object changes state
    49         * @since 3.0
    50         * @param aBuffer Buffer containing the AudioEqualizer data
    51         */
    52         virtual void AudioEqualizerEventL( const TDesC8& aDataPckg ) = 0;
    53 
    54     };
    55 
    56 /**
    57 *  This is the AudioEqualizer effect proxy class responsible for handling framework messages.
    58 *
    59 *  @lib AudioEqualizerProxy.lib
    60 *  @since 3.0
    61 */
    62 
    63 class CAudioEqualizerProxy : public CAudioEqualizer,
    64 					         public MAudioEqualizerCallback
    65 	{
    66 	public:		// Constructors and destructor
    67 
    68 	    /**
    69         *
    70         * Factory function for creating the AudioEqualizer proxy object.
    71         * @since 3.0
    72         * @param aMessageHandler reference to message handler
    73         * @param aCustomCommand reference to custom command utility
    74         * @return	pointer to a AudioEqualizer proxy object
    75         */
    76 		IMPORT_C static CAudioEqualizerProxy* NewL( TMMFMessageDestinationPckg aMessageHandler,
    77                      						        MCustomCommand& aCustomCommand,
    78                       						        CCustomInterfaceUtility* aCustomInterfaceUtility );
    79 		/**
    80         *
    81         * Destructor
    82         */
    83 		virtual ~CAudioEqualizerProxy();
    84 
    85 	public: // functions from base class
    86 
    87 		/**
    88 		* From CAudioEffect
    89         * Apply effect settings
    90         * @since 3.0
    91         */
    92 		IMPORT_C virtual void ApplyL();
    93 
    94 	public: // functions from MAudioEqualizerCallback
    95 
    96 		/**
    97 		* From MAudioEqualizerCallback
    98         * Changes to AudioEqualizer data has occured
    99         * @since 3.0
   100         * @param aBuffer Buffer containing serialized AudioEqualizer data
   101         */
   102 		void AudioEqualizerEventL( const TDesC8& aDataPckg );
   103 
   104 	private:
   105 
   106 		/**
   107 		* Private C++ constructor for this class.
   108         * @since	3.0
   109         * @param aMessageHandler reference to message handler
   110         * @param aCustomCommand reference to custom command utility
   111         * @return	-
   112         */
   113 		CAudioEqualizerProxy(TMMFMessageDestinationPckg aMessageHandler, MCustomCommand& aCustomCommand,
   114 					         CCustomInterfaceUtility* aCustomInterfaceUtility);
   115 
   116 		/**
   117 		* Second phase constructor for this class.
   118         * @since	3.0
   119         * @return -
   120         */
   121 		void ConstructL();
   122 
   123 		/**
   124 		* Start the active observer.
   125         * @since	3.0
   126 		* @param -
   127         * @return -
   128         */
   129         void StartObserver();
   130 
   131 	private:
   132 
   133 		// Pointer to custom command utility
   134 		MCustomCommand* iCustomCommand;
   135 		// Message handler handle
   136 		TMMFMessageDestinationPckg iMessageHandler;
   137 	 	// AudioEqualizer Event Observer
   138 		CAudioEqualizerEventObserver* iAudioEqualizerEventObserver;
   139 		// Pointer to the custom interface utility
   140     	CCustomInterfaceUtility* iCustomInterfaceUtility;
   141 
   142 	};
   143 
   144 #endif	// of CAudioEqualizerPROXY_H
   145 
   146 // End of File