os/mm/devsoundextensions/effects/SrcDoppler/SourceDopplerEffect/Src/SourceDopplerEffect.cpp
Update contrib.
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: Implementation of the Source Doppler Effect class
27 #include <SourceDopplerBase.h>
28 #include <CustomInterfaceUtility.h>
29 #include "SourceDopplerProxy.h"
30 #include <DrmAudioSamplePlayer.h>
31 #include <mdaaudioinputstream.h>
32 #include <mdaaudiooutputstream.h>
33 #include <mdaaudiotoneplayer.h>
34 #include <mmf/server/sounddevice.h>
35 #include <videoplayer.h>
38 #define DEBPRN0 RDebug::Printf( "%s", __PRETTY_FUNCTION__);
39 #define DEBPRN1(str) RDebug::Printf( "%s %s", __PRETTY_FUNCTION__, str );
45 // ============================ MEMBER FUNCTIONS ===============================
47 // -----------------------------------------------------------------------------
48 // CSourceDoppler::CSourceDoppler
49 // C++ default constructor can NOT contain any code, that
51 // -----------------------------------------------------------------------------
53 EXPORT_C CSourceDoppler::CSourceDoppler()
58 EXPORT_C CSourceDoppler::~CSourceDoppler()
63 // -----------------------------------------------------------------------------
64 // CSourceDoppler::NewL
65 // Static function for creating an instance of the Doppler object.
66 // -----------------------------------------------------------------------------
68 EXPORT_C CSourceDoppler* CSourceDoppler::NewL(
69 CMdaAudioInputStream& aUtility )
73 CSourceDopplerProxy* dopplerProxy = (CSourceDopplerProxy*)aUtility.CustomInterface(KUidSourceDopplerEffect);
75 if (dopplerProxy == NULL)
77 DEBPRN1("No Adaptation Support - leaving");
78 User::Leave(KErrNotSupported);
84 // -----------------------------------------------------------------------------
85 // CSourceDoppler::NewL
86 // Static function for creating an instance of the Doppler object.
87 // -----------------------------------------------------------------------------
89 EXPORT_C CSourceDoppler* CSourceDoppler::NewL(
90 CMdaAudioOutputStream& aUtility )
94 CSourceDopplerProxy* dopplerProxy = (CSourceDopplerProxy*)aUtility.CustomInterface(KUidSourceDopplerEffect);
96 if (dopplerProxy == NULL)
98 DEBPRN1("No Adaptation Support - leaving");
99 User::Leave(KErrNotSupported);
105 // -----------------------------------------------------------------------------
106 // CSourceDoppler::NewL
107 // Static function for creating an instance of the Doppler object.
108 // -----------------------------------------------------------------------------
110 EXPORT_C CSourceDoppler* CSourceDoppler::NewL(
111 CMdaAudioConvertUtility& aUtility )
115 CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility);
116 CleanupStack::PushL(customInterface);
118 CSourceDopplerProxy* dopplerProxy = (CSourceDopplerProxy*)customInterface->CustomInterface(KUidSourceDopplerEffect);
122 DEBPRN1("No Adaptation Support - leaving");
123 User::Leave(KErrNotSupported);
126 CleanupStack::Pop(customInterface);
131 // -----------------------------------------------------------------------------
132 // CSourceDoppler::NewL
133 // Static function for creating an instance of the Doppler object.
134 // -----------------------------------------------------------------------------
136 EXPORT_C CSourceDoppler* CSourceDoppler::NewL(
137 CMdaAudioPlayerUtility& aUtility )
141 CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility);
142 CleanupStack::PushL(customInterface);
144 CSourceDopplerProxy* dopplerProxy = (CSourceDopplerProxy*)customInterface->CustomInterface(KUidSourceDopplerEffect);
148 DEBPRN1("No Adaptation Support - leaving");
149 User::Leave(KErrNotSupported);
152 CleanupStack::Pop(customInterface);
157 // -----------------------------------------------------------------------------
158 // CSourceDoppler::NewL
159 // Static function for creating an instance of the Doppler object.
160 // -----------------------------------------------------------------------------
162 EXPORT_C CSourceDoppler* CSourceDoppler::NewL(
163 CMdaAudioRecorderUtility& aUtility,
164 TBool aRecordStream )
168 CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility, aRecordStream);
169 CleanupStack::PushL(customInterface);
171 CSourceDopplerProxy* dopplerProxy = (CSourceDopplerProxy*)customInterface->CustomInterface(KUidSourceDopplerEffect);
175 DEBPRN1("No Adaptation Support - leaving");
176 User::Leave(KErrNotSupported);
179 CleanupStack::Pop(customInterface);
184 // -----------------------------------------------------------------------------
185 // CSourceDoppler::NewL
186 // Static function for creating an instance of the Doppler object.
187 // -----------------------------------------------------------------------------
189 EXPORT_C CSourceDoppler* CSourceDoppler::NewL(
190 CMdaAudioToneUtility& aUtility )
194 CSourceDopplerProxy* dopplerProxy = (CSourceDopplerProxy*)aUtility.CustomInterface(KUidSourceDopplerEffect);
196 if (dopplerProxy == NULL)
198 DEBPRN1("No Adaptation Support - leaving");
199 User::Leave(KErrNotSupported);
205 // -----------------------------------------------------------------------------
206 // CSourceDoppler::NewL
207 // Static function for creating an instance of the Doppler object.
208 // -----------------------------------------------------------------------------
210 EXPORT_C CSourceDoppler* CSourceDoppler::NewL(
211 CMMFDevSound& aDevSound)
215 CSourceDopplerProxy* dopplerProxy = (CSourceDopplerProxy*)aDevSound.CustomInterface(KUidSourceDopplerEffect);
217 if (dopplerProxy == NULL)
219 DEBPRN1("No Adaptation Support - leaving");
220 User::Leave(KErrNotSupported);
226 // -----------------------------------------------------------------------------
227 // CSourceDoppler::NewL
228 // Static function for creating an instance of the Doppler object.
229 // -----------------------------------------------------------------------------
231 EXPORT_C CSourceDoppler* CSourceDoppler::NewL(
232 CCustomCommandUtility* aUtility)
236 CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility);
237 CleanupStack::PushL(customInterface);
239 CSourceDopplerProxy* dopplerProxy = (CSourceDopplerProxy*)customInterface->CustomInterface(KUidSourceDopplerEffect);
243 DEBPRN1("No Adaptation Support - leaving");
244 User::Leave(KErrNotSupported);
247 CleanupStack::Pop(customInterface);
252 // -----------------------------------------------------------------------------
253 // CSourceDoppler::NewL
254 // Static function for creating an instance of the Doppler object.
255 // -----------------------------------------------------------------------------
257 EXPORT_C CSourceDoppler* CSourceDoppler::NewL(
258 MCustomInterface& aCustomInterface )
262 CSourceDopplerProxy* dopplerProxy = (CSourceDopplerProxy*)aCustomInterface.CustomInterface(KUidSourceDopplerEffect);
266 DEBPRN1("No Adaptation Support - leaving");
267 User::Leave(KErrNotSupported);
273 // -----------------------------------------------------------------------------
274 // CSourceDoppler::NewL
275 // Static function for creating an instance of the Doppler object.
276 // -----------------------------------------------------------------------------
278 EXPORT_C CSourceDoppler* CSourceDoppler::NewL(
279 CMidiClientUtility& aUtility )
283 CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility);
284 CleanupStack::PushL(customInterface);
286 CSourceDopplerProxy* dopplerProxy = (CSourceDopplerProxy*)customInterface->CustomInterface(KUidSourceDopplerEffect);
290 DEBPRN1("No Adaptation Support - leaving");
291 User::Leave(KErrNotSupported);
294 CleanupStack::Pop(customInterface);
299 // -----------------------------------------------------------------------------
300 // CSourceDoppler::NewL
301 // Static function for creating an instance of the Doppler object.
302 // -----------------------------------------------------------------------------
304 EXPORT_C CSourceDoppler* CSourceDoppler::NewL(
305 CDrmPlayerUtility& aUtility )
309 CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility);
310 CleanupStack::PushL(customInterface);
312 CSourceDopplerProxy* dopplerProxy = (CSourceDopplerProxy*)customInterface->CustomInterface(KUidSourceDopplerEffect);
316 DEBPRN1("No Adaptation Support - leaving");
317 User::Leave(KErrNotSupported);
320 CleanupStack::Pop(customInterface);
325 // -----------------------------------------------------------------------------
326 // CSourceDoppler::NewL
327 // Static function for creating an instance of the Doppler object.
328 // -----------------------------------------------------------------------------
330 EXPORT_C CSourceDoppler* CSourceDoppler::NewL(
331 CVideoPlayerUtility& aUtility )
335 CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility);
336 CleanupStack::PushL(customInterface);
338 CSourceDopplerProxy* dopplerProxy = (CSourceDopplerProxy*)customInterface->CustomInterface(KUidSourceDopplerEffect);
342 DEBPRN1("No Adaptation Support - leaving");
343 User::Leave(KErrNotSupported);
346 CleanupStack::Pop(customInterface);
351 // -----------------------------------------------------------------------------
352 // CSourceDoppler::Uid
353 // -----------------------------------------------------------------------------
355 EXPORT_C TUid CSourceDoppler::Uid() const
357 return KUidSourceDopplerEffect;
361 // ========================== OTHER EXPORTED FUNCTIONS =========================