os/mm/mmhais/a3facl/src/audiocodec/logicalaudiocodec.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mmhais/a3facl/src/audiocodec/logicalaudiocodec.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,107 @@
     1.4 +/*
     1.5 +* Copyright (c) 2004-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 LOGICALAUDIOCODEC_H
    1.24 +#define LOGICALAUDIOCODEC_H
    1.25 +
    1.26 +#include <e32base.h>
    1.27 +#include <a3f/a3f_trace_utils.h>
    1.28 +#include <a3f/a3fbase.h>
    1.29 +#include <a3f/maudiocodec.h>
    1.30 +
    1.31 +#include "componentparameters.h"
    1.32 +#include "audioprocessingunit.h"
    1.33 +#include "mconfigurationhelper.h"
    1.34 +
    1.35 +// Remove when the MMRC server is ready
    1.36 +#include "maudiocodecadaptationobserver.h"
    1.37 +
    1.38 +class MLogicalSettingObserver;
    1.39 +class MAudioProcessingUnitObserver;
    1.40 +class MConfigurationHelper;
    1.41 +
    1.42 +/**
    1.43 +	This is the reference implementation of MAudioCodec API.
    1.44 +	@lib logicalaudiocodec.lib
    1.45 + */
    1.46 +
    1.47 +NONSHARABLE_CLASS(CLogicalAudioCodec) : public CAudioProcessingUnit,
    1.48 +										public MAudioCodec,
    1.49 +										public MAudioCodecAdaptationObserver
    1.50 +	{
    1.51 +friend class CAudioContext;
    1.52 +friend class CLogicalAudioStream;
    1.53 +public:
    1.54 +	/**
    1.55 +	Create a new instance.
    1.56 +	*/
    1.57 +	static CLogicalAudioCodec* NewL(TAny* aParam);
    1.58 +
    1.59 +	/**
    1.60 +	Destructor.
    1.61 +	Deletes all objects and releases all resource owned by this instance.
    1.62 +	*/
    1.63 +	virtual ~CLogicalAudioCodec();
    1.64 +
    1.65 +	// from base class MAudioCodec
    1.66 +	TInt SetFormat(TUid aFormat);
    1.67 +	TInt SetSampleRate(TInt aSampleRate);
    1.68 +	TInt SetMode(TUid aMode);
    1.69 +	TInt GetSupportedSamplesRates(RArray<TInt>& aSupportedRates);
    1.70 +	TInt GetSupportedModes(RArray<TUid>& aSupportedModes);
    1.71 +	TInt RegisterAudioCodecObserver(MAudioCodecObserver& aObserver);
    1.72 +	void UnregisterAudioCodecObserver(MAudioCodecObserver& aObserver);
    1.73 +
    1.74 +	// Override just this
    1.75 +	TBool IsTypeOf(TUid aTypeId) const;
    1.76 +	TAny* Interface(TUid aType);
    1.77 +
    1.78 +	// from MAudioCodecAdaptationObserver
    1.79 +	void AllBuffersProcessed();
    1.80 +	void ProcessingUnitError(TInt aError);
    1.81 +	void GetSupportedAModesComplete(TInt aError);
    1.82 +	void GetSupportedARatesComplete(TInt aError);
    1.83 +
    1.84 +private:
    1.85 +
    1.86 +	/**
    1.87 +	Second phase constructor
    1.88 +	*/
    1.89 +	void ConstructL();
    1.90 +
    1.91 +	/**
    1.92 +	Constructor
    1.93 +	*/
    1.94 +	CLogicalAudioCodec(TAny* aParam);
    1.95 +
    1.96 +protected: // data
    1.97 +
    1.98 +	// Format uid
    1.99 +
   1.100 +	TUid	iFormat;
   1.101 +
   1.102 +	TInt				iSampleRateConfig;
   1.103 +	TUid				iModeConfig;
   1.104 +	RPointerArray<MAudioCodecObserver> iAudioCodecObserver;
   1.105 +
   1.106 +	MConfigurationHelper*		iAdaptationStream;
   1.107 +
   1.108 +	};
   1.109 +
   1.110 +#endif // LOGICALAUDIOCODEC_H