|
1 /* |
|
2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef LOGICALAUDIOCODEC_H |
|
21 #define LOGICALAUDIOCODEC_H |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <a3f/a3f_trace_utils.h> |
|
25 #include <a3f/a3fbase.h> |
|
26 #include <a3f/maudiocodec.h> |
|
27 |
|
28 #include "componentparameters.h" |
|
29 #include "audioprocessingunit.h" |
|
30 #include "mconfigurationhelper.h" |
|
31 |
|
32 // Remove when the MMRC server is ready |
|
33 #include "maudiocodecadaptationobserver.h" |
|
34 |
|
35 class MLogicalSettingObserver; |
|
36 class MAudioProcessingUnitObserver; |
|
37 class MConfigurationHelper; |
|
38 |
|
39 /** |
|
40 This is the reference implementation of MAudioCodec API. |
|
41 @lib logicalaudiocodec.lib |
|
42 */ |
|
43 |
|
44 NONSHARABLE_CLASS(CLogicalAudioCodec) : public CAudioProcessingUnit, |
|
45 public MAudioCodec, |
|
46 public MAudioCodecAdaptationObserver |
|
47 { |
|
48 friend class CAudioContext; |
|
49 friend class CLogicalAudioStream; |
|
50 public: |
|
51 /** |
|
52 Create a new instance. |
|
53 */ |
|
54 static CLogicalAudioCodec* NewL(TAny* aParam); |
|
55 |
|
56 /** |
|
57 Destructor. |
|
58 Deletes all objects and releases all resource owned by this instance. |
|
59 */ |
|
60 virtual ~CLogicalAudioCodec(); |
|
61 |
|
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); |
|
70 |
|
71 // Override just this |
|
72 TBool IsTypeOf(TUid aTypeId) const; |
|
73 TAny* Interface(TUid aType); |
|
74 |
|
75 // from MAudioCodecAdaptationObserver |
|
76 void AllBuffersProcessed(); |
|
77 void ProcessingUnitError(TInt aError); |
|
78 void GetSupportedAModesComplete(TInt aError); |
|
79 void GetSupportedARatesComplete(TInt aError); |
|
80 |
|
81 private: |
|
82 |
|
83 /** |
|
84 Second phase constructor |
|
85 */ |
|
86 void ConstructL(); |
|
87 |
|
88 /** |
|
89 Constructor |
|
90 */ |
|
91 CLogicalAudioCodec(TAny* aParam); |
|
92 |
|
93 protected: // data |
|
94 |
|
95 // Format uid |
|
96 |
|
97 TUid iFormat; |
|
98 |
|
99 TInt iSampleRateConfig; |
|
100 TUid iModeConfig; |
|
101 RPointerArray<MAudioCodecObserver> iAudioCodecObserver; |
|
102 |
|
103 MConfigurationHelper* iAdaptationStream; |
|
104 |
|
105 }; |
|
106 |
|
107 #endif // LOGICALAUDIOCODEC_H |