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 __CPROCVISUALIZATIONAO_H__ |
|
22 #define __CPROCVISUALIZATIONAO_H__ |
|
23 |
|
24 #include <e32base.h> |
|
25 #include "AudSong.h" |
|
26 #include "AudObservers.h" |
|
27 |
|
28 #include "AudProcessorImpl.h" |
|
29 |
|
30 class MProcProcessObserver; |
|
31 class CProcVisProcessor; |
|
32 |
|
33 class CProcVisualizationAO : public CActive |
|
34 { |
|
35 |
|
36 public: |
|
37 |
|
38 static CProcVisualizationAO* NewL(); |
|
39 |
|
40 virtual ~CProcVisualizationAO(); |
|
41 |
|
42 /** |
|
43 * Starts a clip visualization operation |
|
44 * |
|
45 * Can leave with one of the system wide error codes |
|
46 * |
|
47 * Possible panic code |
|
48 * <code>EVisualizationProcessAlreadyRunning</code> |
|
49 * |
|
50 * @param aClip song to be visualized |
|
51 * @param aSize size of the visualization array (time resolution) |
|
52 * @param aObserver observer to be notified of progress |
|
53 * |
|
54 * @return void |
|
55 * |
|
56 */ |
|
57 void StartClipVisualizationL(const CAudClipInfo* aClipInfo, TInt aSize, MAudVisualizationObserver& aObserver, TInt aPriority); |
|
58 |
|
59 /** |
|
60 * Cancels a visualization operation |
|
61 * |
|
62 * Possible panic code |
|
63 * <code>EVisualizationProcessNotRunning</code> |
|
64 * |
|
65 */ |
|
66 void CancelVisualization(); |
|
67 |
|
68 /** |
|
69 * Enumeration that represents the state of this object |
|
70 */ |
|
71 enum TVisualizationState |
|
72 { |
|
73 EProcGettingClipVisualization = 100, |
|
74 EProcVisualizationIdle |
|
75 }; |
|
76 |
|
77 protected: |
|
78 virtual void RunL(); |
|
79 virtual void DoCancel(); |
|
80 |
|
81 private: |
|
82 |
|
83 void ConstructL(); |
|
84 |
|
85 private: |
|
86 |
|
87 CProcVisualizationAO(); |
|
88 |
|
89 // visualization observer |
|
90 MAudVisualizationObserver* iObserver; |
|
91 |
|
92 // visualization processor |
|
93 CProcVisProcessor* iProcVisProcessor; |
|
94 // visualization state |
|
95 TVisualizationState iVisualizationState; |
|
96 |
|
97 // clipinfo visualized |
|
98 const CAudClipInfo* iClipInfo; |
|
99 |
|
100 // visualization size |
|
101 TInt iSize; |
|
102 |
|
103 // previous progress value sent to the observer |
|
104 TInt iPreviousProgressValue; |
|
105 }; |
|
106 |
|
107 |
|
108 #endif |
|