diff -r 000000000000 -r 40261b775718 mmhais/a3facl/src/audiocodec/logicalaudiocodec.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmhais/a3facl/src/audiocodec/logicalaudiocodec.h Tue Feb 02 01:56:55 2010 +0200 @@ -0,0 +1,107 @@ +/* +* 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: +* +*/ + + + +#ifndef LOGICALAUDIOCODEC_H +#define LOGICALAUDIOCODEC_H + +#include +#include +#include +#include + +#include "componentparameters.h" +#include "audioprocessingunit.h" +#include "mconfigurationhelper.h" + +// Remove when the MMRC server is ready +#include "maudiocodecadaptationobserver.h" + +class MLogicalSettingObserver; +class MAudioProcessingUnitObserver; +class MConfigurationHelper; + +/** + This is the reference implementation of MAudioCodec API. + @lib logicalaudiocodec.lib + */ + +NONSHARABLE_CLASS(CLogicalAudioCodec) : public CAudioProcessingUnit, + public MAudioCodec, + public MAudioCodecAdaptationObserver + { +friend class CAudioContext; +friend class CLogicalAudioStream; +public: + /** + Create a new instance. + */ + static CLogicalAudioCodec* NewL(TAny* aParam); + + /** + Destructor. + Deletes all objects and releases all resource owned by this instance. + */ + virtual ~CLogicalAudioCodec(); + + // from base class MAudioCodec + TInt SetFormat(TUid aFormat); + TInt SetSampleRate(TInt aSampleRate); + TInt SetMode(TUid aMode); + TInt GetSupportedSamplesRates(RArray& aSupportedRates); + TInt GetSupportedModes(RArray& aSupportedModes); + TInt RegisterAudioCodecObserver(MAudioCodecObserver& aObserver); + void UnregisterAudioCodecObserver(MAudioCodecObserver& aObserver); + + // Override just this + TBool IsTypeOf(TUid aTypeId) const; + TAny* Interface(TUid aType); + + // from MAudioCodecAdaptationObserver + void AllBuffersProcessed(); + void ProcessingUnitError(TInt aError); + void GetSupportedAModesComplete(TInt aError); + void GetSupportedARatesComplete(TInt aError); + +private: + + /** + Second phase constructor + */ + void ConstructL(); + + /** + Constructor + */ + CLogicalAudioCodec(TAny* aParam); + +protected: // data + + // Format uid + + TUid iFormat; + + TInt iSampleRateConfig; + TUid iModeConfig; + RPointerArray iAudioCodecObserver; + + MConfigurationHelper* iAdaptationStream; + + }; + +#endif // LOGICALAUDIOCODEC_H