sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
|
sl@0
|
20 |
#ifndef LOGICALAUDIOCODEC_H
|
sl@0
|
21 |
#define LOGICALAUDIOCODEC_H
|
sl@0
|
22 |
|
sl@0
|
23 |
#include <e32base.h>
|
sl@0
|
24 |
#include <a3f/a3f_trace_utils.h>
|
sl@0
|
25 |
#include <a3f/a3fbase.h>
|
sl@0
|
26 |
#include <a3f/maudiocodec.h>
|
sl@0
|
27 |
|
sl@0
|
28 |
#include "componentparameters.h"
|
sl@0
|
29 |
#include "audioprocessingunit.h"
|
sl@0
|
30 |
#include "mconfigurationhelper.h"
|
sl@0
|
31 |
|
sl@0
|
32 |
// Remove when the MMRC server is ready
|
sl@0
|
33 |
#include "maudiocodecadaptationobserver.h"
|
sl@0
|
34 |
|
sl@0
|
35 |
class MLogicalSettingObserver;
|
sl@0
|
36 |
class MAudioProcessingUnitObserver;
|
sl@0
|
37 |
class MConfigurationHelper;
|
sl@0
|
38 |
|
sl@0
|
39 |
/**
|
sl@0
|
40 |
This is the reference implementation of MAudioCodec API.
|
sl@0
|
41 |
@lib logicalaudiocodec.lib
|
sl@0
|
42 |
*/
|
sl@0
|
43 |
|
sl@0
|
44 |
NONSHARABLE_CLASS(CLogicalAudioCodec) : public CAudioProcessingUnit,
|
sl@0
|
45 |
public MAudioCodec,
|
sl@0
|
46 |
public MAudioCodecAdaptationObserver
|
sl@0
|
47 |
{
|
sl@0
|
48 |
friend class CAudioContext;
|
sl@0
|
49 |
friend class CLogicalAudioStream;
|
sl@0
|
50 |
public:
|
sl@0
|
51 |
/**
|
sl@0
|
52 |
Create a new instance.
|
sl@0
|
53 |
*/
|
sl@0
|
54 |
static CLogicalAudioCodec* NewL(TAny* aParam);
|
sl@0
|
55 |
|
sl@0
|
56 |
/**
|
sl@0
|
57 |
Destructor.
|
sl@0
|
58 |
Deletes all objects and releases all resource owned by this instance.
|
sl@0
|
59 |
*/
|
sl@0
|
60 |
virtual ~CLogicalAudioCodec();
|
sl@0
|
61 |
|
sl@0
|
62 |
// from base class MAudioCodec
|
sl@0
|
63 |
TInt SetFormat(TUid aFormat);
|
sl@0
|
64 |
TInt SetSampleRate(TInt aSampleRate);
|
sl@0
|
65 |
TInt SetMode(TUid aMode);
|
sl@0
|
66 |
TInt GetSupportedSamplesRates(RArray<TInt>& aSupportedRates);
|
sl@0
|
67 |
TInt GetSupportedModes(RArray<TUid>& aSupportedModes);
|
sl@0
|
68 |
TInt RegisterAudioCodecObserver(MAudioCodecObserver& aObserver);
|
sl@0
|
69 |
void UnregisterAudioCodecObserver(MAudioCodecObserver& aObserver);
|
sl@0
|
70 |
|
sl@0
|
71 |
// Override just this
|
sl@0
|
72 |
TBool IsTypeOf(TUid aTypeId) const;
|
sl@0
|
73 |
TAny* Interface(TUid aType);
|
sl@0
|
74 |
|
sl@0
|
75 |
// from MAudioCodecAdaptationObserver
|
sl@0
|
76 |
void AllBuffersProcessed();
|
sl@0
|
77 |
void ProcessingUnitError(TInt aError);
|
sl@0
|
78 |
void GetSupportedAModesComplete(TInt aError);
|
sl@0
|
79 |
void GetSupportedARatesComplete(TInt aError);
|
sl@0
|
80 |
|
sl@0
|
81 |
private:
|
sl@0
|
82 |
|
sl@0
|
83 |
/**
|
sl@0
|
84 |
Second phase constructor
|
sl@0
|
85 |
*/
|
sl@0
|
86 |
void ConstructL();
|
sl@0
|
87 |
|
sl@0
|
88 |
/**
|
sl@0
|
89 |
Constructor
|
sl@0
|
90 |
*/
|
sl@0
|
91 |
CLogicalAudioCodec(TAny* aParam);
|
sl@0
|
92 |
|
sl@0
|
93 |
protected: // data
|
sl@0
|
94 |
|
sl@0
|
95 |
// Format uid
|
sl@0
|
96 |
|
sl@0
|
97 |
TUid iFormat;
|
sl@0
|
98 |
|
sl@0
|
99 |
TInt iSampleRateConfig;
|
sl@0
|
100 |
TUid iModeConfig;
|
sl@0
|
101 |
RPointerArray<MAudioCodecObserver> iAudioCodecObserver;
|
sl@0
|
102 |
|
sl@0
|
103 |
MConfigurationHelper* iAdaptationStream;
|
sl@0
|
104 |
|
sl@0
|
105 |
};
|
sl@0
|
106 |
|
sl@0
|
107 |
#endif // LOGICALAUDIOCODEC_H
|