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 CAMMSAUDIOVIRTUALIZERCONTROL_H |
|
20 #define CAMMSAUDIOVIRTUALIZERCONTROL_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <StereoWideningBase.h> |
|
25 #include <StereoWideningUtility.h> |
|
26 #include <CustomCommandUtility.h> |
|
27 #include "cammseffectcontrol.h" |
|
28 |
|
29 // CONSTANTS |
|
30 _LIT(KAMMSAudioVirtualizerControl, "AudioVirtualizerControl"); |
|
31 |
|
32 // CLASS DECLARATION |
|
33 /** |
|
34 * |
|
35 * Controls for the Audio Virtualizer effect. |
|
36 * This class delegates Audio Virtualizer effect method calls to |
|
37 * CStereoWidening. |
|
38 * |
|
39 * |
|
40 * @since 3.0 |
|
41 */ |
|
42 NONSHARABLE_CLASS(CAMMSAudioVirtualizerControl): public CAMMSEffectControl |
|
43 { |
|
44 public: // Constructors and destructor |
|
45 |
|
46 /** |
|
47 * Two-phased constructor. |
|
48 * @param aPlayer Player that has this control. |
|
49 */ |
|
50 static CAMMSAudioVirtualizerControl* NewLC(CMMAPlayer* aPlayer); |
|
51 |
|
52 /** |
|
53 * Destructor. |
|
54 */ |
|
55 ~CAMMSAudioVirtualizerControl(); |
|
56 |
|
57 public: // New functions |
|
58 |
|
59 public: // Functions from base classes |
|
60 /** |
|
61 * Sets the effect according to the given preset. |
|
62 * |
|
63 * @param aPreset The new preset that will be taken into use. |
|
64 * |
|
65 * @par Leaving: |
|
66 * @li \c KErrArgument - \a aPreset is not available or it is null. |
|
67 */ |
|
68 void SetPresetL(const TDesC& aPreset); |
|
69 |
|
70 /** |
|
71 * Gets the available preset names. |
|
72 * |
|
73 * @return The names of all the available preset modes. |
|
74 */ |
|
75 const CDesCArray& PresetNamesL(); |
|
76 |
|
77 /** |
|
78 * Gets the current preset. |
|
79 * |
|
80 * @return The preset that is set at the moment. If none of the presets |
|
81 * is set, null will be returned. |
|
82 */ |
|
83 const TDesC& PresetL(); |
|
84 |
|
85 /** |
|
86 * Enables/disables the effect. |
|
87 * |
|
88 * @param aEnabled The boolean value, true=enabled, false=disabled. |
|
89 * |
|
90 * @par Leaving: |
|
91 * From Java API the leave codes are: |
|
92 * - java.lang.IllegalStateException - if the effect cannot be enabled |
|
93 * in this state of the player. |
|
94 * - javax.microedition.media.MediaException - if enabling is not |
|
95 * supported (with the scope set). |
|
96 */ |
|
97 void SetEnabledL(TBool aEnable); |
|
98 |
|
99 const TDesC& ClassName() const; |
|
100 |
|
101 /** |
|
102 * Prepares the Control. |
|
103 */ |
|
104 void PrepareControlL(); |
|
105 |
|
106 /** |
|
107 * Deallocates the Control. |
|
108 */ |
|
109 void DeallocateControl(); |
|
110 |
|
111 private: |
|
112 /** |
|
113 * C++ constructor. |
|
114 * @param aPlayer Player that has this control. |
|
115 */ |
|
116 CAMMSAudioVirtualizerControl(CMMAPlayer* aPlayer); |
|
117 |
|
118 /** |
|
119 * By default Symbian 2nd phase constructor is private. |
|
120 */ |
|
121 void ConstructL(); |
|
122 |
|
123 private: // Data |
|
124 |
|
125 /** Native Stereo Widening Utility */ |
|
126 CStereoWideningUtility* iStereoWideningUtility; |
|
127 |
|
128 /** Array for querying the preset names, owned */ |
|
129 CDesCArray* iPresetNames; |
|
130 |
|
131 /** Index of the current preset */ |
|
132 TInt iCurrentPreset; |
|
133 |
|
134 }; |
|
135 |
|
136 #endif // CAMMSAUDIOVIRTUALIZERCONTROL_H |
|
137 |
|
138 |
|