First public contribution.
2 * Copyright (c) 2004-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 LOGICALAUDIOCODEC_H
21 #define LOGICALAUDIOCODEC_H
24 #include <a3f/a3f_trace_utils.h>
25 #include <a3f/a3fbase.h>
26 #include <a3f/maudiocodec.h>
28 #include "componentparameters.h"
29 #include "audioprocessingunit.h"
30 #include "mconfigurationhelper.h"
32 // Remove when the MMRC server is ready
33 #include "maudiocodecadaptationobserver.h"
35 class MLogicalSettingObserver;
36 class MAudioProcessingUnitObserver;
37 class MConfigurationHelper;
40 This is the reference implementation of MAudioCodec API.
41 @lib logicalaudiocodec.lib
44 NONSHARABLE_CLASS(CLogicalAudioCodec) : public CAudioProcessingUnit,
46 public MAudioCodecAdaptationObserver
48 friend class CAudioContext;
49 friend class CLogicalAudioStream;
52 Create a new instance.
54 static CLogicalAudioCodec* NewL(TAny* aParam);
58 Deletes all objects and releases all resource owned by this instance.
60 virtual ~CLogicalAudioCodec();
62 // from base class MAudioCodec
63 TInt SetFormat(TUid aFormat);
64 TInt SetSampleRate(TInt aSampleRate);
65 TInt SetMode(TUid aMode);
66 TInt GetSupportedSamplesRates(RArray<TInt>& aSupportedRates);
67 TInt GetSupportedModes(RArray<TUid>& aSupportedModes);
68 TInt RegisterAudioCodecObserver(MAudioCodecObserver& aObserver);
69 void UnregisterAudioCodecObserver(MAudioCodecObserver& aObserver);
72 TBool IsTypeOf(TUid aTypeId) const;
73 TAny* Interface(TUid aType);
75 // from MAudioCodecAdaptationObserver
76 void AllBuffersProcessed();
77 void ProcessingUnitError(TInt aError);
78 void GetSupportedAModesComplete(TInt aError);
79 void GetSupportedARatesComplete(TInt aError);
84 Second phase constructor
91 CLogicalAudioCodec(TAny* aParam);
99 TInt iSampleRateConfig;
101 RPointerArray<MAudioCodecObserver> iAudioCodecObserver;
103 MConfigurationHelper* iAdaptationStream;
107 #endif // LOGICALAUDIOCODEC_H