2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: This is the definition of the Bass Boost effect class.
19 #ifndef BASSBOOSTBASE_H
20 #define BASSBOOSTBASE_H
25 #include <AudioEffectBase.h>
26 #include <BassBoostData.h>
27 #include <MCustomInterface.h>
29 const TUid KUidBassBoostEffect = {0x10203827};
31 // FORWARD DELCARATION
32 class CMdaAudioConvertUtility;
33 class CMdaAudioPlayerUtility;
34 class CMdaAudioRecorderUtility;
35 class CMdaAudioInputStream;
36 class CMdaAudioOutputStream;
37 class CMdaAudioToneUtility;
38 class CCustomCommandUtility;
39 class CCustomInterfaceUtility;
41 class CMidiClientUtility;
42 class CDrmPlayerUtility;
43 class CVideoPlayerUtility;
48 * This is the bass boost effect class for managing audio bass boost settings.
50 * @lib BassBoostUtility.lib
54 class CBassBoost : public CAudioEffect
57 public: //New Functions
60 * Factory function for creating the bass boost object.
62 * @param aDevSound A reference to a DevSound instance
63 * @param aEnable Indicate whether the effect will be automatically enabled after creation.
64 * @return pointer to CBassBoost object
66 IMPORT_C static CBassBoost* NewL( CMMFDevSound& aDevSound, TBool aEnable = EFalse );
69 * Factory function for creating the bass boost object.
71 * @param aUtility A reference to an audio convert utility
72 * @param aEnable Indicate whether the effect will be automatically enabled after creation.
73 * @return pointer to CBassBoost object
75 IMPORT_C static CBassBoost* NewL( CMdaAudioConvertUtility& aUtility, TBool aEnable = EFalse );
78 * Factory function for creating the bass boost object.
80 * @param aUtility A reference to an audio input stream utility
81 * @param aEnable Indicate whether the effect will be automatically enabled after creation.
82 * @return pointer to CBassBoost object
84 IMPORT_C static CBassBoost* NewL( CMdaAudioInputStream& aUtility, TBool aEnable = EFalse );
87 * Factory function for creating the bass boost object.
89 * @param aUtility A reference to an audio output stream utility
90 * @param aEnable Indicate whether the effect will be automatically enabled after creation.
91 * @return pointer to CBassBoost object
93 IMPORT_C static CBassBoost* NewL( CMdaAudioOutputStream& aUtility, TBool aEnable = EFalse );
96 * Factory function for creating the bass boost object.
98 * @param aUtility A reference to an audio player utility
99 * @param aEnable Indicate whether the effect will be automatically enabled after creation.
100 * @return pointer to CBassBoost object
102 IMPORT_C static CBassBoost* NewL( CMdaAudioPlayerUtility& aUtility, TBool aEnable = EFalse );
105 * Factory function for creating the bass boost object.
107 * @param aUtility A reference to an audio record utility
108 * @param aRecordStream ETrue if the effect is to be applied to the recording,
109 * EFalse if the effect is to be applied only to the playback
110 * @param aEnable Indicate whether the effect will be automatically enabled after creation.
111 * @return pointer to CBassBoost object
113 IMPORT_C static CBassBoost* NewL( CMdaAudioRecorderUtility& aUtility, TBool aRecordStream, TBool aEnable = EFalse );
116 * Factory function for creating the bass boost object.
118 * @param aUtility A reference to an audio tone utility
119 * @param aEnable Indicate whether the effect will be automatically enabled after creation.
120 * @return pointer to CBassBoost object
122 IMPORT_C static CBassBoost* NewL( CMdaAudioToneUtility& aUtility, TBool aEnable = EFalse );
125 * Factory function for creating the bass boost object.
127 * @param aUtility A reference to a custom command utility
128 * @param aEnable Indicate whether the effect will be automatically enabled after creation.
129 * @return pointer to CBassBoost object
131 IMPORT_C static CBassBoost* NewL( CCustomCommandUtility* aUtility, TBool aEnable = EFalse );
134 * Factory function for creating the bass boost object.
136 * @param aCustomInterface A reference to a custom interface
137 * @param aEnable Indicate whether the effect will be automatically enabled after creation.
138 * @return pointer to CBassBoost object
140 IMPORT_C static CBassBoost* NewL( MCustomInterface& aCustomInterface, TBool aEnable = EFalse );
143 * Factory function for creating the bass boost object.
145 * @param aUtility A reference to a CMidiClientUtility
146 * @param aEnable Indicate whether the effect will be automatically enabled after creation.
147 * @return pointer to CBassBoost object
149 IMPORT_C static CBassBoost* NewL( CMidiClientUtility& aUtility, TBool aEnable = EFalse );
152 * Factory function for creating the bass boost object.
154 * @param CDrmPlayerUtility A reference to a CDrmPlayerUtility object
155 * @return pointer to CBassBoost object
157 IMPORT_C static CBassBoost* NewL( CDrmPlayerUtility& aUtility, TBool aEnable = EFalse );
160 * Factory function for creating the bass boost object.
162 * @param CVideoPlayerUtility A reference to a CVideoPlayerUtility object
163 * @return pointer to CBassBoost object
165 IMPORT_C static CBassBoost* NewL( CVideoPlayerUtility& aUtility, TBool aEnable = EFalse );
171 IMPORT_C virtual ~CBassBoost();
173 public: // functions from base class
177 * Get the unique identifier of the audio effect
179 * @return Unique identifier
181 IMPORT_C TUid Uid() const;
183 protected: // Functions from base classes
187 * Create a package of the effect data
189 * @return A descriptor containing the effect data.
191 IMPORT_C const TDesC8& DoEffectData();
195 * Internal function to unpack effect data
197 * @param aEffectDataBuffer Descriptor containing packed effect data
200 IMPORT_C void SetEffectData( const TDesC8& aEffectDataBuffer );
205 * Private C++ constructor for this class.
207 * @param aEffectObserver reference to event observer object
210 IMPORT_C CBassBoost();
214 // BassBoost data structure
215 TEfBassBoostData iBassBoostData;
216 // Data package sent to server
217 TEfBassBoostDataPckg iDataPckgTo;
218 // Data package received from server
219 TEfBassBoostDataPckg iDataPckgFrom;
221 protected: // Friend classes
223 friend class CBassBoostMessageHandler;
226 #endif // of BASSBOOSTBASE_H