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: Virtualizes audio channels. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CAMMSEMCAUDIOVIRTUALIZERCONTROL_H |
|
20 #define CAMMSEMCAUDIOVIRTUALIZERCONTROL_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include "cammseffectcontrol.h" |
|
25 #include "cammseffectcontrolgroup.h" |
|
26 #include <cmmaemcaudioplayer.h> |
|
27 #include<StereoWideningControl.h> |
|
28 //Utility for getting EnvironmentalPreset |
|
29 #include "cammsemcaudiovirtualizerenvironmentalpresetutility.h" |
|
30 |
|
31 |
|
32 using multimedia :: KStereoWideningEffectControl; |
|
33 using multimedia :: MStereoWideningControl; |
|
34 |
|
35 |
|
36 // CONSTANTS |
|
37 _LIT(KAMMSEMCAudioVirtualizerControl, "AudioVirtualizerControl"); |
|
38 |
|
39 // CLASS DECLARATION |
|
40 /** |
|
41 * |
|
42 * Controls for the Audio Virtualizer effect. |
|
43 * This class delegates Audio Virtualizer effect method calls to |
|
44 * CStereoWidening. |
|
45 * |
|
46 * |
|
47 * @since 5.1 |
|
48 */ |
|
49 NONSHARABLE_CLASS(CAMMSEMCAudioVirtualizerControl): public CAMMSEffectControl |
|
50 { |
|
51 public: // Constructors and destructor |
|
52 |
|
53 /** |
|
54 * Two-phased constructor. |
|
55 * @param aPlayer Player that has this control. |
|
56 */ |
|
57 static CAMMSEMCAudioVirtualizerControl* NewLC(CMMAPlayer* aPlayer); |
|
58 |
|
59 /** |
|
60 * Destructor. |
|
61 */ |
|
62 ~CAMMSEMCAudioVirtualizerControl(); |
|
63 |
|
64 public: // Functions from base classes |
|
65 /** |
|
66 * Sets the effect according to the given preset. |
|
67 * |
|
68 * @param aPreset The new preset that will be taken into use. |
|
69 * |
|
70 * @par Leaving: |
|
71 * @li \c KErrArgument - \a aPreset is not available or it is null. |
|
72 */ |
|
73 void SetPresetL(const TDesC& aPreset); |
|
74 |
|
75 /** |
|
76 * Gets the available preset names. |
|
77 * |
|
78 * @return The names of all the available preset modes. |
|
79 */ |
|
80 const CDesCArray& PresetNamesL(); |
|
81 |
|
82 /** |
|
83 * Gets the current preset. |
|
84 * |
|
85 * @return The preset that is set at the moment. If none of the presets |
|
86 * is set, null will be returned. |
|
87 */ |
|
88 const TDesC& PresetL(); |
|
89 |
|
90 /** |
|
91 * Enables/disables the effect. |
|
92 * |
|
93 * @param aEnabled The boolean value, true=enabled, false=disabled. |
|
94 * |
|
95 * @par Leaving: |
|
96 * From Java API the leave codes are: |
|
97 * - java.lang.IllegalStateException - if the effect cannot be enabled |
|
98 * in this state of the player. |
|
99 * - javax.microedition.media.MediaException - if enabling is not |
|
100 * supported (with the scope set). |
|
101 */ |
|
102 void SetEnabledL(TBool aEnable); |
|
103 |
|
104 const TDesC& ClassName() const; |
|
105 |
|
106 /** |
|
107 * Prepares the Control. |
|
108 */ |
|
109 void PrepareControlL(); |
|
110 |
|
111 /** |
|
112 * Deallocates the Control. |
|
113 */ |
|
114 void DeallocateControl(); |
|
115 |
|
116 public: // overriden virtual functions from CAMMSEffectControl |
|
117 |
|
118 |
|
119 virtual void SetEnforcedL(TBool aEnforced); |
|
120 |
|
121 virtual TBool Enforced(); |
|
122 |
|
123 virtual void SetScopeL(TInt aScope); |
|
124 |
|
125 virtual TInt Scope(); |
|
126 |
|
127 protected: |
|
128 |
|
129 virtual void ApplySettingsL(); |
|
130 |
|
131 private: |
|
132 /** |
|
133 * C++ constructor. |
|
134 * @param aPlayer Player that has this control. |
|
135 */ |
|
136 CAMMSEMCAudioVirtualizerControl(CMMAPlayer* aPlayer); |
|
137 |
|
138 /** |
|
139 * By default Symbian 2nd phase constructor is private. |
|
140 */ |
|
141 void ConstructL(); |
|
142 |
|
143 private: // Data |
|
144 |
|
145 /** Array for querying the preset names, owned */ |
|
146 CDesCArray* iPresetNames; |
|
147 TBuf<KAMMSMaxPresetNameLength> iPresetName; |
|
148 |
|
149 /** Index of the current preset */ |
|
150 TInt iCurrentPreset; |
|
151 /* AudioVirtualizer utility to get preset and data related to that preset*/ |
|
152 CAMMSEMCAudioVirtualizerEnvironmentalPresetUtility * iAMMSEMCAudioVirtualizerEnvironmentalPresetUtility; |
|
153 |
|
154 private: |
|
155 |
|
156 CMMAPlayer *iMMAPlayer; |
|
157 /** |
|
158 * EMC AudioVirtualizer Control |
|
159 */ |
|
160 CMultimediaFactory* iFactory; |
|
161 MStreamControl* iStreamControl; |
|
162 MStereoWideningControl *iMStereoWideningControl; |
|
163 |
|
164 |
|
165 }; |
|
166 |
|
167 #endif // CAMMSEMCAUDIOVIRTUALIZERCONTROL_H |
|
168 |
|
169 |
|