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