diff -r 000000000000 -r bde4ae8d615e os/mm/mmhais/a3facl/src/audiogaincontrol/logicalaudiogaincontrol.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os/mm/mmhais/a3facl/src/audiogaincontrol/logicalaudiogaincontrol.h Fri Jun 15 03:10:57 2012 +0200 @@ -0,0 +1,111 @@ +/* +* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Name : logicalaudiogaincontrol.h +* Part of : ACL Logical Layer +* +*/ + + + +#ifndef LOGICALAUDIOGAINCONTROL_H +#define LOGICALAUDIOGAINCONTROL_H + +#include +#include +#include +#include +#include + +#include "audioprocessingunit.h" + + +class MLogicalSettingObserver; + +/** +Implementation of audio gain control API. + +@lib audiogaincontrol.lib +*/ + +NONSHARABLE_CLASS(CLogicalAudioGainControl) : public CAudioProcessingUnit, + public MAudioGainControl, + public MAudioGainControlObserver + { +friend class CAudioContext; +friend class CLogicalAudioStream; + +public: + + /** + Destructor. + + Deletes all objects and releases all resource owned by this instance. + */ + virtual ~CLogicalAudioGainControl(); + + // from base class MAudioGainControl + virtual TInt GetMaxGain(TInt& aMaxGain) const; + virtual TInt GetMaxRampTime(TTimeIntervalMicroSeconds& aMaxRampTime)const; + virtual TInt SetGain(RArray& aChannels, TUid aRampOperation, const TTimeIntervalMicroSeconds& aRampDuration); + virtual TInt SetGain(RArray& aChannels); + virtual TInt GetGain(RArray& aChannels) const; + virtual TInt RegisterAudioGainControlObserver(MAudioGainControlObserver& aObserver); + virtual void UnregisterAudioGainControlObserver(MAudioGainControlObserver& aObserver); + + // from base class CAudioProcessingUnit + virtual TBool IsTypeOf(TUid aTypeId) const; + virtual TAny* Interface(TUid aType); + + // from base class MAudioGainControlObserver + void MaxRampTimeChanged(MAudioGainControl& aGain); + void MaxGainChanged(MAudioGainControl& aGain); + void GainChanged(MAudioGainControl& aGain, TInt aError); + + /** + Create a new instance. + + @param aGaincontrol the gain implementation. Ownership of the pointer + is transferred to the create CAudioGainControl object instance. + @return CAudioGainControl* a pointer to the created instance. + */ + static CLogicalAudioGainControl* NewL(TAny* aParam); + + +private: + + void ConstructL(); + + CLogicalAudioGainControl(TAny* aParam); + +protected: + RArray iActiveChannels; + + RArray iDesiredChannels; + + TTimeIntervalMicroSeconds iDesiredRampTime; + + TUid iDesiredRampOperation; + +private: + // Maximum value for ramp time + TTimeIntervalMicroSeconds iMaxRampTime; + + // The adaptation gain control + MAudioGainControl* iAdaptationGain; + + RPointerArray iGainObservers; + }; + +#endif // LOGICALAUDIOGAINCONTROL_H