sl@0: /* sl@0: * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: #ifndef LOGICALAUDIOCODEC_H sl@0: #define LOGICALAUDIOCODEC_H sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: #include "componentparameters.h" sl@0: #include "audioprocessingunit.h" sl@0: #include "mconfigurationhelper.h" sl@0: sl@0: // Remove when the MMRC server is ready sl@0: #include "maudiocodecadaptationobserver.h" sl@0: sl@0: class MLogicalSettingObserver; sl@0: class MAudioProcessingUnitObserver; sl@0: class MConfigurationHelper; sl@0: sl@0: /** sl@0: This is the reference implementation of MAudioCodec API. sl@0: @lib logicalaudiocodec.lib sl@0: */ sl@0: sl@0: NONSHARABLE_CLASS(CLogicalAudioCodec) : public CAudioProcessingUnit, sl@0: public MAudioCodec, sl@0: public MAudioCodecAdaptationObserver sl@0: { sl@0: friend class CAudioContext; sl@0: friend class CLogicalAudioStream; sl@0: public: sl@0: /** sl@0: Create a new instance. sl@0: */ sl@0: static CLogicalAudioCodec* NewL(TAny* aParam); sl@0: sl@0: /** sl@0: Destructor. sl@0: Deletes all objects and releases all resource owned by this instance. sl@0: */ sl@0: virtual ~CLogicalAudioCodec(); sl@0: sl@0: // from base class MAudioCodec sl@0: TInt SetFormat(TUid aFormat); sl@0: TInt SetSampleRate(TInt aSampleRate); sl@0: TInt SetMode(TUid aMode); sl@0: TInt GetSupportedSamplesRates(RArray& aSupportedRates); sl@0: TInt GetSupportedModes(RArray& aSupportedModes); sl@0: TInt RegisterAudioCodecObserver(MAudioCodecObserver& aObserver); sl@0: void UnregisterAudioCodecObserver(MAudioCodecObserver& aObserver); sl@0: sl@0: // Override just this sl@0: TBool IsTypeOf(TUid aTypeId) const; sl@0: TAny* Interface(TUid aType); sl@0: sl@0: // from MAudioCodecAdaptationObserver sl@0: void AllBuffersProcessed(); sl@0: void ProcessingUnitError(TInt aError); sl@0: void GetSupportedAModesComplete(TInt aError); sl@0: void GetSupportedARatesComplete(TInt aError); sl@0: sl@0: private: sl@0: sl@0: /** sl@0: Second phase constructor sl@0: */ sl@0: void ConstructL(); sl@0: sl@0: /** sl@0: Constructor sl@0: */ sl@0: CLogicalAudioCodec(TAny* aParam); sl@0: sl@0: protected: // data sl@0: sl@0: // Format uid sl@0: sl@0: TUid iFormat; sl@0: sl@0: TInt iSampleRateConfig; sl@0: TUid iModeConfig; sl@0: RPointerArray iAudioCodecObserver; sl@0: sl@0: MConfigurationHelper* iAdaptationStream; sl@0: sl@0: }; sl@0: sl@0: #endif // LOGICALAUDIOCODEC_H