|
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 #ifndef __CPROCAMRINFILEHANDLER_H__ |
|
21 #define __CPROCAMRINFILEHANDLER_H__ |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <f32file.h> |
|
25 #include "AudCommon.h" |
|
26 #include "ProcConstants.h" |
|
27 #include "ProcInFileHandler.h" |
|
28 #include "AudClip.h" |
|
29 |
|
30 #include "ProcDecoder.h" |
|
31 |
|
32 |
|
33 class CProcAMRInFileHandler: public CProcInFileHandler |
|
34 { |
|
35 |
|
36 public: |
|
37 |
|
38 static CProcAMRInFileHandler* NewL(const TDesC& aFileName, |
|
39 RFile* aFileHandle, |
|
40 CAudClip* aClip, TInt aReadBufferSize, |
|
41 TInt aTargetSampleRate = 0, |
|
42 TChannelMode aChannelMode = EAudSingleChannel); |
|
43 |
|
44 static CProcAMRInFileHandler* NewLC(const TDesC& aFileName, |
|
45 RFile* aFileHandle, |
|
46 CAudClip* aClip, TInt aReadBufferSize, |
|
47 TInt aTargetSampleRate = 0, |
|
48 TChannelMode aChannelMode = EAudSingleChannel); |
|
49 |
|
50 |
|
51 // From base class |
|
52 |
|
53 void GetPropertiesL(TAudFileProperties* aProperties); |
|
54 |
|
55 /** |
|
56 * Seeks a certain audio frame for reading |
|
57 * |
|
58 * Possible leave codes: |
|
59 * |
|
60 * @param aFrameIndex frame index |
|
61 * @param aTime time from the beginning of file in milliseconds |
|
62 * |
|
63 * @return ETrue if successful |
|
64 * EFalse if beyond the file |
|
65 */ |
|
66 TBool SeekAudioFrame(TInt32 aTime); |
|
67 |
|
68 |
|
69 /** |
|
70 * Seeks a cut in audio frame for reading |
|
71 * |
|
72 * Possible leave codes: |
|
73 * |
|
74 * |
|
75 * @return ETrue if successful |
|
76 * |
|
77 */ |
|
78 TBool SeekCutInFrame(); |
|
79 |
|
80 virtual TBool SetNormalizingGainL(const CProcFrameHandler* aFrameHandler); |
|
81 |
|
82 virtual ~CProcAMRInFileHandler(); |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 private: |
|
88 |
|
89 void ConstructL(const TDesC& aFileName, RFile* aFileHandle, CAudClip* aClip, |
|
90 TInt aReadBufferSize, TInt aTargetSampleRate = 0, |
|
91 TChannelMode aChannelMode = EAudSingleChannel); |
|
92 |
|
93 virtual TBool GetEncAudioFrameL(HBufC8*& aFrame, TInt& aSize, TInt32& aTime); |
|
94 |
|
95 |
|
96 |
|
97 // durations in milliseconds |
|
98 virtual TBool GetFrameInfo(TInt& aSongDuration, |
|
99 TInt& aFrameAmount, |
|
100 TInt& aAverageFrameDuration, |
|
101 TInt& aAverageFrameSize); |
|
102 |
|
103 TInt iLastDRCL; |
|
104 |
|
105 |
|
106 protected: |
|
107 |
|
108 CProcAMRInFileHandler(); |
|
109 |
|
110 }; |
|
111 |
|
112 #endif |