1 /* |
|
2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "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 * |
|
14 * Description: Declares classes related to Equalizer Settings |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef EQUALIZEREDITINGDIALOG_H |
|
22 #define EQUALIZEREDITINGDIALOG_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <AknDialog.h> |
|
26 #include "EqualizerPrivateConstants.h" |
|
27 |
|
28 #include "EqualizerPresetsDialog.h" |
|
29 // FORWARD DECLARATIONS |
|
30 class CAudioEqualizerUtility; |
|
31 class CEqualizerFreqBandContainer; |
|
32 |
|
33 // CLASS DECLARATIONS |
|
34 NONSHARABLE_CLASS(CEqualizerEditingDialog) : public CAknDialog |
|
35 { |
|
36 public: // Constructors and destructor |
|
37 |
|
38 /** |
|
39 * This function is called to create an object of |
|
40 * type CEqualizerPresetsDialog - Two phase Construction |
|
41 * @since 3.0 |
|
42 * @param aAudEqUtility a pointer to CAudioEqualizerUtility |
|
43 * @param aPresetIndex the index into the preset array retrieved |
|
44 * with the method CAudioEqualizerUtility::Presets() |
|
45 * @param aRect a reference to the view rectangle |
|
46 * returned by CAudioEqualizerUtility::Presets() |
|
47 * @param aIsPresetActive whether the preset is active or not? |
|
48 */ |
|
49 static CEqualizerEditingDialog* NewL( |
|
50 CAudioEqualizerUtility* aAudEqUtility,const TInt aPresetIndex, |
|
51 TRect& aRect, const TBool aIsPresetActive, |
|
52 MEqualizerPresetActivationObserver& aObs, |
|
53 TInt aPresetKey); |
|
54 /** |
|
55 * Destructor |
|
56 * @since 3.0 |
|
57 */ |
|
58 virtual ~CEqualizerEditingDialog(); |
|
59 |
|
60 public: // New functions |
|
61 /** |
|
62 * This function is used to execute the Dialog. |
|
63 * @since 3.0 |
|
64 * @returns return value of CAknDialog::ExecuteLD() |
|
65 */ |
|
66 TInt ExecuteLD(); |
|
67 /** |
|
68 * This function is used to read the positions of the mover for the |
|
69 * frequency bands from the engine. |
|
70 * @since 3.0 |
|
71 * @param aReset Whether the preset is being reset |
|
72 */ |
|
73 void SetMoverPositionsL(TBool aReset); |
|
74 |
|
75 /** |
|
76 * This function is used to set new values for CAudioEqualizerUtility* |
|
77 * @since 3.0 |
|
78 * @param aAudEqUtility New pointer to CAudioEqualizerUtility |
|
79 */ |
|
80 void SetAudioEqualizerL(CAudioEqualizerUtility* aAudEqUtility); |
|
81 |
|
82 /** |
|
83 * This function is used to return current mover position for each frequence band |
|
84 * @since 3.0 |
|
85 * @param aBandIndex Frequence band index for which mover position is required |
|
86 * @returns current mover position |
|
87 */ |
|
88 TInt GetMoverPosition(TInt aBandIndex); |
|
89 |
|
90 private: |
|
91 /** |
|
92 * First Phase Constructor |
|
93 * @since 3.0 |
|
94 * @param aAudEqUtility a pointer to CAudioEqualizerUtility |
|
95 * @param aPresetIndex the index into the preset array retrieved |
|
96 * with the method CAudioEqualizerUtility::Presets() |
|
97 * @param aRect a reference to the view rectangle |
|
98 * returned by CAudioEqualizerUtility::Presets() |
|
99 * @param aIsPresetActive whether the preset is active or not? |
|
100 */ |
|
101 CEqualizerEditingDialog(CAudioEqualizerUtility* aAudEqUtility, |
|
102 const TInt aPresetIndex, TRect& aRect, |
|
103 const TBool aIsPresetActive, |
|
104 MEqualizerPresetActivationObserver& aObs, |
|
105 TInt aPresetKey); |
|
106 |
|
107 /** |
|
108 * Second Phase Constructor |
|
109 * @since 3.0 |
|
110 */ |
|
111 void ConstructL(); |
|
112 |
|
113 private: // Functions from base classes |
|
114 /** |
|
115 * From CAknDialog Called when a key event happens. |
|
116 */ |
|
117 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, |
|
118 TEventCode aType ); |
|
119 /** |
|
120 * From CAknDialog Called just before the menu pane is displayed |
|
121 */ |
|
122 void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane); |
|
123 /** |
|
124 * From CAknDialog Called just before the menu pane is displayed |
|
125 */ |
|
126 void ProcessCommandL(TInt aCommandId); |
|
127 /** |
|
128 * From CAknDialog Called when OK key is pressed |
|
129 */ |
|
130 TBool OkToExitL(TInt aButtonId); |
|
131 /** |
|
132 * From CAknDialog Called when a custom control is to be created |
|
133 */ |
|
134 SEikControlInfo CreateCustomControlL ( TInt aControlType ); |
|
135 |
|
136 /** |
|
137 * From CAknDialog |
|
138 * This function will respond to any change in the controls size. |
|
139 */ |
|
140 void SizeChanged(); |
|
141 /** |
|
142 * Get help context for the control. |
|
143 * @param aContext The context that is filled in. |
|
144 * @return None. |
|
145 */ |
|
146 void GetHelpContext( TCoeHelpContext& aContext ) const; |
|
147 |
|
148 /** |
|
149 * This function is called to retrieve the rectangle |
|
150 * of the freq band control, scale and slider from the layout |
|
151 */ |
|
152 void GetLayoutRect(); |
|
153 |
|
154 private: |
|
155 // Used to store a pointer to CAudioEqualizerUtility |
|
156 CAudioEqualizerUtility* iAudEqUtility; |
|
157 // Used to store a pointer to CEqualizerFreqBandContainer |
|
158 CEqualizerFreqBandContainer* iFreqBandContainer; |
|
159 // Used to store the preset name |
|
160 TPresetName iPresetName; |
|
161 // The index of the preset in the array returned by |
|
162 // CAudioEqualizerUtility::Presets() |
|
163 const TInt iPresetIndex; |
|
164 // The rectangle in which the Dialog is displayed |
|
165 TRect& iRect; |
|
166 // Whether the preset displayed is an active preset? |
|
167 const TBool iIsActivePreset; |
|
168 // Used to store the offset of the resource file |
|
169 TInt iResourceFileOffset; |
|
170 // Stores the positions of the movers in the various bands. |
|
171 CArrayFix<TInt>* iMover; |
|
172 // Number of Frequency bands |
|
173 TUint iNumberOfFreqBands; |
|
174 // Ignore Key events between track changes |
|
175 TBool iIgnoreKeyEvents; |
|
176 // Array to store the rects of the freq band |
|
177 RArray<TRect> iFreqBandRect; |
|
178 // Array to store the rects of the freq band scale |
|
179 RArray<TRect> iScaleRect; |
|
180 // Array to store the rects of the background |
|
181 RArray<TRect> iBackgroundRect; |
|
182 // Array to store the rects of the slider |
|
183 RArray<TRect> iSliderRect; |
|
184 // Used to determine if context sensitive menu is ON or not when pressing MSK |
|
185 TBool iContextSensitiveMenu; |
|
186 |
|
187 // Observer for changing presets |
|
188 MEqualizerPresetActivationObserver& iObserver; |
|
189 TInt iPresetKey; |
|
190 }; |
|
191 |
|
192 #endif //EQUALIZEREDITINGDIALOG_H |
|
193 |
|
194 // End of File |
|