sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description: Implementation of the listenerlocation effect class
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
|
sl@0
|
20 |
|
sl@0
|
21 |
// INCLUDE FILES
|
sl@0
|
22 |
|
sl@0
|
23 |
#ifdef _DEBUG
|
sl@0
|
24 |
#include <e32svr.h>
|
sl@0
|
25 |
#endif
|
sl@0
|
26 |
|
sl@0
|
27 |
#include <SourceOrientationBase.h>
|
sl@0
|
28 |
#include <CustomInterfaceUtility.h>
|
sl@0
|
29 |
#include "SourceOrientationProxy.h"
|
sl@0
|
30 |
#include <DrmAudioSamplePlayer.h>
|
sl@0
|
31 |
#include <mdaaudioinputstream.h>
|
sl@0
|
32 |
#include <mdaaudiooutputstream.h>
|
sl@0
|
33 |
#include <mdaaudiotoneplayer.h>
|
sl@0
|
34 |
#include <mmf/server/sounddevice.h>
|
sl@0
|
35 |
#include <videoplayer.h>
|
sl@0
|
36 |
|
sl@0
|
37 |
#ifdef _DEBUG
|
sl@0
|
38 |
#define DEBPRN0 RDebug::Printf( "%s", __PRETTY_FUNCTION__);
|
sl@0
|
39 |
#define DEBPRN1(str) RDebug::Printf( "%s %s", __PRETTY_FUNCTION__, str );
|
sl@0
|
40 |
#else
|
sl@0
|
41 |
#define DEBPRN0
|
sl@0
|
42 |
#define DEBPRN1(str)
|
sl@0
|
43 |
#endif
|
sl@0
|
44 |
|
sl@0
|
45 |
// ============================ MEMBER FUNCTIONS ===============================
|
sl@0
|
46 |
|
sl@0
|
47 |
// -----------------------------------------------------------------------------
|
sl@0
|
48 |
// CSourceOrientation::CSourceOrientation
|
sl@0
|
49 |
// C++ default constructor can NOT contain any code, that
|
sl@0
|
50 |
// might leave.
|
sl@0
|
51 |
// -----------------------------------------------------------------------------
|
sl@0
|
52 |
//
|
sl@0
|
53 |
EXPORT_C CSourceOrientation::CSourceOrientation()
|
sl@0
|
54 |
{
|
sl@0
|
55 |
}
|
sl@0
|
56 |
|
sl@0
|
57 |
// Destructor
|
sl@0
|
58 |
EXPORT_C CSourceOrientation::~CSourceOrientation()
|
sl@0
|
59 |
{
|
sl@0
|
60 |
}
|
sl@0
|
61 |
|
sl@0
|
62 |
|
sl@0
|
63 |
// -----------------------------------------------------------------------------
|
sl@0
|
64 |
// CSourceOrientation::NewL
|
sl@0
|
65 |
// Static function for creating an instance of the SourceOrientation object.
|
sl@0
|
66 |
// -----------------------------------------------------------------------------
|
sl@0
|
67 |
//
|
sl@0
|
68 |
EXPORT_C CSourceOrientation* CSourceOrientation::NewL(
|
sl@0
|
69 |
CMdaAudioInputStream& aUtility )
|
sl@0
|
70 |
{
|
sl@0
|
71 |
|
sl@0
|
72 |
DEBPRN0;
|
sl@0
|
73 |
CSourceOrientationProxy* sourceOrientationProxy = (CSourceOrientationProxy*)aUtility.CustomInterface(KUidSourceOrientationEffect);
|
sl@0
|
74 |
|
sl@0
|
75 |
if (sourceOrientationProxy == NULL)
|
sl@0
|
76 |
{
|
sl@0
|
77 |
DEBPRN1("No Adaptation Support - leaving");
|
sl@0
|
78 |
User::Leave(KErrNotSupported);
|
sl@0
|
79 |
}
|
sl@0
|
80 |
|
sl@0
|
81 |
return sourceOrientationProxy;
|
sl@0
|
82 |
}
|
sl@0
|
83 |
|
sl@0
|
84 |
// -----------------------------------------------------------------------------
|
sl@0
|
85 |
// CSourceOrientation::NewL
|
sl@0
|
86 |
// Static function for creating an instance of the SourceOrientation object.
|
sl@0
|
87 |
// -----------------------------------------------------------------------------
|
sl@0
|
88 |
//
|
sl@0
|
89 |
EXPORT_C CSourceOrientation* CSourceOrientation::NewL(
|
sl@0
|
90 |
CMdaAudioOutputStream& aUtility )
|
sl@0
|
91 |
{
|
sl@0
|
92 |
|
sl@0
|
93 |
DEBPRN0;
|
sl@0
|
94 |
CSourceOrientationProxy* sourceOrientationProxy = (CSourceOrientationProxy*)aUtility.CustomInterface(KUidSourceOrientationEffect);
|
sl@0
|
95 |
|
sl@0
|
96 |
if (sourceOrientationProxy == NULL)
|
sl@0
|
97 |
{
|
sl@0
|
98 |
DEBPRN1("No Adaptation Support - leaving");
|
sl@0
|
99 |
User::Leave(KErrNotSupported);
|
sl@0
|
100 |
}
|
sl@0
|
101 |
|
sl@0
|
102 |
return sourceOrientationProxy;
|
sl@0
|
103 |
}
|
sl@0
|
104 |
|
sl@0
|
105 |
// -----------------------------------------------------------------------------
|
sl@0
|
106 |
// CSourceOrientation::NewL
|
sl@0
|
107 |
// Static function for creating an instance of the SourceOrientation object.
|
sl@0
|
108 |
// -----------------------------------------------------------------------------
|
sl@0
|
109 |
//
|
sl@0
|
110 |
EXPORT_C CSourceOrientation* CSourceOrientation::NewL(
|
sl@0
|
111 |
CMdaAudioConvertUtility& aUtility )
|
sl@0
|
112 |
{
|
sl@0
|
113 |
|
sl@0
|
114 |
DEBPRN0;
|
sl@0
|
115 |
CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility);
|
sl@0
|
116 |
CleanupStack::PushL(customInterface);
|
sl@0
|
117 |
|
sl@0
|
118 |
CSourceOrientationProxy* sourceOrientationProxy = (CSourceOrientationProxy*)customInterface->CustomInterface(KUidSourceOrientationEffect);
|
sl@0
|
119 |
|
sl@0
|
120 |
if ( !sourceOrientationProxy )
|
sl@0
|
121 |
{
|
sl@0
|
122 |
DEBPRN1("No Adaptation Support - leaving");
|
sl@0
|
123 |
User::Leave(KErrNotSupported);
|
sl@0
|
124 |
}
|
sl@0
|
125 |
|
sl@0
|
126 |
CleanupStack::Pop(customInterface);
|
sl@0
|
127 |
|
sl@0
|
128 |
return sourceOrientationProxy;
|
sl@0
|
129 |
}
|
sl@0
|
130 |
|
sl@0
|
131 |
// -----------------------------------------------------------------------------
|
sl@0
|
132 |
// CSourceOrientation::NewL
|
sl@0
|
133 |
// Static function for creating an instance of the SourceOrientation object.
|
sl@0
|
134 |
// -----------------------------------------------------------------------------
|
sl@0
|
135 |
//
|
sl@0
|
136 |
EXPORT_C CSourceOrientation* CSourceOrientation::NewL(
|
sl@0
|
137 |
CMdaAudioPlayerUtility& aUtility )
|
sl@0
|
138 |
{
|
sl@0
|
139 |
|
sl@0
|
140 |
DEBPRN0;
|
sl@0
|
141 |
CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility);
|
sl@0
|
142 |
CleanupStack::PushL(customInterface);
|
sl@0
|
143 |
|
sl@0
|
144 |
CSourceOrientationProxy* sourceOrientationProxy = (CSourceOrientationProxy*)customInterface->CustomInterface(KUidSourceOrientationEffect);
|
sl@0
|
145 |
|
sl@0
|
146 |
if ( !sourceOrientationProxy )
|
sl@0
|
147 |
{
|
sl@0
|
148 |
DEBPRN1("No Adaptation Support - leaving");
|
sl@0
|
149 |
User::Leave(KErrNotSupported);
|
sl@0
|
150 |
}
|
sl@0
|
151 |
|
sl@0
|
152 |
CleanupStack::Pop(customInterface);
|
sl@0
|
153 |
|
sl@0
|
154 |
return sourceOrientationProxy;
|
sl@0
|
155 |
}
|
sl@0
|
156 |
|
sl@0
|
157 |
// -----------------------------------------------------------------------------
|
sl@0
|
158 |
// CSourceOrientation::NewL
|
sl@0
|
159 |
// Static function for creating an instance of the SourceOrientation object.
|
sl@0
|
160 |
// -----------------------------------------------------------------------------
|
sl@0
|
161 |
//
|
sl@0
|
162 |
EXPORT_C CSourceOrientation* CSourceOrientation::NewL(
|
sl@0
|
163 |
CMdaAudioRecorderUtility& aUtility,
|
sl@0
|
164 |
TBool aRecordStream )
|
sl@0
|
165 |
{
|
sl@0
|
166 |
|
sl@0
|
167 |
DEBPRN0;
|
sl@0
|
168 |
CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility, aRecordStream);
|
sl@0
|
169 |
CleanupStack::PushL(customInterface);
|
sl@0
|
170 |
|
sl@0
|
171 |
CSourceOrientationProxy* sourceOrientationProxy = (CSourceOrientationProxy*)customInterface->CustomInterface(KUidSourceOrientationEffect);
|
sl@0
|
172 |
|
sl@0
|
173 |
if ( !sourceOrientationProxy )
|
sl@0
|
174 |
{
|
sl@0
|
175 |
DEBPRN1("No Adaptation Support - leaving");
|
sl@0
|
176 |
User::Leave(KErrNotSupported);
|
sl@0
|
177 |
}
|
sl@0
|
178 |
|
sl@0
|
179 |
CleanupStack::Pop(customInterface);
|
sl@0
|
180 |
|
sl@0
|
181 |
return sourceOrientationProxy;
|
sl@0
|
182 |
}
|
sl@0
|
183 |
|
sl@0
|
184 |
// -----------------------------------------------------------------------------
|
sl@0
|
185 |
// CSourceOrientation::NewL
|
sl@0
|
186 |
// Static function for creating an instance of the SourceOrientation object.
|
sl@0
|
187 |
// -----------------------------------------------------------------------------
|
sl@0
|
188 |
//
|
sl@0
|
189 |
EXPORT_C CSourceOrientation* CSourceOrientation::NewL(
|
sl@0
|
190 |
CMdaAudioToneUtility& aUtility )
|
sl@0
|
191 |
{
|
sl@0
|
192 |
|
sl@0
|
193 |
DEBPRN0;
|
sl@0
|
194 |
CSourceOrientationProxy* sourceOrientationProxy = (CSourceOrientationProxy*)aUtility.CustomInterface(KUidSourceOrientationEffect);
|
sl@0
|
195 |
|
sl@0
|
196 |
if (sourceOrientationProxy == NULL)
|
sl@0
|
197 |
{
|
sl@0
|
198 |
DEBPRN1("No Adaptation Support - leaving");
|
sl@0
|
199 |
User::Leave(KErrNotSupported);
|
sl@0
|
200 |
}
|
sl@0
|
201 |
|
sl@0
|
202 |
return sourceOrientationProxy;
|
sl@0
|
203 |
}
|
sl@0
|
204 |
|
sl@0
|
205 |
// -----------------------------------------------------------------------------
|
sl@0
|
206 |
// CSourceOrientation::NewL
|
sl@0
|
207 |
// Static function for creating an instance of the SourceOrientation object.
|
sl@0
|
208 |
// -----------------------------------------------------------------------------
|
sl@0
|
209 |
//
|
sl@0
|
210 |
EXPORT_C CSourceOrientation* CSourceOrientation::NewL(
|
sl@0
|
211 |
CMMFDevSound& aDevSound )
|
sl@0
|
212 |
{
|
sl@0
|
213 |
|
sl@0
|
214 |
DEBPRN0;
|
sl@0
|
215 |
CSourceOrientationProxy* sourceOrientationProxy = (CSourceOrientationProxy*)aDevSound.CustomInterface(KUidSourceOrientationEffect);
|
sl@0
|
216 |
|
sl@0
|
217 |
if (sourceOrientationProxy == NULL)
|
sl@0
|
218 |
{
|
sl@0
|
219 |
DEBPRN1("No Adaptation Support - leaving");
|
sl@0
|
220 |
User::Leave(KErrNotSupported);
|
sl@0
|
221 |
}
|
sl@0
|
222 |
|
sl@0
|
223 |
return sourceOrientationProxy;
|
sl@0
|
224 |
}
|
sl@0
|
225 |
|
sl@0
|
226 |
// -----------------------------------------------------------------------------
|
sl@0
|
227 |
// CSourceOrientation::NewL
|
sl@0
|
228 |
// Static function for creating an instance of the SourceOrientation object.
|
sl@0
|
229 |
// -----------------------------------------------------------------------------
|
sl@0
|
230 |
//
|
sl@0
|
231 |
EXPORT_C CSourceOrientation* CSourceOrientation::NewL(
|
sl@0
|
232 |
CCustomCommandUtility* aUtility )
|
sl@0
|
233 |
{
|
sl@0
|
234 |
|
sl@0
|
235 |
DEBPRN0;
|
sl@0
|
236 |
CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility);
|
sl@0
|
237 |
CleanupStack::PushL(customInterface);
|
sl@0
|
238 |
|
sl@0
|
239 |
CSourceOrientationProxy* sourceOrientationProxy = (CSourceOrientationProxy*)customInterface->CustomInterface(KUidSourceOrientationEffect);
|
sl@0
|
240 |
|
sl@0
|
241 |
if ( !sourceOrientationProxy )
|
sl@0
|
242 |
{
|
sl@0
|
243 |
DEBPRN1("No Adaptation Support - leaving");
|
sl@0
|
244 |
User::Leave(KErrNotSupported);
|
sl@0
|
245 |
}
|
sl@0
|
246 |
|
sl@0
|
247 |
CleanupStack::Pop(customInterface);
|
sl@0
|
248 |
|
sl@0
|
249 |
return sourceOrientationProxy;
|
sl@0
|
250 |
}
|
sl@0
|
251 |
|
sl@0
|
252 |
// -----------------------------------------------------------------------------
|
sl@0
|
253 |
// CSourceOrientation::NewL
|
sl@0
|
254 |
// Static function for creating an instance of the SourceOrientation object.
|
sl@0
|
255 |
// -----------------------------------------------------------------------------
|
sl@0
|
256 |
//
|
sl@0
|
257 |
EXPORT_C CSourceOrientation* CSourceOrientation::NewL(
|
sl@0
|
258 |
MCustomInterface& aCustomInterface )
|
sl@0
|
259 |
{
|
sl@0
|
260 |
|
sl@0
|
261 |
DEBPRN0;
|
sl@0
|
262 |
CSourceOrientationProxy* sourceOrientationProxy = (CSourceOrientationProxy*)aCustomInterface.CustomInterface(KUidSourceOrientationEffect);
|
sl@0
|
263 |
|
sl@0
|
264 |
if ( !sourceOrientationProxy )
|
sl@0
|
265 |
{
|
sl@0
|
266 |
DEBPRN1("No Adaptation Support - leaving");
|
sl@0
|
267 |
User::Leave(KErrNotSupported);
|
sl@0
|
268 |
}
|
sl@0
|
269 |
|
sl@0
|
270 |
return sourceOrientationProxy;
|
sl@0
|
271 |
}
|
sl@0
|
272 |
|
sl@0
|
273 |
// -----------------------------------------------------------------------------
|
sl@0
|
274 |
// CSourceOrientation::NewL
|
sl@0
|
275 |
// Static function for creating an instance of the SourceOrientation object.
|
sl@0
|
276 |
// -----------------------------------------------------------------------------
|
sl@0
|
277 |
//
|
sl@0
|
278 |
EXPORT_C CSourceOrientation* CSourceOrientation::NewL(
|
sl@0
|
279 |
CMidiClientUtility& aUtility )
|
sl@0
|
280 |
{
|
sl@0
|
281 |
|
sl@0
|
282 |
DEBPRN0;
|
sl@0
|
283 |
CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility);
|
sl@0
|
284 |
CleanupStack::PushL(customInterface);
|
sl@0
|
285 |
|
sl@0
|
286 |
CSourceOrientationProxy* sourceOrientationProxy = (CSourceOrientationProxy*)customInterface->CustomInterface(KUidSourceOrientationEffect);
|
sl@0
|
287 |
|
sl@0
|
288 |
if ( !sourceOrientationProxy )
|
sl@0
|
289 |
{
|
sl@0
|
290 |
DEBPRN1("No Adaptation Support - leaving");
|
sl@0
|
291 |
User::Leave(KErrNotSupported);
|
sl@0
|
292 |
}
|
sl@0
|
293 |
|
sl@0
|
294 |
CleanupStack::Pop(customInterface);
|
sl@0
|
295 |
|
sl@0
|
296 |
return sourceOrientationProxy;
|
sl@0
|
297 |
}
|
sl@0
|
298 |
|
sl@0
|
299 |
// -----------------------------------------------------------------------------
|
sl@0
|
300 |
// CSourceOrientation::NewL
|
sl@0
|
301 |
// Static function for creating an instance of the SourceOrientation object.
|
sl@0
|
302 |
// -----------------------------------------------------------------------------
|
sl@0
|
303 |
//
|
sl@0
|
304 |
EXPORT_C CSourceOrientation* CSourceOrientation::NewL(
|
sl@0
|
305 |
CDrmPlayerUtility& aUtility )
|
sl@0
|
306 |
{
|
sl@0
|
307 |
|
sl@0
|
308 |
DEBPRN0;
|
sl@0
|
309 |
CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility);
|
sl@0
|
310 |
CleanupStack::PushL(customInterface);
|
sl@0
|
311 |
|
sl@0
|
312 |
CSourceOrientationProxy* sourceOrientationProxy = (CSourceOrientationProxy*)customInterface->CustomInterface(KUidSourceOrientationEffect);
|
sl@0
|
313 |
|
sl@0
|
314 |
if ( !sourceOrientationProxy )
|
sl@0
|
315 |
{
|
sl@0
|
316 |
DEBPRN1("No Adaptation Support - leaving");
|
sl@0
|
317 |
User::Leave(KErrNotSupported);
|
sl@0
|
318 |
}
|
sl@0
|
319 |
|
sl@0
|
320 |
CleanupStack::Pop(customInterface);
|
sl@0
|
321 |
|
sl@0
|
322 |
return sourceOrientationProxy;
|
sl@0
|
323 |
}
|
sl@0
|
324 |
|
sl@0
|
325 |
// -----------------------------------------------------------------------------
|
sl@0
|
326 |
// CSourceOrientation::NewL
|
sl@0
|
327 |
// Static function for creating an instance of the SourceOrientation object.
|
sl@0
|
328 |
// -----------------------------------------------------------------------------
|
sl@0
|
329 |
//
|
sl@0
|
330 |
EXPORT_C CSourceOrientation* CSourceOrientation::NewL(
|
sl@0
|
331 |
CVideoPlayerUtility& aUtility )
|
sl@0
|
332 |
{
|
sl@0
|
333 |
|
sl@0
|
334 |
DEBPRN0;
|
sl@0
|
335 |
CCustomInterfaceUtility* customInterface = CCustomInterfaceUtility::NewL(aUtility);
|
sl@0
|
336 |
CleanupStack::PushL(customInterface);
|
sl@0
|
337 |
|
sl@0
|
338 |
CSourceOrientationProxy* sourceOrientationProxy = (CSourceOrientationProxy*)customInterface->CustomInterface(KUidSourceOrientationEffect);
|
sl@0
|
339 |
|
sl@0
|
340 |
if ( !sourceOrientationProxy )
|
sl@0
|
341 |
{
|
sl@0
|
342 |
DEBPRN1("No Adaptation Support - leaving");
|
sl@0
|
343 |
User::Leave(KErrNotSupported);
|
sl@0
|
344 |
}
|
sl@0
|
345 |
|
sl@0
|
346 |
CleanupStack::Pop(customInterface);
|
sl@0
|
347 |
|
sl@0
|
348 |
return sourceOrientationProxy;
|
sl@0
|
349 |
}
|
sl@0
|
350 |
|
sl@0
|
351 |
// -----------------------------------------------------------------------------
|
sl@0
|
352 |
// CSourceOrientation::Uid
|
sl@0
|
353 |
// -----------------------------------------------------------------------------
|
sl@0
|
354 |
//
|
sl@0
|
355 |
EXPORT_C TUid CSourceOrientation::Uid() const
|
sl@0
|
356 |
{
|
sl@0
|
357 |
return KUidSourceOrientationEffect;
|
sl@0
|
358 |
}
|
sl@0
|
359 |
|
sl@0
|
360 |
|
sl@0
|
361 |
// ========================== OTHER EXPORTED FUNCTIONS =========================
|
sl@0
|
362 |
|
sl@0
|
363 |
// End of File
|
sl@0
|
364 |
|