1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmhais/refacladapt/src/audiogaincontrol/audiogaincontrol.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,94 @@
1.4 +/*
1.5 +* Copyright (c) 2007-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 +*
1.19 +*/
1.20 +
1.21 +
1.22 +
1.23 +#ifndef AUDIOGAINCONTROL_H
1.24 +#define AUDIOGAINCONTROL_H
1.25 +
1.26 +#include <e32base.h>
1.27 +#include <a3f/a3fbase.h>
1.28 +#include <a3f/maudiogaincontrol.h>
1.29 +#include <a3f/maudiogaincontrolobserver.h>
1.30 +
1.31 +#include "mgainhelper.h"
1.32 +
1.33 +#include <a3f/a3f_trace_utils.h>
1.34 +
1.35 +
1.36 +const TUint KDefaultGain = 5;
1.37 +const TUint KDefaultMaxGain = 255; // TODO should discover at run time but this is value of current Symbian sound driver adaptor
1.38 +const TUint KDefaultNumChannels = 2;
1.39 +const TUint KDefaultMaxRampTime = 5;
1.40 +
1.41 +enum TGainControlPanicCode
1.42 + {
1.43 + EAdaptationOldSetGainCalledPanic,
1.44 + };
1.45 +
1.46 +/**
1.47 + * Implementation of audio gain control API.
1.48 + * ?more_complete_description
1.49 + * @lib audiogaincontrol.lib
1.50 + */
1.51 +NONSHARABLE_CLASS(CAudioGainControl) : public CBase, public MAudioGainControl
1.52 + {
1.53 +public:
1.54 +
1.55 + IMPORT_C static CAudioGainControl* NewL();
1.56 + /**
1.57 + * Destructor.
1.58 + *
1.59 + * Deletes all objects and releases all resource owned by this instance.
1.60 + */
1.61 + virtual ~CAudioGainControl();
1.62 +
1.63 + IMPORT_C void SetHelper(MGainHelper& aHelper);
1.64 +
1.65 + IMPORT_C void IssueGainChangedCallBack(TInt aError);
1.66 +
1.67 + IMPORT_C TInt ConfigureRamp(TUid aRampOperation, const TTimeIntervalMicroSeconds& aRampDuration);
1.68 +
1.69 + void IssueMaxGainChangedCallBack();
1.70 + void IssueMaxRampTimeChangedCallBack();
1.71 +
1.72 + // from base class MAudioGainControl
1.73 + TInt GetMaxGain(TInt& aMaxGain) const;
1.74 + TInt GetMaxRampTime(TTimeIntervalMicroSeconds& aMaxRampTime) const;
1.75 + TInt SetGain(RArray<TAudioChannelGain>& aChannels, TUid aRampOperation, const TTimeIntervalMicroSeconds& aRampDuration);
1.76 + TInt SetGain(RArray<TAudioChannelGain>& aChannels);
1.77 + TInt GetGain(RArray<TAudioChannelGain>& aChannels) const;
1.78 + TInt RegisterAudioGainControlObserver(MAudioGainControlObserver& aObserver);
1.79 + void UnregisterAudioGainControlObserver(MAudioGainControlObserver& aObserver);
1.80 +
1.81 +private:
1.82 + void ConstructL();
1.83 +
1.84 + CAudioGainControl();
1.85 +
1.86 +private: //data
1.87 + RArray<TAudioChannelGain> iGains;
1.88 + /**
1.89 + * Reference to observer instance
1.90 + */
1.91 + RPointerArray<MAudioGainControlObserver> iGainObservers;
1.92 +
1.93 + // The gain cannot talk directly with the sound device driver so it needs a helper to request
1.94 + MGainHelper* iHelper;
1.95 + };
1.96 +
1.97 +#endif // AUDIOGAINCONTROL_H