|
1 /* |
|
2 * Copyright (c) 2010 Ixonos Plc. |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the "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 * Ixonos Plc |
|
14 * |
|
15 * Description: |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __CPROCFRAMEHANDLER_H__ |
|
22 #define __CPROCFRAMEHANDLER_H__ |
|
23 |
|
24 #include <e32base.h> |
|
25 #include "AudCommon.h" |
|
26 #include "ProcConstants.h" |
|
27 |
|
28 class CProcFrameHandler : public CBase |
|
29 { |
|
30 |
|
31 public: |
|
32 |
|
33 |
|
34 /** |
|
35 * Manipulates the gain of a certain audio frame |
|
36 * |
|
37 * @param aFrameIn a frame to be modified |
|
38 * @param aFrameOut a modified frame, the caller is responsible for releasing! |
|
39 * @param aGain gain change. One step represents 0.5 dB, so that |
|
40 * 0->no change, 10 -> +5dB and -10 -> -5dB |
|
41 * @return ETrue if successful |
|
42 * |
|
43 * |
|
44 */ |
|
45 virtual TBool ManipulateGainL(const HBufC8* aFrameIn, HBufC8*& aFrameOut, TInt8 aGain) = 0; |
|
46 |
|
47 /** |
|
48 * Retrieves the gains of a certain audio frame |
|
49 * |
|
50 * @param aFrame an audio frame |
|
51 * @param aGains retrieved gains |
|
52 * @param aMaxGain the biggest possible gain value |
|
53 * @return ETrue if successful |
|
54 * |
|
55 * |
|
56 */ |
|
57 virtual TBool GetGainL(const HBufC8* aFrame, RArray<TInt>& aGains, TInt& aMaxGain) const = 0; |
|
58 |
|
59 /** |
|
60 * Calculates how many decibels this frame can be amplified |
|
61 * |
|
62 * @param aFrame an audio frame |
|
63 * @param aMargin margin in debicels/2 -> 4 equals 2 decibels |
|
64 */ |
|
65 virtual TBool GetNormalizingMargin(const HBufC8* aFrame, TInt8& aMargin) const = 0; |
|
66 |
|
67 /** |
|
68 * Tells whether mixing is available or not |
|
69 * |
|
70 * @return ETrue mixing is available |
|
71 * @return EFalse mixing is not available |
|
72 */ |
|
73 virtual TBool IsMixingAvailable() const; |
|
74 |
|
75 /** |
|
76 * Mixes two frames with each other |
|
77 * |
|
78 * @param aFrame1 frame 1 to be mixed |
|
79 * @param aFrame2 frame 2 to be mixed |
|
80 * @param aMixedFrame resulting mixed frame |
|
81 * |
|
82 * @return ETrue if mixing was successful. The caller is responsible for releasing memory |
|
83 * EFalse if mixing was not successful. aMixedFrame = 0 and the caller |
|
84 * doesn't need to release memory |
|
85 */ |
|
86 virtual TBool MixL(const HBufC8* aFrame1, const HBufC8* aFrame2, HBufC8*& aMixedFrame); |
|
87 |
|
88 |
|
89 virtual ~CProcFrameHandler(); |
|
90 |
|
91 private: |
|
92 |
|
93 protected: |
|
94 |
|
95 |
|
96 }; |
|
97 |
|
98 #endif |