|
1 /* |
|
2 * Copyright (c) 2006 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: Project file for EnhancedMediaClient Utility |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef ROOMLEVELEFFECTIMPL_H |
|
20 #define ROOMLEVELEFFECTIMPL_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <RoomLevelControl.h> |
|
24 #include "EffectControlBase.h" |
|
25 #include <RoomLevelProxy.h> |
|
26 #include <MAudioEffectObserver.h> |
|
27 |
|
28 namespace multimedia |
|
29 { |
|
30 class MControlObserver; |
|
31 class CReverbEffect; |
|
32 |
|
33 class CRoomLevelEffect : public CBase, |
|
34 public MRoomLevelControl, |
|
35 public MAudioEffectObserver, |
|
36 public CEffectControlBase |
|
37 { |
|
38 public: |
|
39 CRoomLevelEffect(); |
|
40 ~CRoomLevelEffect(); |
|
41 TInt PostConstructor(); |
|
42 |
|
43 // From MControl begins |
|
44 TInt AddObserver( MControlObserver& aObserver ); |
|
45 TInt RemoveObserver( MControlObserver& aObserver ); |
|
46 TUid Type(); |
|
47 TControlType ControlType(); |
|
48 // From MControl ends |
|
49 |
|
50 // From MEffectControl begins |
|
51 TInt Apply(); |
|
52 // From MEffectControl ends |
|
53 |
|
54 // From MRoomLevelEffect begins |
|
55 /** |
|
56 * Gets the RoomLevel current level in mB |
|
57 * @since 5.0 |
|
58 * @return RoomLevel current level |
|
59 */ |
|
60 TInt Level(TInt& aLevel); |
|
61 |
|
62 /** |
|
63 * Gets the RoomLevel current level maximum and minimum in mB |
|
64 * @since 5.0 |
|
65 * @param aMin Minimum current level |
|
66 * @param aMax Maximum current level |
|
67 * @return - |
|
68 */ |
|
69 TInt LevelRange( TInt& aMin, TInt& aMax ); |
|
70 |
|
71 /** |
|
72 * Sets the RoomLevel level, it will leave if aRoomLevel is not within range of Min and Max |
|
73 * @since 5.0 |
|
74 * @param aRoomLevelLevel The RoomLevel level in mB |
|
75 */ |
|
76 TInt SetRoomLevel( TInt aRoomLevel ); |
|
77 |
|
78 // From MRoomLevelEffect ends |
|
79 |
|
80 // From MAudioEffectControl |
|
81 /** |
|
82 * Disable the effect |
|
83 * @since 5.0 |
|
84 */ |
|
85 TInt Disable(); |
|
86 |
|
87 /** |
|
88 * Enable the effect |
|
89 * @since 5.0 |
|
90 */ |
|
91 TInt Enable(); |
|
92 |
|
93 /** |
|
94 * Enforce the effect. |
|
95 * @since 5.0 |
|
96 * @param aEnforced Indicate the effect is to be enforced or not. ETrue = Enforced. |
|
97 */ |
|
98 TInt Enforce( TBool &aEnforced ); |
|
99 |
|
100 /** |
|
101 * Check if this effect object currently has update rights. |
|
102 * A client can lose update rights in some hardware platforms where there are a limited |
|
103 * number of instances of an effect that can exist at the same time. When an effect instance |
|
104 * has lost update rights the user can still change settings, but any calls to Apply the |
|
105 * settings will be deferred until update rights are regained. |
|
106 * @since 5.0 |
|
107 * @return ETrue if this object currently has rights to update the settings of this effect, |
|
108 * EFalse otherwise. |
|
109 */ |
|
110 TInt HaveUpdateRights(TBool &aHaveUpdateRights); |
|
111 |
|
112 /** |
|
113 * Check if the effect is enabled |
|
114 * @since 5.0 |
|
115 * @return ETrue if the effect is enabled, EFalse if the effect is disabled. |
|
116 */ |
|
117 TInt IsEnabled(TBool &aEnabled); |
|
118 |
|
119 /** |
|
120 * Check if the effect is enforced. |
|
121 * @since 5.0 |
|
122 * @return ETrue if the effect is enforced, EFalse if the effect isn ot enforced. |
|
123 */ |
|
124 TInt IsEnforced(TBool &aEnforced); |
|
125 |
|
126 /* |
|
127 * Get the unique identifier of the audio effect |
|
128 * @since 5.0 |
|
129 * @return Unique identifier of the audio effect object. |
|
130 */ |
|
131 TInt Uid(TUid &aUid); |
|
132 // From MAudioEffectControl Ends |
|
133 |
|
134 // MAudioEffectObserver begins |
|
135 void EffectChanged( const CAudioEffect* aObservedEffect, TUint8 aEvent ); |
|
136 // MAudioEffectObserver ends |
|
137 |
|
138 // From CEffectControlBase begins |
|
139 void Event( TEffectControlEvent aEvent ); |
|
140 // From CEffectControlBase ends |
|
141 |
|
142 // From MRoomLevelEffect begins |
|
143 TInt AttachReverb( MReverbControl& aReverb ); |
|
144 TInt DetachReverb( MReverbControl& aReverb ); |
|
145 // From MRoomLevelEffect ends |
|
146 |
|
147 private: |
|
148 TInt DoApply(); |
|
149 TInt CreateEffectProxy(); |
|
150 TInt DeleteEffectProxy(); |
|
151 TInt SavePreviousSettings(); |
|
152 |
|
153 private: |
|
154 CRoomLevelProxy* iRoomLevelProxy; |
|
155 CRoomLevelProxy* iPrevRoomLevelProxy; |
|
156 TMMFMessageDestinationPckg iMsgHndlrHandlePckg; |
|
157 MCustomCommand* iCustomCommand; |
|
158 RPointerArray<MControlObserver> iObservers; |
|
159 CReverbEffect* iCReverbEffect; |
|
160 }; |
|
161 } // namespace multimedia |
|
162 |
|
163 #endif // ROOMLEVELEFFECTIMPL_H |
|
164 |
|
165 // End of file |