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 __CPROCVISPROCESSOR_H__ |
|
21 #define __CPROCVISPROCESSOR_H__ |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <e32math.h> |
|
25 #include "AudClipInfo.h" |
|
26 #include "AudCommon.h" |
|
27 #include "AudSong.h" |
|
28 #include "ProcInFileHandler.h" |
|
29 |
|
30 #include "ProcFrameHandler.h" |
|
31 |
|
32 #include "ProcTools.h" |
|
33 |
|
34 class CProcVisProcessor : public CBase |
|
35 { |
|
36 |
|
37 public: |
|
38 |
|
39 /* |
|
40 * Symbian constructors |
|
41 */ |
|
42 |
|
43 static CProcVisProcessor* NewL(); |
|
44 static CProcVisProcessor* NewLC(); |
|
45 |
|
46 ~CProcVisProcessor(); |
|
47 |
|
48 /** |
|
49 * Performs all initializations needed for a clip visualization |
|
50 * |
|
51 * Can leave with one of the system wide error codes |
|
52 * |
|
53 * Possible panic code |
|
54 * <code>EVisualizationProcessAlreadyRunning</code> |
|
55 * |
|
56 * @param aClip clip to be visualized |
|
57 * @param aSize size of the visualization array (time resolution) |
|
58 * |
|
59 * @return void |
|
60 * |
|
61 */ |
|
62 void VisualizeClipL(const CAudClipInfo* aClipInfo, TInt aSize); |
|
63 |
|
64 /** |
|
65 * Visualizes one piece of clip |
|
66 * |
|
67 * Possible panic code |
|
68 * <code>EVisualizationProcessNotRunning</code> |
|
69 * |
|
70 * @param aProgress output parameter to indicate progress in percents |
|
71 * @return ETrue if visualization completed, EFalse otherwise |
|
72 * |
|
73 */ |
|
74 TBool VisualizeClipPieceL(TInt &aProgress); |
|
75 |
|
76 /** |
|
77 * Once visualization process has been completed, |
|
78 * visualization array can be retrieved with this function |
|
79 * NOTE: This function allocates memory and the caller |
|
80 * is responsible for releasing it |
|
81 * |
|
82 * @param aVisualization visualization array |
|
83 * @param aSize size of the visualization array |
|
84 * |
|
85 */ |
|
86 void GetFinalVisualizationL(TInt8*& aVisualization, TInt& aSize); |
|
87 |
|
88 |
|
89 private: |
|
90 |
|
91 // constructL |
|
92 void ConstructL(); |
|
93 |
|
94 // C++ constructor |
|
95 CProcVisProcessor(); |
|
96 |
|
97 private: |
|
98 |
|
99 // visualization size |
|
100 TInt iVisualizationSize; |
|
101 // array for visualization |
|
102 TInt8* iVisualization; |
|
103 // infilehandler for clip visualized |
|
104 CProcInFileHandler *iInFile; |
|
105 |
|
106 // song |
|
107 const CAudSong* iSong; |
|
108 |
|
109 // clip that is visualized |
|
110 const CAudClipInfo* iClipInfo; |
|
111 |
|
112 // frame handler for getting gain |
|
113 CProcFrameHandler* iFrameHandler; |
|
114 |
|
115 // how many percents have been written to visualization array |
|
116 TInt iVisualizationWritten; |
|
117 |
|
118 // how many percents have been processed |
|
119 TInt iVisualizationProcessed; |
|
120 |
|
121 // the number of frames altogether |
|
122 TInt iFrameAmount; |
|
123 |
|
124 // how many frames have been processed |
|
125 TInt iFramesProcessed; |
|
126 |
|
127 // current frame being processed |
|
128 TInt iVisualizationPos; |
|
129 |
|
130 }; |
|
131 |
|
132 |
|
133 #endif |
|