|
1 /* |
|
2 * Copyright (c) 2002 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: mmftsplay test component |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "SimpleSoundPlayer.h" |
|
19 #include <AudioPreference.h> |
|
20 |
|
21 const TInt CSimpleSoundPlayer::KPlayerActionPlay = 1; |
|
22 const TInt CSimpleSoundPlayer::KPlayerActionPause = 2; |
|
23 const TInt CSimpleSoundPlayer::KPlayerActionStopPlayFile = 3; |
|
24 const TInt CSimpleSoundPlayer::KPlayerActionReportPosition = 4; |
|
25 const TInt CSimpleSoundPlayer::KPlayerActionReportDuration = 5; |
|
26 |
|
27 const TInt CSimpleSoundPlayer::KPlayerActionStopPlayDes = 6; |
|
28 |
|
29 const TInt CSimpleSoundPlayer::KPlayerActionReportVolume = 7; |
|
30 |
|
31 const TInt CSimpleSoundPlayer::KPlayerActionStopPlayUrl = 8; |
|
32 |
|
33 const TInt CSimpleSoundPlayer::KPlayerActionStopPlayFileHandler = 9; |
|
34 |
|
35 const TInt CSimpleSoundPlayer::KPlayerActionReportDuration_Para = 10; |
|
36 const TInt CSimpleSoundPlayer::KPlayerActionPauseResume = 11; |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 CSimpleSoundPlayer::CSimpleSoundPlayer(CTestModuleIf &aConsole, CStifLogger &aLogger, TBool aImmediate) |
|
42 : iConsole(aConsole) , iImmediate(aImmediate) , iLogger(aLogger) , iSoundOpen(EFalse), |
|
43 iFinalError(KErrNone) |
|
44 { |
|
45 iSupervisor =0 ; |
|
46 iEventTarget=0; |
|
47 iParameters =0; |
|
48 iPlayerId =0 ; |
|
49 playVolume = false; |
|
50 metaInfo = false; |
|
51 playWindow = false; |
|
52 clearWindow = false; |
|
53 setBalance = false; |
|
54 iDontPlayAudioClip = false; // Binh |
|
55 iIsLoopPlayEnabled = EFalse; |
|
56 } |
|
57 |
|
58 void CSimpleSoundPlayer::ConstructUrlL(const TDesC &aUrl, TInt aIapId, const TDesC8 &aMime) |
|
59 { |
|
60 iMdaPlayer=CMdaAudioPlayerUtility::NewL(*this); |
|
61 //KUseDefaultIap |
|
62 iMdaPlayer->OpenUrlL(aUrl, aIapId, aMime ); |
|
63 iSoundOpen=ETrue; |
|
64 |
|
65 _LIT(KPlayerCreated, "SoundPlayerCreated"); |
|
66 iConsole.Printf(100, KPlayerCreated, KPlayerCreated); |
|
67 } |
|
68 CSimpleSoundPlayer* CSimpleSoundPlayer::NewUrlL(const TDesC &aUrl, TInt aIapId, const TDesC8 &aMime, CTestModuleIf &aConsole, CStifLogger &aLogger, TBool aImmediate) |
|
69 { |
|
70 CSimpleSoundPlayer* self = NewUrlLC(aUrl, aIapId, aMime, aConsole, aLogger, aImmediate); |
|
71 CleanupStack::Pop(self); |
|
72 return self; |
|
73 } |
|
74 CSimpleSoundPlayer* CSimpleSoundPlayer::NewUrlLC(const TDesC &aUrl, TInt aIapId, const TDesC8 &aMime, CTestModuleIf &aConsole, CStifLogger &aLogger, TBool aImmediate) |
|
75 { |
|
76 CSimpleSoundPlayer* self = new (ELeave) CSimpleSoundPlayer(aConsole, aLogger, aImmediate); |
|
77 CleanupStack::PushL(self); |
|
78 self->ConstructUrlL(aUrl, aIapId, aMime); |
|
79 return self; |
|
80 } |
|
81 |
|
82 |
|
83 void CSimpleSoundPlayer::ConstructL(const TDesC8 &aDescriptor) |
|
84 { |
|
85 // Create a file audio player utility instance |
|
86 |
|
87 |
|
88 iMdaPlayer=CMdaAudioPlayerUtility::NewL(*this); //Por Pasos |
|
89 iMdaPlayer->OpenDesL(aDescriptor); |
|
90 iSoundOpen=ETrue; |
|
91 |
|
92 _LIT(KPlayerCreated, "SoundPlayerCreated"); |
|
93 iConsole.Printf(100, KPlayerCreated, KPlayerCreated); |
|
94 } |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 void CSimpleSoundPlayer::ConstructL(TBool aUseSharedHeap) |
|
103 { |
|
104 |
|
105 iMdaPlayer=CMdaAudioPlayerUtility::NewL(*this, EMdaPriorityNormal, |
|
106 EMdaPriorityPreferenceTimeAndQuality); |
|
107 |
|
108 |
|
109 _LIT(KRootDir,"\\"); |
|
110 _LIT(KTestMP3File,"10s_smooth.mp3"); |
|
111 TBuf8<60> buf2; |
|
112 RFs iFs2; |
|
113 User::LeaveIfError(iFs2.Connect()); |
|
114 TFindFile fileFind2(iFs2); |
|
115 TRAPD(err2,fileFind2.FindByDir(KTestMP3File,KRootDir)); |
|
116 buf2.Copy((TDesC&) fileFind2.File()); |
|
117 |
|
118 TBuf8<60> buf3; |
|
119 RFs iFs3; |
|
120 User::LeaveIfError(iFs3.Connect()); |
|
121 TFindFile fileFind3(iFs3); |
|
122 TRAPD(err3,fileFind3.FindByDir(KTestMP3File,KRootDir)); |
|
123 buf3.Copy((TDesC&) fileFind3.File()); |
|
124 |
|
125 |
|
126 iMdaPlayer_1=CMdaAudioPlayerUtility::NewFilePlayerL(KTestMP3File, *this, EMdaPriorityNormal, |
|
127 EMdaPriorityPreferenceTimeAndQuality); |
|
128 |
|
129 iMdaPlayer_2=CMdaAudioPlayerUtility::NewDesPlayerL(buf2, *this); // creación inmediata |
|
130 iMdaPlayer_3=CMdaAudioPlayerUtility::NewDesPlayerReadOnlyL(buf3, *this); |
|
131 |
|
132 |
|
133 iFs2.Close(); |
|
134 iFs3.Close(); |
|
135 |
|
136 iLogger.Log(_L("Trying to stop player") ); |
|
137 iMdaPlayer_1->Stop(); |
|
138 iLogger.Log(_L("Trying to close player") ); |
|
139 iMdaPlayer_1->Close(); |
|
140 iLogger.Log(_L(" Player stopped") ); |
|
141 delete iMdaPlayer_1; |
|
142 iMdaPlayer_1 = NULL; |
|
143 |
|
144 iLogger.Log(_L("Trying to stop player") ); |
|
145 iMdaPlayer_2->Stop(); |
|
146 iLogger.Log(_L("Trying to close player") ); |
|
147 iMdaPlayer_2->Close(); |
|
148 iLogger.Log(_L(" Player stopped") ); |
|
149 delete iMdaPlayer_2; |
|
150 iMdaPlayer_2 = NULL; |
|
151 |
|
152 iLogger.Log(_L("Trying to stop player") ); |
|
153 iMdaPlayer_3->Stop(); |
|
154 iLogger.Log(_L("Trying to close player") ); |
|
155 iMdaPlayer_3->Close(); |
|
156 iLogger.Log(_L(" Player stopped") ); |
|
157 delete iMdaPlayer_3; |
|
158 iMdaPlayer_3 = NULL; |
|
159 |
|
160 |
|
161 } |
|
162 |
|
163 CSimpleSoundPlayer* CSimpleSoundPlayer::NewLC(CTestModuleIf &aConsole, CStifLogger &iLogger, |
|
164 TBool aUseSharedHeap) |
|
165 { |
|
166 CSimpleSoundPlayer* self = new (ELeave) CSimpleSoundPlayer(aConsole, iLogger); |
|
167 CleanupStack::PushL(self); |
|
168 self->ConstructL(aUseSharedHeap); |
|
169 return self; |
|
170 } |
|
171 |
|
172 CSimpleSoundPlayer* CSimpleSoundPlayer::NewL(CTestModuleIf &aConsole, CStifLogger &iLogger, |
|
173 TBool aUseSharedHeap) |
|
174 { |
|
175 RDebug::Print(_L("CSimpleSoundPlayer::NewL:")); |
|
176 |
|
177 CSimpleSoundPlayer* self = NewLC(aConsole, iLogger, aUseSharedHeap); |
|
178 CleanupStack::Pop(self); |
|
179 return self; |
|
180 } |
|
181 |
|
182 |
|
183 |
|
184 |
|
185 |
|
186 |
|
187 CSimpleSoundPlayer* CSimpleSoundPlayer::NewL(const TDesC8 &aDescriptor, CTestModuleIf &aConsole, CStifLogger &aLogger, TBool aImmediate) |
|
188 { |
|
189 CSimpleSoundPlayer* self = NewLC(aDescriptor, aConsole, aLogger, aImmediate); |
|
190 CleanupStack::Pop(self); |
|
191 return self; |
|
192 } |
|
193 CSimpleSoundPlayer* CSimpleSoundPlayer::NewLC(const TDesC8 &aDescriptor, CTestModuleIf &aConsole, CStifLogger &aLogger, TBool aImmediate) |
|
194 { |
|
195 CSimpleSoundPlayer* self = new (ELeave) CSimpleSoundPlayer(aConsole, aLogger, aImmediate); |
|
196 CleanupStack::PushL(self); |
|
197 self->ConstructL(aDescriptor); |
|
198 return self; |
|
199 } |
|
200 |
|
201 void CSimpleSoundPlayer::ConstructL(const TFileName &aFile) |
|
202 { |
|
203 |
|
204 |
|
205 iMdaPlayer=CMdaAudioPlayerUtility::NewL(*this); //Instantiation by steps |
|
206 |
|
207 // Create a file audio player utility instance |
|
208 //iMdaPlayer_1=CMdaAudioPlayerUtility::NewFilePlayerL(aFile, *this); //For inmediate instantiation |
|
209 |
|
210 |
|
211 iMdaPlayer->UseSharedHeap(); // Ensures that any subsequent calls to OpenXYZ() will create controllers that share a heap. |
|
212 |
|
213 iMdaPlayer->OpenFileL(aFile); |
|
214 iSoundOpen=ETrue; |
|
215 |
|
216 _LIT(KPlayerCreated, "SoundPlayerCreated"); |
|
217 iConsole.Printf(100, KPlayerCreated, KPlayerCreated); |
|
218 |
|
219 iAudioOutput=NULL; |
|
220 } |
|
221 |
|
222 |
|
223 |
|
224 |
|
225 CSimpleSoundPlayer* CSimpleSoundPlayer::NewLC(const TFileName &aFile, CTestModuleIf &aConsole, CStifLogger &aLogger, TBool aImmediate) |
|
226 { |
|
227 CSimpleSoundPlayer* self = new (ELeave) CSimpleSoundPlayer(aConsole, aLogger, aImmediate); |
|
228 |
|
229 CleanupStack::PushL(self); |
|
230 self->ConstructL(aFile); |
|
231 return self; |
|
232 } |
|
233 |
|
234 CSimpleSoundPlayer* CSimpleSoundPlayer::NewL(const TFileName &aFile, CTestModuleIf &aConsole, CStifLogger &aLogger, TBool aImmediate) |
|
235 { |
|
236 CSimpleSoundPlayer* self = NewLC(aFile, aConsole, aLogger, aImmediate); |
|
237 CleanupStack::Pop(self); |
|
238 return self; |
|
239 } |
|
240 |
|
241 void CSimpleSoundPlayer::ConstructL(const RFile &aFile) |
|
242 { |
|
243 // Create a file audio player utility instance |
|
244 //iMdaPlayer=CMdaAudioPlayerUtility::NewFilePlayerL(aFile, *this); //For inmediate instantiation |
|
245 |
|
246 iMdaPlayer=CMdaAudioPlayerUtility::NewL(*this); //Instantiation by steps |
|
247 iMdaPlayer->OpenFileL(aFile); |
|
248 iSoundOpen=ETrue; |
|
249 |
|
250 _LIT(KPlayerCreated, "SoundPlayerCreated"); |
|
251 iConsole.Printf(100, KPlayerCreated, KPlayerCreated); |
|
252 } |
|
253 |
|
254 CSimpleSoundPlayer* CSimpleSoundPlayer::NewLC(const RFile &aFile, CTestModuleIf &aConsole, CStifLogger &aLogger, TBool aImmediate) |
|
255 { |
|
256 CSimpleSoundPlayer* self = new (ELeave) CSimpleSoundPlayer(aConsole, aLogger, aImmediate); |
|
257 CleanupStack::PushL(self); |
|
258 self->ConstructL(aFile); |
|
259 return self; |
|
260 } |
|
261 |
|
262 CSimpleSoundPlayer* CSimpleSoundPlayer::NewL(const RFile &aFile, CTestModuleIf &aConsole, CStifLogger &aLogger, TBool aImmediate) |
|
263 { |
|
264 CSimpleSoundPlayer* self = NewLC(aFile, aConsole, aLogger, aImmediate); |
|
265 CleanupStack::Pop(self); |
|
266 return self; |
|
267 } |
|
268 |
|
269 |
|
270 |
|
271 |
|
272 |
|
273 TInt CSimpleSoundPlayer::OpenL(const TFileName &aFileName , const TBool &aImmediate=ETrue) |
|
274 { |
|
275 iImmediate = aImmediate; |
|
276 Stop(); |
|
277 iLogger.Log(_L("Stop before opening file")); |
|
278 |
|
279 iLogger.Log(_L("Closed, opening [%S]") , &aFileName); |
|
280 iMdaPlayer->OpenFileL(aFileName); |
|
281 iSoundOpen=ETrue; |
|
282 iLogger.Log(_L("Opened")); |
|
283 |
|
284 return KErrNone; |
|
285 } |
|
286 |
|
287 TInt CSimpleSoundPlayer::OpenFileHandlerL(const TFileName &aFileName , const TBool &aImmediate=ETrue) |
|
288 { |
|
289 iImmediate = aImmediate; |
|
290 Stop(); |
|
291 iLogger.Log(_L("Stop before opening file")); |
|
292 |
|
293 iLogger.Log(_L("Closed, opening [%S]") , &aFileName); |
|
294 |
|
295 RFs aFs; |
|
296 RFile aFileHandler; |
|
297 User::LeaveIfError(aFs.Connect()); |
|
298 |
|
299 User::LeaveIfError(aFileHandler.Open( aFs, aFileName, EFileRead)); |
|
300 iMdaPlayer->OpenFileL(aFileHandler); |
|
301 |
|
302 aFileHandler.Close(); |
|
303 aFs.Close(); |
|
304 |
|
305 iSoundOpen=ETrue; |
|
306 iLogger.Log(_L("Opened")); |
|
307 return KErrNone; |
|
308 } |
|
309 |
|
310 TInt CSimpleSoundPlayer::OpenUrlL(const TDesC &aUrl, TInt aIapId, const TDesC8 &aMime) |
|
311 { |
|
312 iLogger.Log(_L("Opening url [%S] with IapId [%s]") , &aUrl , aIapId ); |
|
313 iLogger.Log(_L8(" and MIME Type [%S]") , &aMime); |
|
314 iMdaPlayer->OpenUrlL(aUrl, aIapId, aMime); |
|
315 return ETrue; |
|
316 } |
|
317 |
|
318 |
|
319 |
|
320 |
|
321 TInt CSimpleSoundPlayer::OpenDesL(const TDesC8 &aSoundDes , const TBool &aImmediate) |
|
322 { |
|
323 iImmediate = aImmediate; |
|
324 Stop(); |
|
325 iLogger.Log(_L("Stop before opening descriptor")); |
|
326 |
|
327 iLogger.Log(_L("Closed, opening second descriptor of length (%d)") , aSoundDes.Length() ); |
|
328 |
|
329 iMdaPlayer->OpenDesL(aSoundDes); |
|
330 iSoundOpen=ETrue; |
|
331 iLogger.Log(_L("Opened")); |
|
332 ////iAutoClose = ETrue; ///K |
|
333 return KErrNone; |
|
334 } |
|
335 |
|
336 TInt CSimpleSoundPlayer::Play() |
|
337 { |
|
338 if(iState==EReady || iState==EPaused) |
|
339 { |
|
340 iState=EPlaying; |
|
341 iLastPlayTime.HomeTime(); |
|
342 iLastStopTime.HomeTime(); |
|
343 iMdaPlayer->Play(); |
|
344 iLogger.Log(_L("Requested Play")); |
|
345 } |
|
346 else |
|
347 { |
|
348 iLogger.Log(_L("Requested Play, Not Ready to play")); |
|
349 iImmediate = true; |
|
350 } |
|
351 return KErrNone; |
|
352 } |
|
353 |
|
354 TInt CSimpleSoundPlayer::Stop(const TBool &aAlsoClose) |
|
355 { |
|
356 iLogger.Log(_L("Requested Stop,,,,,")); |
|
357 iMdaPlayer->Stop(); |
|
358 |
|
359 iLogger.Log(_L("Requested Stop,,,,, successful")); |
|
360 iLastStopTime.HomeTime(); |
|
361 if (aAlsoClose) |
|
362 { |
|
363 iLogger.Log(_L("iMdaPlayer->Close()" )); |
|
364 iMdaPlayer->Close(); |
|
365 iLogger.Log(_L("iMdaPlayer->Close() successful" )); |
|
366 iSoundOpen=EFalse; |
|
367 iState = ENotReady; |
|
368 } |
|
369 else |
|
370 { |
|
371 if (iState==EPlaying || iState==EPaused) {iState = EReady;} |
|
372 } |
|
373 return KErrNone; |
|
374 } |
|
375 |
|
376 |
|
377 TInt CSimpleSoundPlayer::Pause() |
|
378 { |
|
379 iLogger.Log(_L("Requested Pause")); |
|
380 iState=EPaused; |
|
381 // Resume is not supported in Devsound adaptation on HW ... this will crash the phone for WAV. |
|
382 #ifdef __WINS__ |
|
383 iMdaPlayer->WillResumePlay(); |
|
384 #endif |
|
385 iMdaPlayer->Pause(); |
|
386 return KErrNone; |
|
387 } |
|
388 |
|
389 TInt CSimpleSoundPlayer::PauseResume() |
|
390 { |
|
391 iLogger.Log(_L("Requested Pause")); |
|
392 iState=EPaused; |
|
393 // Resume is not supported in Devsound adaptation on HW ... this will crash the phone for WAV. |
|
394 #ifdef __WINS__ |
|
395 iMdaPlayer->WillResumePlay(); |
|
396 #endif |
|
397 iMdaPlayer->Pause(); |
|
398 return KErrNone; |
|
399 } |
|
400 |
|
401 void CSimpleSoundPlayer::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds &/*aDuration*/) |
|
402 { |
|
403 iLogger.Log(_L("MapcInitComplete")); |
|
404 |
|
405 if (iImmediate) |
|
406 { |
|
407 if (aError == KErrNone) |
|
408 { |
|
409 _LIT(KGonnaPlay, "MapcInitComplete, GoingToPlay"); |
|
410 _LIT(KGoing, "Going to"); |
|
411 _LIT(KDone, "Done Started Playing"); |
|
412 iConsole.Printf(100, KGonnaPlay, KGoing); |
|
413 |
|
414 |
|
415 |
|
416 if (playVolume) |
|
417 { |
|
418 // TInt VolumeHigh; |
|
419 iLogger.Log(_L("SetVolume") ); |
|
420 TInt maxVolume = iMdaPlayer->MaxVolume(); |
|
421 iLogger.Log(_L("MaxVolume is %d"), maxVolume ); |
|
422 iMdaPlayer->SetVolume(maxVolume); |
|
423 iLogger.Log(_L("SetVolume(iMdaPlayer->MaxVolume()) max=(%d)"), iMdaPlayer->MaxVolume() ); |
|
424 } |
|
425 |
|
426 if (metaInfo) |
|
427 { |
|
428 TInt NumMetaDatas; |
|
429 TInt MetaDataError = iMdaPlayer->GetNumberOfMetaDataEntries(NumMetaDatas); |
|
430 if ( MetaDataError ) |
|
431 { //Error getting meta data info |
|
432 Exit(MetaDataError); |
|
433 } |
|
434 else |
|
435 { //No error yet |
|
436 TInt currMetaDataIndex; |
|
437 for ( currMetaDataIndex=0 ; currMetaDataIndex < NumMetaDatas ; currMetaDataIndex++) |
|
438 { |
|
439 CMMFMetaDataEntry *currMetaData = iMdaPlayer->GetMetaDataEntryL(currMetaDataIndex); |
|
440 // check for jpeg image |
|
441 if (currMetaData->Name() == _L("attachedpicture")) |
|
442 iLogger.Log(_L("MetaData[%d]: Name: [%S], Value: [image]") , currMetaDataIndex , &(currMetaData->Name()) ); |
|
443 else |
|
444 iLogger.Log(_L("MetaData[%d]: Name: [%S], Value: [%S]") , currMetaDataIndex , &(currMetaData->Name()) , &(currMetaData->Value()) ); |
|
445 delete currMetaData; |
|
446 } |
|
447 } |
|
448 } |
|
449 |
|
450 |
|
451 |
|
452 if (playWindow) |
|
453 { |
|
454 iLogger.Log(_L("SetPlayWindow, start=[%d]"),startPosition.Int64()); |
|
455 iLogger.Log(_L("SetPlayWindow, end=[%d]"), endPosition.Int64() ); |
|
456 TInt pwErr = iMdaPlayer->SetPlayWindow(startPosition, endPosition); |
|
457 iLogger.Log(_L("SetPlayWindow err=[%d]"), pwErr); |
|
458 if (clearWindow) |
|
459 { |
|
460 iLogger.Log(_L("ClearPlayWindow")); |
|
461 iMdaPlayer->ClearPlayWindow(); |
|
462 |
|
463 } |
|
464 } |
|
465 |
|
466 if (setBalance) |
|
467 { |
|
468 SetBalance(aBalance); |
|
469 } |
|
470 |
|
471 // Binh |
|
472 if (iDontPlayAudioClip) |
|
473 { |
|
474 iState = EReady; |
|
475 Exit(aError); |
|
476 } |
|
477 else |
|
478 { |
|
479 iState = EPlaying; |
|
480 iLastPlayTime.HomeTime(); |
|
481 iLastStopTime.HomeTime(); |
|
482 if (! playWindow) |
|
483 { |
|
484 iLogger.Log(_L("Position before Play (%d)"), I64INT(iPosition.Int64())/1000000); |
|
485 iMdaPlayer->SetPosition(iPosition); |
|
486 } |
|
487 iMdaPlayer->Play(); |
|
488 |
|
489 iLogger.Log(_L("Play() was called")); |
|
490 |
|
491 iConsole.Printf(100, KGonnaPlay, KDone); |
|
492 } |
|
493 } |
|
494 else |
|
495 { |
|
496 iLogger.Log(_L("InitError (%d)"), aError); |
|
497 iState = ENotReady; |
|
498 Exit(aError); |
|
499 } |
|
500 } |
|
501 else |
|
502 { |
|
503 iLogger.Log(_L("InitComplete, error(%d)") , aError); |
|
504 iState = aError ? ENotReady : EReady; |
|
505 if (aError) |
|
506 { |
|
507 Exit(aError); |
|
508 } |
|
509 //added |
|
510 else |
|
511 { |
|
512 CActiveScheduler::Stop(); |
|
513 } |
|
514 |
|
515 } |
|
516 } |
|
517 |
|
518 void CSimpleSoundPlayer::MapcPlayComplete(TInt aError) |
|
519 { |
|
520 iLastStopTime.HomeTime(); |
|
521 iLogger.Log(_L("MapcPlayComplete, error (%d)") , aError); |
|
522 |
|
523 _LIT(KGonnaPlay, "MapcPlayComplete, GoingToPlay"); |
|
524 _LIT(KGoing, "Going to"); |
|
525 |
|
526 iConsole.Printf(100, KGonnaPlay, KGoing); |
|
527 |
|
528 iState = aError ? ENotReady : EReady; |
|
529 iConsole.Printf(100, KGonnaPlay, KGoing); |
|
530 |
|
531 Exit(aError); |
|
532 if (iEventTarget && iParameters) |
|
533 { |
|
534 Stop(); |
|
535 iEventTarget->ExecuteL(iParameters) ; |
|
536 } |
|
537 } |
|
538 |
|
539 |
|
540 void CSimpleSoundPlayer::DoCancel() |
|
541 { |
|
542 iLogger.Log(_L("DoCancel")); |
|
543 } |
|
544 |
|
545 void CSimpleSoundPlayer::MaloLoadingStarted() |
|
546 { |
|
547 iLogger.Log(_L("MaloLoadingStarted")); |
|
548 } |
|
549 |
|
550 void CSimpleSoundPlayer::MaloLoadingComplete() |
|
551 { |
|
552 iLogger.Log(_L("MaloLoadingComplete")); |
|
553 } |
|
554 |
|
555 void CSimpleSoundPlayer::MarncResourceAvailable(TUid aNotificationEventId, const TDesC8 &aNotificationData) |
|
556 { |
|
557 iLogger.Log(_L("MarncResourceAvailable")); |
|
558 } |
|
559 |
|
560 CSimpleSoundPlayer::~CSimpleSoundPlayer() |
|
561 { |
|
562 if(iAudioOutput) |
|
563 { |
|
564 delete iAudioOutput; |
|
565 iAudioOutput=NULL; |
|
566 } |
|
567 iLogger.Log(_L("Trying to stop player") ); |
|
568 iMdaPlayer->Stop(); |
|
569 iLogger.Log(_L("Trying to close player") ); |
|
570 iMdaPlayer->Close(); |
|
571 iLogger.Log(_L(" Player stopped") ); |
|
572 delete iMdaPlayer; |
|
573 iMdaPlayer = NULL; |
|
574 } |
|
575 |
|
576 TTimeIntervalMicroSeconds CSimpleSoundPlayer::GetDuration() |
|
577 { |
|
578 TTimeIntervalMicroSeconds Duration = iMdaPlayer->Duration(); |
|
579 iLogger.Log(_L("CMdaAudioPlayerUtility::Duration() returned [%d]") , Duration.Int64()); |
|
580 return Duration; |
|
581 } |
|
582 |
|
583 |
|
584 TTimeIntervalMicroSeconds CSimpleSoundPlayer::GetDuration_Para() |
|
585 { |
|
586 |
|
587 TTimeIntervalMicroSeconds Duration = iMdaPlayer->Duration(); |
|
588 iLogger.Log(_L("CMdaAudioPlayerUtility::Duration() returned [%d]") , Duration.Int64()); |
|
589 |
|
590 |
|
591 TTimeIntervalMicroSeconds duration; |
|
592 TMMFDurationInfo durationInfo; |
|
593 |
|
594 |
|
595 durationInfo = iMdaPlayer->Duration(duration); |
|
596 iLogger.Log(_L("CMdaAudioPlayerUtility::Duration(duration) returned [%d]") , duration.Int64()); |
|
597 return duration; |
|
598 } |
|
599 |
|
600 TTimeIntervalMicroSeconds CSimpleSoundPlayer::GetPlayDuration() { return iLastStopTime.MicroSecondsFrom(iLastPlayTime); } |
|
601 |
|
602 TTime CSimpleSoundPlayer::GetPlayStartTime() { return iLastPlayTime; } |
|
603 |
|
604 TTime CSimpleSoundPlayer::GetPlayStopTime() { return iLastStopTime; } |
|
605 |
|
606 TInt CSimpleSoundPlayer::GetBalance(TInt &aBalance) |
|
607 { |
|
608 TInt error = iMdaPlayer->GetBalance(aBalance); |
|
609 iLogger.Log(_L("Retrieving Balance (%d), error(%d)") , aBalance, error); |
|
610 return error; |
|
611 } |
|
612 |
|
613 TInt CSimpleSoundPlayer::SetBalance(TInt aBalance=KMMFBalanceCenter) |
|
614 { |
|
615 TInt error=KErrNone; |
|
616 TInt error2=KErrNone; |
|
617 TInt OldBalance=0; |
|
618 |
|
619 iLogger.Log(_L("Changing Balance ")); |
|
620 |
|
621 error=iMdaPlayer->GetBalance(OldBalance); |
|
622 if (error) |
|
623 { |
|
624 iLogger.Log(_L(" Error getting old balance (%d)"), error) ; |
|
625 } |
|
626 else |
|
627 { |
|
628 iLogger.Log(_L(" Previous balance: %d"), OldBalance); |
|
629 } |
|
630 iLogger.Log(_L(" Setting balance to %d"), aBalance); |
|
631 error2 = iMdaPlayer->SetBalance(aBalance); |
|
632 if (error2) |
|
633 { |
|
634 iLogger.Log(_L(" Error setting new balance (%d)") , error); |
|
635 } |
|
636 else |
|
637 { |
|
638 error=iMdaPlayer->GetBalance(OldBalance); |
|
639 if (error) |
|
640 { |
|
641 iLogger.Log(_L(" Error getting new balance (%d)"), error) ; |
|
642 } |
|
643 else |
|
644 { |
|
645 iLogger.Log(_L(" Current balance: %d"), OldBalance); |
|
646 } |
|
647 } |
|
648 |
|
649 if (OldBalance!= aBalance) |
|
650 { |
|
651 Exit(-1502); |
|
652 } |
|
653 |
|
654 return error2; |
|
655 } |
|
656 |
|
657 TInt CSimpleSoundPlayer::SetPriority(TInt aPriority, TMdaPriorityPreference aPref) |
|
658 { |
|
659 iLogger.Log(_L("Trying to set priority settings to (%d),(%d) ") , aPriority, aPref); |
|
660 TInt PriorityError = iMdaPlayer->SetPriority(aPriority, aPref); |
|
661 if (PriorityError) |
|
662 { |
|
663 iLogger.Log(_L("Error setting priority to (%d),(%d) ") , aPriority, aPref); |
|
664 } |
|
665 else |
|
666 { |
|
667 iLogger.Log(_L("Priority set to (%d),(%d)") , aPriority, aPref); |
|
668 } |
|
669 |
|
670 |
|
671 return PriorityError; |
|
672 } |
|
673 |
|
674 TInt CSimpleSoundPlayer::SetThread_Priority() |
|
675 { |
|
676 TThreadPriority threadPriority = EPriorityNormal; |
|
677 iLogger.Log(_L("Trying to set thread priority settings to (%d) ") , threadPriority); |
|
678 TInt PriorityError = iMdaPlayer->SetThreadPriority(threadPriority); |
|
679 if (PriorityError) |
|
680 { |
|
681 iLogger.Log(_L("Error setting thread priority to (%d) ") , threadPriority); |
|
682 } |
|
683 else |
|
684 { |
|
685 iLogger.Log(_L("Thread Priority set to (%d)") , threadPriority); |
|
686 } |
|
687 return PriorityError; |
|
688 } |
|
689 |
|
690 |
|
691 void CSimpleSoundPlayer::GetLoad_Percentage() |
|
692 { |
|
693 TInt percentage; |
|
694 iLogger.Log(_L("Trying to GetLoad_Percentage\n ") ); |
|
695 iMdaPlayer->GetAudioLoadingProgressL(percentage); |
|
696 iLogger.Log(_L("GetAudioLoadingProgressL (%d)") , percentage); |
|
697 } |
|
698 |
|
699 void CSimpleSoundPlayer::GetBit_Rate() |
|
700 { |
|
701 TUint bitRate; |
|
702 iLogger.Log(_L("Trying to GetLoad_Percentage\n ") ); |
|
703 iMdaPlayer->GetBitRate(bitRate); |
|
704 iLogger.Log(_L("GetAudioLoadingProgressL (%d)") , bitRate); |
|
705 } |
|
706 |
|
707 void CSimpleSoundPlayer::GetDRMCmd() |
|
708 { |
|
709 |
|
710 // Create DRM custom command |
|
711 MMMFDRMCustomCommand* drmCustomCommand; |
|
712 drmCustomCommand = iMdaPlayer->GetDRMCustomCommand(); |
|
713 iLogger.Log(_L("called iMdaPlayer->GetDRMCustomCommand ")); |
|
714 if (drmCustomCommand == NULL) |
|
715 { |
|
716 iLogger.Log(_L("MMMFDRMCustomCommand is NULL")); |
|
717 } |
|
718 else if(drmCustomCommand) |
|
719 { |
|
720 TBool DisableAutoIntent=ETrue; |
|
721 TInt error=KErrNone; |
|
722 error=drmCustomCommand->DisableAutomaticIntent(DisableAutoIntent); |
|
723 iLogger.Log(_L("Error getting from drmCustomCommand[%d]") , error); |
|
724 if (error==KErrPermissionDenied) |
|
725 { |
|
726 iLogger.Log(_L("MMMFDRMCustomCommand is not NULL-DisableAutomaticIntent[%d]"),error); |
|
727 } |
|
728 else |
|
729 { |
|
730 iLogger.Log(_L("MMMFDRMCustomCommand -DisableAutomaticIntent[%d]"),error); |
|
731 } |
|
732 error=drmCustomCommand->EvaluateIntent(ContentAccess::EPlay); |
|
733 if (error==KErrPermissionDenied) |
|
734 { |
|
735 iLogger.Log(_L("MMMFDRMCustomCommand is not NULL-EvaluateIntent[%d]"),error); |
|
736 } |
|
737 else |
|
738 { |
|
739 iLogger.Log(_L("MMMFDRMCustomCommand-EvaluateIntent[%d]"),error); |
|
740 } |
|
741 error=drmCustomCommand->ExecuteIntent(ContentAccess::EPlay); |
|
742 if (error==KErrPermissionDenied) |
|
743 { |
|
744 iLogger.Log(_L("MMMFDRMCustomCommand is not NULL-ExecuteIntent[%d]"),error); |
|
745 } |
|
746 else |
|
747 { |
|
748 iLogger.Log(_L("MMMFDRMCustomCommand-ExecuteIntent[%d]"),error); |
|
749 } |
|
750 error=drmCustomCommand->SetAgentProperty(ContentAccess::EAgentPropertyAgentUI,0); |
|
751 if (error==KErrPermissionDenied) |
|
752 { |
|
753 iLogger.Log(_L("MMMFDRMCustomCommand is not NULL-SetAgentProperty[%d]"),error); |
|
754 } |
|
755 else |
|
756 { |
|
757 iLogger.Log(_L("MMMFDRMCustomCommand-SetAgentProperty[%d]"),error); |
|
758 } |
|
759 } |
|
760 |
|
761 iLogger.Log(_L("Exits CSimpleSoundPlayer::GetDRMCmd ")); |
|
762 |
|
763 } |
|
764 |
|
765 |
|
766 void CSimpleSoundPlayer::RegNotification() |
|
767 { |
|
768 iLogger.Log(_L("Trying to GetLoad_Percentage\n ") ); |
|
769 |
|
770 iMdaPlayer->RegisterAudioResourceNotification(*this, KUidInterfaceMMFController,KNullDesC8); |
|
771 iLogger.Log(_L("RegisterAudioResourceNotification() finished") ); |
|
772 } |
|
773 |
|
774 |
|
775 void CSimpleSoundPlayer::RegLoadNotification() |
|
776 { |
|
777 iLogger.Log(_L("Trying to GetLoad_Percentage\n ") ); |
|
778 MMMFDRMCustomCommand* cmd = iMdaPlayer->GetDRMCustomCommand(); |
|
779 |
|
780 iMdaPlayer->RegisterForAudioLoadingNotification(*this); |
|
781 iLogger.Log(_L("RegisterForAudioLoadingNotification() finished ") ); |
|
782 } |
|
783 |
|
784 void CSimpleSoundPlayer::CancelNotification() |
|
785 { |
|
786 |
|
787 iLogger.Log(_L("Trying to GetLoad_Percentage\n ") ); |
|
788 TInt CanError = iMdaPlayer->CancelRegisterAudioResourceNotification(KUidInterfaceMMFController); |
|
789 iLogger.Log(_L("CancelRegisterAudioResourceNotification finished") ); |
|
790 } |
|
791 |
|
792 void CSimpleSoundPlayer::CtrImpInfo() |
|
793 { |
|
794 iLogger.Log(_L("Trying to GetLoad_Percentage\n ") ); |
|
795 const CMMFControllerImplementationInformation& info = iMdaPlayer->ControllerImplementationInformationL(); |
|
796 iLogger.Log(_L("GetDRMCustomCommand() finished") ); |
|
797 } |
|
798 |
|
799 void CSimpleSoundPlayer::Set_Priority() |
|
800 { |
|
801 iLogger.Log(_L("Trying to Set_Prioritye\n ") ); |
|
802 |
|
803 TInt PriError = iMdaPlayer->SetPriority(KAudioPriorityRealOnePlayer, (TMdaPriorityPreference)KAudioPrefRealOneLocalPlayback); |
|
804 iLogger.Log(_L("Set_Prioritye() finished [%d]"), PriError ); |
|
805 } |
|
806 |
|
807 |
|
808 |
|
809 void CSimpleSoundPlayer::SetPosition(const TTimeIntervalMicroSeconds &aPosition) |
|
810 { |
|
811 iMdaPlayer->SetPosition(aPosition); |
|
812 } |
|
813 |
|
814 |
|
815 TInt CSimpleSoundPlayer::GetPosition(TTimeIntervalMicroSeconds &aPosition) |
|
816 { |
|
817 TTimeIntervalMicroSeconds Position; |
|
818 TInt PositionError = iMdaPlayer->GetPosition(Position); |
|
819 |
|
820 if (!PositionError) |
|
821 { |
|
822 iLogger.Log(_L("Current position [%d]") , Position.Int64()); |
|
823 if (iState != EPlaying) {iLogger.Log(_L(" But not playing"));} |
|
824 if ( ! iSoundOpen ) {iLogger.Log(_L(" But not open"));} |
|
825 aPosition=Position; |
|
826 } |
|
827 else |
|
828 { |
|
829 Exit(PositionError); |
|
830 } |
|
831 return PositionError; |
|
832 } |
|
833 |
|
834 void CSimpleSoundPlayer::Exit(TInt aExitCode) |
|
835 { |
|
836 iFinalError = aExitCode; |
|
837 if (iSupervisor) |
|
838 { |
|
839 iSupervisor->NotifyDestruction(); |
|
840 } |
|
841 else |
|
842 { |
|
843 CActiveScheduler::Stop(); |
|
844 } |
|
845 } |
|
846 |
|
847 void CSimpleSoundPlayer::SetVolumeRamp(const TTimeIntervalMicroSeconds &aRampDuration) |
|
848 { |
|
849 iMdaPlayer->SetVolumeRamp(aRampDuration); |
|
850 } |
|
851 |
|
852 void CSimpleSoundPlayer::SetVolume(TInt aNewVolume) |
|
853 { |
|
854 iMdaPlayer->SetVolume(aNewVolume); |
|
855 } |
|
856 |
|
857 TInt CSimpleSoundPlayer::GetVolume(TInt &aVolume) |
|
858 { |
|
859 TInt VolumeError = iMdaPlayer->GetVolume(aVolume); |
|
860 if (VolumeError) |
|
861 { |
|
862 iLogger.Log(_L("Error (%d) getting volume") , VolumeError ); |
|
863 } |
|
864 else |
|
865 { |
|
866 iLogger.Log(_L("Getting volume: (%d)") , aVolume); |
|
867 } |
|
868 return VolumeError; |
|
869 } |
|
870 |
|
871 TInt CSimpleSoundPlayer::MaxVolume() |
|
872 { |
|
873 return iMdaPlayer->MaxVolume(); |
|
874 } |
|
875 |
|
876 void CSimpleSoundPlayer::SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds &aTrailingSilence) |
|
877 { |
|
878 iMdaPlayer->SetRepeats(aRepeatNumberOfTimes , aTrailingSilence); |
|
879 if ((aRepeatNumberOfTimes == -2) || (aRepeatNumberOfTimes > 0)) |
|
880 iIsLoopPlayEnabled = ETrue; |
|
881 else |
|
882 iIsLoopPlayEnabled = EFalse; |
|
883 } |
|
884 |
|
885 TInt CSimpleSoundPlayer::SetPlayWindow(const TTimeIntervalMicroSeconds &aStart, const TTimeIntervalMicroSeconds &aEnd) |
|
886 { |
|
887 iLogger.Log(_L("iMdaPlayer->SetPlayWindow() Start[%d] End[%d]"), aStart.Int64(), aEnd.Int64()); |
|
888 return iMdaPlayer->SetPlayWindow(aStart, aEnd); |
|
889 } |
|
890 |
|
891 TInt CSimpleSoundPlayer::ClearPlayWindow() |
|
892 { |
|
893 iLogger.Log(_L("iMdaPlayer->ClearPlayWindow()")); |
|
894 return iMdaPlayer->ClearPlayWindow(); |
|
895 } |
|
896 |
|
897 |
|
898 |
|
899 void CSimpleSoundPlayer::SetSupervisor(TObjectCountDown *aCounter) |
|
900 { |
|
901 iSupervisor = aCounter; |
|
902 iSupervisor->NotifyCreation(); |
|
903 } |
|
904 |
|
905 void CSimpleSoundPlayer::SetPlayCompleteTarget(MEventTarget *aTarget, CParameters *aParameters) |
|
906 { |
|
907 iEventTarget = aTarget; |
|
908 iParameters = aParameters; |
|
909 } |
|
910 |
|
911 |
|
912 |
|
913 |
|
914 |
|
915 TInt CSimpleSoundPlayer::GetNumberOfMetaDataEntries(TInt &aNumEntries) |
|
916 { |
|
917 |
|
918 |
|
919 TInt ErrorCode = iMdaPlayer->GetNumberOfMetaDataEntries(aNumEntries); |
|
920 if (ErrorCode) |
|
921 { |
|
922 iLogger.Log(_L("Error (%d) getting number of meta data entries") , ErrorCode); |
|
923 } |
|
924 else |
|
925 { |
|
926 iLogger.Log(_L("Clip has (%d) meta data entries") , aNumEntries); |
|
927 } |
|
928 return ErrorCode; |
|
929 } |
|
930 |
|
931 CMMFMetaDataEntry *CSimpleSoundPlayer::GetMetaDataEntryL(TInt aMetaDataIndex) |
|
932 { |
|
933 iLogger.Log(_L("Obtaining meta data with index (%d)") , aMetaDataIndex); |
|
934 return iMdaPlayer->GetMetaDataEntryL(aMetaDataIndex); |
|
935 } |
|
936 |
|
937 TInt CSimpleSoundPlayer::ExecuteL(CParameters *aParams) |
|
938 { |
|
939 TTimeIntervalMicroSeconds tmpPosition = TTimeIntervalMicroSeconds(0); |
|
940 CUrlParameters *p; |
|
941 switch (aParams->iAction) |
|
942 { |
|
943 case KPlayerActionPause: |
|
944 Pause(); |
|
945 break; |
|
946 case KPlayerActionPauseResume: |
|
947 PauseResume(); |
|
948 break; |
|
949 case KPlayerActionPlay: |
|
950 Play(); |
|
951 break; |
|
952 case KPlayerActionStopPlayFile: |
|
953 OpenL( (static_cast<CFileNameParameters*>(aParams) )->GetFileName() , ETrue); |
|
954 break; |
|
955 case KPlayerActionReportPosition: |
|
956 GetPosition(tmpPosition); |
|
957 return ETrue; |
|
958 case KPlayerActionReportDuration: |
|
959 GetDuration(); |
|
960 return ETrue; |
|
961 case KPlayerActionReportDuration_Para: |
|
962 GetDuration_Para(); |
|
963 return ETrue; |
|
964 case KPlayerActionStopPlayDes: |
|
965 OpenDesL( (static_cast<CDes8Parameters *>(aParams) )->GetDes8() , ETrue); |
|
966 break; |
|
967 case KPlayerActionReportVolume: |
|
968 TInt tmpVolume; |
|
969 GetVolume(tmpVolume); |
|
970 return ETrue; |
|
971 case KPlayerActionStopPlayUrl: |
|
972 p = static_cast<CUrlParameters *>(aParams); |
|
973 OpenUrlL(p->GetUrl() , p->GetIapId() , p->GetMimeType() ); |
|
974 break; |
|
975 |
|
976 case KPlayerActionStopPlayFileHandler: |
|
977 OpenFileHandlerL((static_cast<CFileNameParameters*>(aParams) )->GetFileName() , ETrue); |
|
978 // OpenFileHandlerL( (static_cast<CFileHandlerParameters*>(aParams) )->GetFileHandler() , ETrue); |
|
979 break; |
|
980 } |
|
981 if (iIsLoopPlayEnabled) |
|
982 return ETrue; |
|
983 else |
|
984 return EFalse; |
|
985 } |
|
986 |
|
987 |
|
988 TInt CSimpleSoundPlayer::OpenFile(const TFileName &aFile) |
|
989 { |
|
990 iLogger.Log(_L("CSimpleSoundPlayer::OpenFile")); |
|
991 |
|
992 TRAPD(err, iMdaPlayer->SetPriority(KAudioPriorityRealOnePlayer, |
|
993 (TMdaPriorityPreference)KAudioPrefRealOneLocalPlayback)); |
|
994 { |
|
995 if (err != KErrNone) |
|
996 { |
|
997 iFinalError = err; |
|
998 return err; |
|
999 } |
|
1000 } |
|
1001 |
|
1002 |
|
1003 iMdaPlayer->OpenFileL(aFile); |
|
1004 |
|
1005 return KErrNone; |
|
1006 } |
|
1007 |
|
1008 |
|
1009 TInt CSimpleSoundPlayer::OpenWithFileHandler(const RFile &aFile) |
|
1010 { |
|
1011 iLogger.Log(_L("CSimpleSoundPlayer::OpenWithFileHandler")); |
|
1012 |
|
1013 /* TRAPD(err, iMdaPlayer->SetPriority(KAudioPriorityRealOnePlayer, |
|
1014 (TMdaPriorityPreference)KAudioPrefRealOneLocalPlayback)); |
|
1015 { |
|
1016 if (err != KErrNone) |
|
1017 { |
|
1018 iFinalError = err; |
|
1019 return err; |
|
1020 } |
|
1021 }*/ |
|
1022 |
|
1023 |
|
1024 iMdaPlayer->OpenFileL(aFile); |
|
1025 |
|
1026 return KErrNone; |
|
1027 } |
|
1028 |
|
1029 |
|
1030 TInt CSimpleSoundPlayer::OpenWithFileSource(const TMMSource &aSource) |
|
1031 { |
|
1032 iLogger.Log(_L("CSimpleSoundPlayer::OpenWithFileSource")); |
|
1033 |
|
1034 TRAPD(err, iMdaPlayer->SetPriority(KAudioPriorityRealOnePlayer, |
|
1035 (TMdaPriorityPreference)KAudioPrefRealOneLocalPlayback)); |
|
1036 { |
|
1037 if (err != KErrNone) |
|
1038 { |
|
1039 iFinalError = err; |
|
1040 return err; |
|
1041 } |
|
1042 } |
|
1043 |
|
1044 |
|
1045 iMdaPlayer->OpenFileL(aSource); |
|
1046 |
|
1047 return KErrNone; |
|
1048 } |
|
1049 |
|
1050 TInt CSimpleSoundPlayer::OpenWithDesc(const TDesC8 &aDescriptor) |
|
1051 { |
|
1052 iLogger.Log(_L("CSimpleSoundPlayer::OpenWithDesc")); |
|
1053 |
|
1054 TRAPD(err, iMdaPlayer->SetPriority(KAudioPriorityRealOnePlayer, |
|
1055 (TMdaPriorityPreference)KAudioPrefRealOneLocalPlayback)); |
|
1056 { |
|
1057 if (err != KErrNone) |
|
1058 { |
|
1059 iFinalError = err; |
|
1060 return err; |
|
1061 } |
|
1062 } |
|
1063 |
|
1064 |
|
1065 iMdaPlayer->OpenDesL(aDescriptor); |
|
1066 |
|
1067 return KErrNone; |
|
1068 } |
|
1069 |
|
1070 void CSimpleSoundPlayer::AudioOutputCreationL() |
|
1071 { |
|
1072 CAudioOutput::TAudioOutputPreference output(CAudioOutput::EAll); |
|
1073 TBool secure=ETrue; |
|
1074 TInt err=KErrNone; |
|
1075 |
|
1076 iLogger.Log(_L("calling CAudioOutput")); |
|
1077 TRAP(err,iAudioOutput=CAudioOutput::NewL(*iMdaPlayer)); |
|
1078 if(err!=KErrNone) |
|
1079 { |
|
1080 iLogger.Log(_L("AudioOutput Creation Error - err=%d"),err); |
|
1081 User::Leave(err); |
|
1082 } |
|
1083 else |
|
1084 { |
|
1085 iLogger.Log(_L("AudioOutput Created successfully - err=%d"),err); |
|
1086 } |
|
1087 TRAP(err,iAudioOutput->SetAudioOutputL(output)); |
|
1088 if (err == KErrNone) |
|
1089 { |
|
1090 iLogger.Log(_L("CAudioOutput/SetAudioOutputL - err=%d"),err); |
|
1091 |
|
1092 } |
|
1093 else |
|
1094 iLogger.Log(_L("CAudioOutput/SetAudioOutputL else - err=%d"),err); |
|
1095 iLogger.Log(_L("calling setsecureoutputl")); |
|
1096 TRAP(err,iAudioOutput->SetSecureOutputL(secure)); |
|
1097 if(err!=KErrNone) |
|
1098 { |
|
1099 iLogger.Log(_L("CAudioOutput/SetSecureOutputL - err if=%d"),err); |
|
1100 |
|
1101 } |
|
1102 else |
|
1103 { |
|
1104 iLogger.Log(_L("CAudioOutput/SetSecureOutputL - err else=%d"),err); |
|
1105 } |
|
1106 } |
|
1107 |
|
1108 void CSimpleSoundPlayer::LoopPlayL() |
|
1109 { |
|
1110 iLogger.Log(_L("CMyPlayer::SetRepeatsForever")); |
|
1111 //iMdaPlayer->SetRepeats(KMdaRepeatForever, TTimeIntervalMicroSeconds(3000000)); |
|
1112 iMdaPlayer->SetRepeats(KRepeatTimes, TTimeIntervalMicroSeconds(3000000)); |
|
1113 } |
|
1114 |
|
1115 |
|
1116 |
|
1117 /*void CSimpleSoundPlayer::SetRunCase(TInt aRunCase) |
|
1118 { |
|
1119 iRunCase = aRunCase; |
|
1120 } |
|
1121 |
|
1122 void CSimpleSoundPlayer::SetSubCase(TInt aSubCase) |
|
1123 { |
|
1124 iSubCase = aSubCase; |
|
1125 }*/ |