os/mm/mmhais/a3facl/src/audiogaincontrol/logicalaudiogaincontrol.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mmhais/a3facl/src/audiogaincontrol/logicalaudiogaincontrol.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,111 @@
     1.4 +/*
     1.5 +* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:
    1.18 +* Name        : logicalaudiogaincontrol.h
    1.19 +* Part of     : ACL Logical Layer
    1.20 +*
    1.21 +*/
    1.22 +
    1.23 +
    1.24 +
    1.25 +#ifndef LOGICALAUDIOGAINCONTROL_H
    1.26 +#define LOGICALAUDIOGAINCONTROL_H
    1.27 +
    1.28 +#include <e32base.h>
    1.29 +#include <a3f/a3f_trace_utils.h>
    1.30 +#include <a3f/a3fbase.h>
    1.31 +#include <a3f/maudiogaincontrol.h>
    1.32 +#include <a3f/maudiogaincontrolobserver.h>
    1.33 +
    1.34 +#include "audioprocessingunit.h"
    1.35 +
    1.36 +
    1.37 +class MLogicalSettingObserver;
    1.38 +
    1.39 +/**
    1.40 +Implementation of audio gain control API.
    1.41 +
    1.42 +@lib audiogaincontrol.lib
    1.43 +*/
    1.44 +
    1.45 +NONSHARABLE_CLASS(CLogicalAudioGainControl) : 	public CAudioProcessingUnit,
    1.46 +												public MAudioGainControl,
    1.47 +												public MAudioGainControlObserver
    1.48 +	{
    1.49 +friend class CAudioContext;
    1.50 +friend class CLogicalAudioStream;
    1.51 +
    1.52 +public:
    1.53 +
    1.54 +	/**
    1.55 +	Destructor.
    1.56 +
    1.57 +	Deletes all objects and releases all resource owned by this instance.
    1.58 +	*/
    1.59 +	virtual ~CLogicalAudioGainControl();
    1.60 +
    1.61 +	// from base class MAudioGainControl
    1.62 +	virtual TInt GetMaxGain(TInt& aMaxGain) const;
    1.63 +	virtual TInt GetMaxRampTime(TTimeIntervalMicroSeconds& aMaxRampTime)const;
    1.64 +	virtual TInt SetGain(RArray<TAudioChannelGain>& aChannels, TUid aRampOperation, const TTimeIntervalMicroSeconds& aRampDuration);
    1.65 +	virtual TInt SetGain(RArray<TAudioChannelGain>& aChannels);
    1.66 +	virtual TInt GetGain(RArray<TAudioChannelGain>& aChannels) const;
    1.67 +	virtual TInt RegisterAudioGainControlObserver(MAudioGainControlObserver& aObserver);
    1.68 +	virtual void UnregisterAudioGainControlObserver(MAudioGainControlObserver& aObserver);
    1.69 +
    1.70 +	// from base class CAudioProcessingUnit
    1.71 +	virtual TBool IsTypeOf(TUid aTypeId) const;
    1.72 +	virtual TAny* Interface(TUid aType);
    1.73 +
    1.74 +	// from base class MAudioGainControlObserver
    1.75 +	void MaxRampTimeChanged(MAudioGainControl& aGain);
    1.76 +	void MaxGainChanged(MAudioGainControl& aGain);
    1.77 +	void GainChanged(MAudioGainControl& aGain, TInt aError);
    1.78 +
    1.79 +	/**
    1.80 +	Create a new instance.
    1.81 +
    1.82 +	@param aGaincontrol the gain implementation. Ownership of the pointer
    1.83 +			is transferred to the  create CAudioGainControl object instance.
    1.84 +	@return CAudioGainControl* a pointer to the created instance.
    1.85 +	*/
    1.86 +	static CLogicalAudioGainControl* NewL(TAny* aParam);
    1.87 +
    1.88 +
    1.89 +private:
    1.90 +
    1.91 +	void ConstructL();
    1.92 +
    1.93 +	CLogicalAudioGainControl(TAny* aParam);
    1.94 +
    1.95 +protected:
    1.96 +	RArray<TAudioChannelGain> iActiveChannels;
    1.97 +
    1.98 +	RArray<TAudioChannelGain> iDesiredChannels;
    1.99 +
   1.100 +	TTimeIntervalMicroSeconds iDesiredRampTime;
   1.101 +
   1.102 +	TUid iDesiredRampOperation;
   1.103 +
   1.104 +private:
   1.105 +	// Maximum value for ramp time
   1.106 +	TTimeIntervalMicroSeconds iMaxRampTime;
   1.107 +
   1.108 +	// The adaptation gain control
   1.109 +	MAudioGainControl* iAdaptationGain;
   1.110 +
   1.111 +	RPointerArray<MAudioGainControlObserver> iGainObservers;
   1.112 +	};
   1.113 +
   1.114 +#endif // LOGICALAUDIOGAINCONTROL_H