First public contribution.
2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Name : logicalaudiogaincontrol.h
16 * Part of : ACL Logical Layer
22 #ifndef LOGICALAUDIOGAINCONTROL_H
23 #define LOGICALAUDIOGAINCONTROL_H
26 #include <a3f/a3f_trace_utils.h>
27 #include <a3f/a3fbase.h>
28 #include <a3f/maudiogaincontrol.h>
29 #include <a3f/maudiogaincontrolobserver.h>
31 #include "audioprocessingunit.h"
34 class MLogicalSettingObserver;
37 Implementation of audio gain control API.
39 @lib audiogaincontrol.lib
42 NONSHARABLE_CLASS(CLogicalAudioGainControl) : public CAudioProcessingUnit,
43 public MAudioGainControl,
44 public MAudioGainControlObserver
46 friend class CAudioContext;
47 friend class CLogicalAudioStream;
54 Deletes all objects and releases all resource owned by this instance.
56 virtual ~CLogicalAudioGainControl();
58 // from base class MAudioGainControl
59 virtual TInt GetMaxGain(TInt& aMaxGain) const;
60 virtual TInt GetMaxRampTime(TTimeIntervalMicroSeconds& aMaxRampTime)const;
61 virtual TInt SetGain(RArray<TAudioChannelGain>& aChannels, TUid aRampOperation, const TTimeIntervalMicroSeconds& aRampDuration);
62 virtual TInt SetGain(RArray<TAudioChannelGain>& aChannels);
63 virtual TInt GetGain(RArray<TAudioChannelGain>& aChannels) const;
64 virtual TInt RegisterAudioGainControlObserver(MAudioGainControlObserver& aObserver);
65 virtual void UnregisterAudioGainControlObserver(MAudioGainControlObserver& aObserver);
67 // from base class CAudioProcessingUnit
68 virtual TBool IsTypeOf(TUid aTypeId) const;
69 virtual TAny* Interface(TUid aType);
71 // from base class MAudioGainControlObserver
72 void MaxRampTimeChanged(MAudioGainControl& aGain);
73 void MaxGainChanged(MAudioGainControl& aGain);
74 void GainChanged(MAudioGainControl& aGain, TInt aError);
77 Create a new instance.
79 @param aGaincontrol the gain implementation. Ownership of the pointer
80 is transferred to the create CAudioGainControl object instance.
81 @return CAudioGainControl* a pointer to the created instance.
83 static CLogicalAudioGainControl* NewL(TAny* aParam);
90 CLogicalAudioGainControl(TAny* aParam);
93 RArray<TAudioChannelGain> iActiveChannels;
95 RArray<TAudioChannelGain> iDesiredChannels;
97 TTimeIntervalMicroSeconds iDesiredRampTime;
99 TUid iDesiredRampOperation;
102 // Maximum value for ramp time
103 TTimeIntervalMicroSeconds iMaxRampTime;
105 // The adaptation gain control
106 MAudioGainControl* iAdaptationGain;
108 RPointerArray<MAudioGainControlObserver> iGainObservers;
111 #endif // LOGICALAUDIOGAINCONTROL_H