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 Loudness effect class.
25 #include <AudioEffectBase.h>
26 #include <LoudnessData.h>
27 #include <MCustomInterface.h>
29 const TUid KUidLoudnessEffect = {0x10207AA8};
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 Loudness effect class for managing audio Loudness settings.
50 * @lib LoudnessUtility.lib
54 class CLoudness : public CAudioEffect
57 public: //New Functions
60 * Factory function for creating the audio Loudness object.
62 * @param aUtility A reference to a convert utility
63 * @return pointer to CLoudness object
65 IMPORT_C static CLoudness* NewL( CMdaAudioConvertUtility& aUtility );
68 * Factory function for creating the Loudness object.
70 * @param aUtility A reference to an audio input stream utility
71 * @param aEnable Indicate whether the effect will be automatically enabled after creation.
72 * @return pointer to CLoudness object
74 IMPORT_C static CLoudness* NewL( CMdaAudioInputStream& aUtility , TBool aEnable = EFalse );
77 * Factory function for creating the Loudness object.
79 * @param aUtility A reference to an audio output stream utility
80 * @param aEnable Indicate whether the effect will be automatically enabled after creation.
81 * @return pointer to CLoudness object
83 IMPORT_C static CLoudness* NewL( CMdaAudioOutputStream& aUtility , TBool aEnable = EFalse );
86 * Factory function for creating the Loudness object.
88 * @param aUtility A reference to an audio player utility
89 * @param aEnable Indicate whether the effect will be automatically enabled after creation.
90 * @return pointer to CLoudness object
92 IMPORT_C static CLoudness* NewL( CMdaAudioPlayerUtility& aUtility , TBool aEnable = EFalse );
95 * Factory function for creating the Loudness object.
97 * @param aUtility A reference to an audio record utility
98 * @param aRecordStream ETrue if the effect is to be applied to the recording,
99 * EFalse if the effect is to be applied only to the playback
100 * @param aEnable Indicate whether the effect will be automatically enabled after creation.
101 * @return pointer to CLoudness object
103 IMPORT_C static CLoudness* NewL( CMdaAudioRecorderUtility& aUtility, TBool aRecordStream, TBool aEnable = EFalse );
106 * Factory function for creating the Loudness object.
108 * @param aUtility A reference to an audio tone utility
109 * @param aEnable Indicate whether the effect will be automatically enabled after creation.
110 * @return pointer to CLoudness object
112 IMPORT_C static CLoudness* NewL( CMdaAudioToneUtility& aUtility , TBool aEnable = EFalse );
115 * Factory function for creating the Loudness object.
117 * @param aDevSound A reference to a DevSound instance
118 * @param aEnable Indicate whether the effect will be automatically enabled after creation.
119 * @return pointer to CLoudness object
121 IMPORT_C static CLoudness* NewL( CMMFDevSound& aDevSound, TBool aEnable = EFalse );
124 * Factory function for creating the Loudness object.
126 * @param aUtility A reference to a custom command utility
127 * @param aEnable Indicate whether the effect will be automatically enabled after creation.
128 * @return pointer to CLoudness object
130 IMPORT_C static CLoudness* NewL( CCustomCommandUtility* aUtility , TBool aEnable = EFalse );
133 * Factory function for creating the Loudness object.
135 * @param aCustomInterface A reference to a custom interface
136 * @param aEnable Indicate whether the effect will be automatically enabled after creation.
137 * @return pointer to CLoudness object
139 IMPORT_C static CLoudness* NewL( MCustomInterface& aCustomInterface, TBool aEnable = EFalse );
142 * Factory function for creating the Loudness object.
144 * @param aUtility A reference to a CMidiClientUtility
145 * @param aEnable Indicate whether the effect will be automatically enabled after creation.
146 * @return pointer to CLoudness object
148 IMPORT_C static CLoudness* NewL( CMidiClientUtility& aUtility , TBool aEnable = EFalse );
151 * Factory function for creating the Loudness object.
153 * @param CDrmPlayerUtility A reference to a CDrmPlayerUtility object
154 * @return pointer to CLoudness object
156 IMPORT_C static CLoudness* NewL( CDrmPlayerUtility& aUtility , TBool aEnable = EFalse);
159 * Factory function for creating the Loudness object.
161 * @param CVideoPlayerUtility A reference to a CVideoPlayerUtility object
162 * @return pointer to CLoudness object
164 IMPORT_C static CLoudness* NewL( CVideoPlayerUtility& aUtility , TBool aEnable = EFalse);
170 IMPORT_C virtual ~CLoudness();
172 public: // functions from base class
176 * Get the unique identifier of the audio effect
178 * @return Unique identifier
180 IMPORT_C TUid Uid() const;
182 protected: // functions from base class
186 * Create a package of the effect data
188 * @return A descriptor containing the effect data.
190 IMPORT_C const TDesC8& DoEffectData();
194 * Internal function to unpack effect data
196 * @param aEffectDataBuffer Descriptor containing packed effect data
199 IMPORT_C void SetEffectData( const TDesC8& aEffectDataBuffer );
204 * Private C++ constructor for this class.
206 * @param aEffectObserver reference to event observer object
209 IMPORT_C CLoudness();
214 // Loudness data structure
215 TEfLoudnessData iLoudnessData;
216 // Data package sent to server
217 TEfLoudnessDataPckg iDataPckgTo;
218 // Data package received from server
219 TEfLoudnessDataPckg iDataPckgFrom;
221 protected: // Friend classes
223 friend class CLoudnessMessageHandler;
227 #endif // of CLOUDNESS_H