Update contrib.
2 * Copyright (c) 2007-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.
20 #ifndef AUDIOGAINCONTROL_H
21 #define AUDIOGAINCONTROL_H
24 #include <a3f/a3fbase.h>
25 #include <a3f/maudiogaincontrol.h>
26 #include <a3f/maudiogaincontrolobserver.h>
28 #include "mgainhelper.h"
30 #include <a3f/a3f_trace_utils.h>
33 const TUint KDefaultGain = 5;
34 const TUint KDefaultMaxGain = 255; // TODO should discover at run time but this is value of current Symbian sound driver adaptor
35 const TUint KDefaultNumChannels = 2;
36 const TUint KDefaultMaxRampTime = 5;
38 enum TGainControlPanicCode
40 EAdaptationOldSetGainCalledPanic,
44 * Implementation of audio gain control API.
45 * ?more_complete_description
46 * @lib audiogaincontrol.lib
48 NONSHARABLE_CLASS(CAudioGainControl) : public CBase, public MAudioGainControl
52 IMPORT_C static CAudioGainControl* NewL();
56 * Deletes all objects and releases all resource owned by this instance.
58 virtual ~CAudioGainControl();
60 IMPORT_C void SetHelper(MGainHelper& aHelper);
62 IMPORT_C void IssueGainChangedCallBack(TInt aError);
64 IMPORT_C TInt ConfigureRamp(TUid aRampOperation, const TTimeIntervalMicroSeconds& aRampDuration);
66 void IssueMaxGainChangedCallBack();
67 void IssueMaxRampTimeChangedCallBack();
69 // from base class MAudioGainControl
70 TInt GetMaxGain(TInt& aMaxGain) const;
71 TInt GetMaxRampTime(TTimeIntervalMicroSeconds& aMaxRampTime) const;
72 TInt SetGain(RArray<TAudioChannelGain>& aChannels, TUid aRampOperation, const TTimeIntervalMicroSeconds& aRampDuration);
73 TInt SetGain(RArray<TAudioChannelGain>& aChannels);
74 TInt GetGain(RArray<TAudioChannelGain>& aChannels) const;
75 TInt RegisterAudioGainControlObserver(MAudioGainControlObserver& aObserver);
76 void UnregisterAudioGainControlObserver(MAudioGainControlObserver& aObserver);
84 RArray<TAudioChannelGain> iGains;
86 * Reference to observer instance
88 RPointerArray<MAudioGainControlObserver> iGainObservers;
90 // The gain cannot talk directly with the sound device driver so it needs a helper to request
94 #endif // AUDIOGAINCONTROL_H