|
1 /* |
|
2 * Copyright (c) 2004 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: This is the definition of the audio effects base class. |
|
15 * |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CAUDIOEFFECT_H |
|
21 #define CAUDIOEFFECT_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 |
|
26 // FORWARD DECLARATION |
|
27 class MAudioEffectObserver; |
|
28 |
|
29 // CLASS DECLARATION |
|
30 |
|
31 /** |
|
32 * This is the base class for audio effects. |
|
33 * |
|
34 * @lib AudioEffectBase.lib |
|
35 * @since 3.0 |
|
36 */ |
|
37 |
|
38 class CAudioEffect : public CBase |
|
39 { |
|
40 |
|
41 public: // Constructors and destructor |
|
42 |
|
43 /** |
|
44 * Destructor |
|
45 */ |
|
46 IMPORT_C virtual ~CAudioEffect(); |
|
47 |
|
48 public: // New functions |
|
49 |
|
50 /** |
|
51 * Apply effect settings |
|
52 * @since 3.0 |
|
53 */ |
|
54 virtual void ApplyL() = 0; |
|
55 |
|
56 /** |
|
57 * Disable the effect |
|
58 * @since 3.0 |
|
59 */ |
|
60 IMPORT_C virtual void DisableL(); |
|
61 |
|
62 /** |
|
63 * Enable the effect |
|
64 * @since 3.0 |
|
65 */ |
|
66 IMPORT_C virtual void EnableL(); |
|
67 |
|
68 /** |
|
69 * Enforce the effect. |
|
70 * @since 3.0 |
|
71 * @param aEnforced Indicate the effect is to be enforced or not. ETrue = Enforced. |
|
72 */ |
|
73 IMPORT_C virtual void EnforceL( TBool aEnforced ); |
|
74 |
|
75 /** |
|
76 * Check if this effect object currently has update rights. |
|
77 * A client can lose update rights in some hardware platforms where there are a limited |
|
78 * number of instances of an effect that can exist at the same time. When an effect instance |
|
79 * has lost update rights the user can still change settings, but any calls to Apply the |
|
80 * settings will be deferred until update rights are regained. |
|
81 * @since 3.0 |
|
82 * @return ETrue if this object currently has rights to update the settings of this effect, |
|
83 * EFalse otherwise. |
|
84 */ |
|
85 IMPORT_C virtual TBool HaveUpdateRights() const; |
|
86 |
|
87 /** |
|
88 * Check if the effect is enabled |
|
89 * @since 3.0 |
|
90 * @return ETrue if the effect is enabled, EFalse if the effect is disabled. |
|
91 */ |
|
92 IMPORT_C virtual TBool IsEnabled() const; |
|
93 |
|
94 /** |
|
95 * Check if the effect is enforced. |
|
96 * @since 3.0 |
|
97 * @return ETrue if the effect is enforced, EFalse if the effect isn ot enforced. |
|
98 */ |
|
99 IMPORT_C virtual TBool IsEnforced() const; |
|
100 |
|
101 /** |
|
102 * Adds the specified observer to the list of observers to be notified when |
|
103 * the effect object changes state. |
|
104 * @since 3.0 |
|
105 * @param aObserver Object to be added to notifier list. |
|
106 */ |
|
107 IMPORT_C void RegisterObserverL( MAudioEffectObserver& aObserver ); |
|
108 |
|
109 /* |
|
110 * Get the unique identifier of the audio effect |
|
111 * @since 3.0 |
|
112 * @return Unique identifier of the audio effect object. |
|
113 */ |
|
114 virtual TUid Uid() const = 0 ; |
|
115 |
|
116 /** |
|
117 * Removes the specified observer from the list of observers. |
|
118 * @since 3.0 |
|
119 * @param aObserver object to be removed. |
|
120 */ |
|
121 IMPORT_C void UnRegisterObserver( MAudioEffectObserver& aObserver ); |
|
122 |
|
123 protected: |
|
124 |
|
125 /** |
|
126 * Private C++ constructor for this class. |
|
127 * @since 3.0 |
|
128 * @param aEffectObserver reference to event observer object |
|
129 * @return - |
|
130 */ |
|
131 IMPORT_C CAudioEffect(); |
|
132 |
|
133 /** |
|
134 * Internal function to package data into a descriptor. |
|
135 * @since 3.0 |
|
136 * @return A descriptor containing the effect data. |
|
137 */ |
|
138 virtual const TDesC8& DoEffectData() = 0 ; |
|
139 |
|
140 /** |
|
141 * Internal function to unpack effect data |
|
142 * @since 3.0 |
|
143 * @param aEffectDataBuffer Descriptor containing packed effect data |
|
144 */ |
|
145 virtual void SetEffectData( const TDesC8& aEffectDataBuffer ) = 0; |
|
146 |
|
147 protected: // Data |
|
148 |
|
149 // Flag to indicate whether the effect is enabled or not |
|
150 TBool iEnabled; |
|
151 // Flag to indicate wheter the effect is enforced |
|
152 TBool iEnforced; |
|
153 // Flag to indicate wheter the effect current has update rights |
|
154 TBool iHaveUpdateRights; |
|
155 // Pointer to Observers |
|
156 RPointerArray<MAudioEffectObserver> iObservers; |
|
157 }; |
|
158 |
|
159 #endif // of CAUDIOEFFECT_H |
|
160 |
|
161 // End of File |