101 iMsgQueueHandler->Cancel(); |
113 iMsgQueueHandler->Cancel(); |
102 delete iMsgQueueHandler; |
114 delete iMsgQueueHandler; |
103 iMsgQueueHandler = NULL; |
115 iMsgQueueHandler = NULL; |
104 } |
116 } |
105 iMsgQueue.Close(); |
117 iMsgQueue.Close(); |
|
118 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Close - Exit")); |
106 } |
119 } |
107 |
120 |
108 // ----------------------------------------------------------------------------- |
121 // ----------------------------------------------------------------------------- |
109 // RMMFDevSoundProxy::Open |
122 // RMMFDevSoundProxy::Open |
110 // Open a DevSound server session |
123 // Open a DevSound server session |
111 // (other items were commented in a header). |
124 // (other items were commented in a header). |
112 // ----------------------------------------------------------------------------- |
125 // ----------------------------------------------------------------------------- |
113 // |
126 // |
114 EXPORT_C TInt RMMFDevSoundProxy::Open() |
127 EXPORT_C TInt RMMFDevSoundProxy::Open() |
115 { |
128 { |
|
129 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Open - Enter")); |
116 TInt err = iMsgQueue.CreateGlobal(KNullDesC, KMaxMessageQueueItems); |
130 TInt err = iMsgQueue.CreateGlobal(KNullDesC, KMaxMessageQueueItems); |
117 // global, accessible to all that have its handle |
131 // global, accessible to all that have its handle |
118 |
132 |
119 if (err == KErrNone) |
133 if (err == KErrNone) |
120 { |
134 { |
261 // (other items were commented in a header). |
284 // (other items were commented in a header). |
262 // ----------------------------------------------------------------------------- |
285 // ----------------------------------------------------------------------------- |
263 // |
286 // |
264 EXPORT_C TMMFCapabilities RMMFDevSoundProxy::Capabilities() |
287 EXPORT_C TMMFCapabilities RMMFDevSoundProxy::Capabilities() |
265 { |
288 { |
|
289 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Capabilities - Enter")); |
266 // TODO should we use the following ? SYMBIAN_CHECK(iState>=EInitialized, Panic(EMMFDevSoundProxyCapabilitiesInWrongState)); |
290 // TODO should we use the following ? SYMBIAN_CHECK(iState>=EInitialized, Panic(EMMFDevSoundProxyCapabilitiesInWrongState)); |
267 if (iState < EInitialized) |
291 if (iState < EInitialized) |
268 { |
292 { |
269 // call has been made before we are initialized. Not much we can do, so return |
293 // call has been made before we are initialized. Not much we can do, so return |
270 // dummy values but hit debugger on the emulator |
294 // dummy values but hit debugger on the emulator |
271 __DEBUGGER() |
295 __DEBUGGER() |
272 RDebug::Print(_L("BRDBG:CapabilitiesCalledWhenNotInitialised")); // TODO Remove or redo as trace |
296 RDebug::Print(_L("BRDBG:CapabilitiesCalledWhenNotInitialised")); // TODO Remove or redo as trace |
|
297 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Capabilities - Exit")); |
273 return KZeroCapabilities; |
298 return KZeroCapabilities; |
274 } |
299 } |
275 TMMFDevSoundProxySettings set; |
300 TMMFDevSoundProxySettings set; |
276 TMMFDevSoundProxySettingsPckg pckg(set); |
301 TMMFDevSoundProxySettingsPckg pckg(set); |
277 TInt err = SendReceiveResult(EMMFDevSoundProxyCapabilities, |
302 TInt err = SendReceiveResult(EMMFDevSoundProxyCapabilities, |
278 iDestinationPckg, |
303 iDestinationPckg, |
279 KNullDesC8, |
304 KNullDesC8, |
280 pckg); |
305 pckg); |
281 if (err == KErrNone) |
306 if (err == KErrNone) |
282 { |
307 { |
|
308 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Capabilities - Exit")); |
283 return pckg().iCaps; |
309 return pckg().iCaps; |
284 } |
310 } |
285 else |
311 else |
286 { |
312 { |
|
313 SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::Capabilities - Exit [%d]"), err); |
287 return KZeroCapabilities; |
314 return KZeroCapabilities; |
288 } |
315 } |
289 } |
316 } |
290 |
317 |
291 // ----------------------------------------------------------------------------- |
318 // ----------------------------------------------------------------------------- |
294 // (other items were commented in a header). |
321 // (other items were commented in a header). |
295 // ----------------------------------------------------------------------------- |
322 // ----------------------------------------------------------------------------- |
296 // |
323 // |
297 EXPORT_C TMMFCapabilities RMMFDevSoundProxy::Config() |
324 EXPORT_C TMMFCapabilities RMMFDevSoundProxy::Config() |
298 { |
325 { |
|
326 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Config - Enter")); |
299 // TODO should we use the following ? SYMBIAN_CHECK(iState>=EInitialized, Panic(EMMFDevSoundProxyConfigInWrongState)); |
327 // TODO should we use the following ? SYMBIAN_CHECK(iState>=EInitialized, Panic(EMMFDevSoundProxyConfigInWrongState)); |
300 if (iState < EInitialized) |
328 if (iState < EInitialized) |
301 { |
329 { |
302 // call has been made before we are initialized. Not much we can do, so return |
330 // call has been made before we are initialized. Not much we can do, so return |
303 // dummy values but hit debugger on the emulator |
331 // dummy values but hit debugger on the emulator |
304 __DEBUGGER() |
332 __DEBUGGER() |
305 RDebug::Print(_L("BRDBG:ConfigCalledWhenNotInitialised")); // TODO Remove or redo as trace |
333 RDebug::Print(_L("BRDBG:ConfigCalledWhenNotInitialised")); // TODO Remove or redo as trace |
|
334 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Config - Exit")); |
306 return KZeroCapabilities; |
335 return KZeroCapabilities; |
307 } |
336 } |
308 TMMFDevSoundProxySettings set; |
337 TMMFDevSoundProxySettings set; |
309 TMMFDevSoundProxySettingsPckg pckg(set); |
338 TMMFDevSoundProxySettingsPckg pckg(set); |
310 SendReceiveResult(EMMFDevSoundProxyConfig, |
339 SendReceiveResult(EMMFDevSoundProxyConfig, |
311 iDestinationPckg, |
340 iDestinationPckg, |
312 KNullDesC8, |
341 KNullDesC8, |
313 pckg); |
342 pckg); |
|
343 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Config - Exit")); |
314 return pckg().iConfig; |
344 return pckg().iConfig; |
315 } |
345 } |
316 |
346 |
317 // ----------------------------------------------------------------------------- |
347 // ----------------------------------------------------------------------------- |
318 // RMMFDevSoundProxy::SetConfigL |
348 // RMMFDevSoundProxy::SetConfigL |
321 // ----------------------------------------------------------------------------- |
351 // ----------------------------------------------------------------------------- |
322 // |
352 // |
323 EXPORT_C void RMMFDevSoundProxy::SetConfigL( |
353 EXPORT_C void RMMFDevSoundProxy::SetConfigL( |
324 const TMMFCapabilities& aConfig ) |
354 const TMMFCapabilities& aConfig ) |
325 { |
355 { |
|
356 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetConfigL - Enter")); |
326 TInt err = KErrNone; |
357 TInt err = KErrNone; |
327 |
358 |
328 if (iState==EInitialized) |
359 if (iState==EInitialized) |
329 { |
360 { |
330 TMMFDevSoundProxySettings set; |
361 TMMFDevSoundProxySettings set; |
331 set.iConfig = aConfig; |
362 set.iConfig = aConfig; |
332 TMMFDevSoundProxySettingsPckg pckg(set); |
363 TMMFDevSoundProxySettingsPckg pckg(set); |
333 TInt err = SendReceive(EMMFDevSoundProxySetConfig, |
364 err = SendReceive(EMMFDevSoundProxySetConfig, |
334 iDestinationPckg, |
365 iDestinationPckg, |
335 pckg); |
366 pckg); |
336 User::LeaveIfError(err); |
|
337 } |
367 } |
338 else |
368 else |
339 { |
369 { |
340 RDebug::Print(_L("BRDBG:SetConfigCalledWhenNotInitialised")); // TODO Remove or redo as trace |
370 RDebug::Print(_L("BRDBG:SetConfigCalledWhenNotInitialised")); // TODO Remove or redo as trace |
341 err = KErrNotReady; |
371 err = KErrNotReady; |
342 } |
372 } |
343 |
373 SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::SetConfigL - Exit [%d]"), err); |
344 User::LeaveIfError(err); |
374 User::LeaveIfError(err); |
345 } |
375 } |
346 |
376 |
347 // ----------------------------------------------------------------------------- |
377 // ----------------------------------------------------------------------------- |
348 // RMMFDevSoundProxy::MaxVolume |
378 // RMMFDevSoundProxy::MaxVolume |
384 // (other items were commented in a header). |
418 // (other items were commented in a header). |
385 // ----------------------------------------------------------------------------- |
419 // ----------------------------------------------------------------------------- |
386 // |
420 // |
387 EXPORT_C TInt RMMFDevSoundProxy::SetVolume(TInt aVolume ) |
421 EXPORT_C TInt RMMFDevSoundProxy::SetVolume(TInt aVolume ) |
388 { |
422 { |
|
423 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetVolume - Enter")); |
389 TMMFDevSoundProxySettings set; |
424 TMMFDevSoundProxySettings set; |
390 set.iVolume = aVolume; |
425 set.iVolume = aVolume; |
391 TMMFDevSoundProxySettingsPckg pckg(set); |
426 TMMFDevSoundProxySettingsPckg pckg(set); |
392 return SendReceive(EMMFDevSoundProxySetVolume, |
427 TInt err = SendReceive(EMMFDevSoundProxySetVolume, |
393 iDestinationPckg, |
428 iDestinationPckg, |
394 pckg); |
429 pckg); |
|
430 SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::SetVolume - Exit [%d]"), err); |
|
431 return err; |
395 } |
432 } |
396 |
433 |
397 // ----------------------------------------------------------------------------- |
434 // ----------------------------------------------------------------------------- |
398 // RMMFDevSoundProxy::MaxGain |
435 // RMMFDevSoundProxy::MaxGain |
399 // Returns maximum gain supported by DevSound server for recording. |
436 // Returns maximum gain supported by DevSound server for recording. |
400 // (other items were commented in a header). |
437 // (other items were commented in a header). |
401 // ----------------------------------------------------------------------------- |
438 // ----------------------------------------------------------------------------- |
402 // |
439 // |
403 EXPORT_C TInt RMMFDevSoundProxy::MaxGain() |
440 EXPORT_C TInt RMMFDevSoundProxy::MaxGain() |
404 { |
441 { |
|
442 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::MaxGain - Enter")); |
405 TMMFDevSoundProxySettings set; |
443 TMMFDevSoundProxySettings set; |
406 TMMFDevSoundProxySettingsPckg pckg(set); |
444 TMMFDevSoundProxySettingsPckg pckg(set); |
407 SendReceiveResult(EMMFDevSoundProxyMaxGain, |
445 SendReceiveResult(EMMFDevSoundProxyMaxGain, |
408 iDestinationPckg, |
446 iDestinationPckg, |
409 KNullDesC8, |
447 KNullDesC8, |
410 pckg); |
448 pckg); |
|
449 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::MaxGain - Exit")); |
411 return pckg().iMaxGain; |
450 return pckg().iMaxGain; |
412 } |
451 } |
413 |
452 |
414 // ----------------------------------------------------------------------------- |
453 // ----------------------------------------------------------------------------- |
415 // RMMFDevSoundProxy::Gain |
454 // RMMFDevSoundProxy::Gain |
473 // |
520 // |
474 EXPORT_C void RMMFDevSoundProxy::SetPlayBalanceL( |
521 EXPORT_C void RMMFDevSoundProxy::SetPlayBalanceL( |
475 TInt aLeftPercentage, |
522 TInt aLeftPercentage, |
476 TInt aRightPercentage ) |
523 TInt aRightPercentage ) |
477 { |
524 { |
|
525 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetPlayBalanceL - Enter")); |
478 TMMFDevSoundProxySettings set; |
526 TMMFDevSoundProxySettings set; |
479 set.iLeftPercentage = aLeftPercentage; |
527 set.iLeftPercentage = aLeftPercentage; |
480 set.iRightPercentage = aRightPercentage; |
528 set.iRightPercentage = aRightPercentage; |
481 TMMFDevSoundProxySettingsPckg pckg(set); |
529 TMMFDevSoundProxySettingsPckg pckg(set); |
482 User::LeaveIfError(SendReceive(EMMFDevSoundProxySetPlayBalance, |
530 User::LeaveIfError(SendReceive(EMMFDevSoundProxySetPlayBalance, |
483 iDestinationPckg, |
531 iDestinationPckg, |
484 pckg)); |
532 pckg)); |
|
533 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetPlayBalanceL - Exit")); |
485 } |
534 } |
486 |
535 |
487 // ----------------------------------------------------------------------------- |
536 // ----------------------------------------------------------------------------- |
488 // RMMFDevSoundProxy::GetRecordBalanceL |
537 // RMMFDevSoundProxy::GetRecordBalanceL |
489 // Returns record balance. |
538 // Returns record balance. |
492 // |
541 // |
493 EXPORT_C void RMMFDevSoundProxy::GetRecordBalanceL( |
542 EXPORT_C void RMMFDevSoundProxy::GetRecordBalanceL( |
494 TInt& aLeftPercentage, |
543 TInt& aLeftPercentage, |
495 TInt& aRightPercentage ) |
544 TInt& aRightPercentage ) |
496 { |
545 { |
|
546 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::GetRecordBalanceL - Enter")); |
497 TMMFDevSoundProxySettings set; |
547 TMMFDevSoundProxySettings set; |
498 TMMFDevSoundProxySettingsPckg pckg(set); |
548 TMMFDevSoundProxySettingsPckg pckg(set); |
499 User::LeaveIfError(SendReceiveResult(EMMFDevSoundProxyRecordBalance, |
549 User::LeaveIfError(SendReceiveResult(EMMFDevSoundProxyRecordBalance, |
500 iDestinationPckg, |
550 iDestinationPckg, |
501 KNullDesC8, |
551 KNullDesC8, |
502 pckg)); |
552 pckg)); |
503 aLeftPercentage = pckg().iLeftPercentage; |
553 aLeftPercentage = pckg().iLeftPercentage; |
504 aRightPercentage = pckg().iRightPercentage; |
554 aRightPercentage = pckg().iRightPercentage; |
|
555 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::GetRecordBalanceL - Exit")); |
505 } |
556 } |
506 |
557 |
507 // ----------------------------------------------------------------------------- |
558 // ----------------------------------------------------------------------------- |
508 // RMMFDevSoundProxy::SetRecordBalanceL |
559 // RMMFDevSoundProxy::SetRecordBalanceL |
509 // Sets record balance. |
560 // Sets record balance. |
512 // |
563 // |
513 EXPORT_C void RMMFDevSoundProxy::SetRecordBalanceL( |
564 EXPORT_C void RMMFDevSoundProxy::SetRecordBalanceL( |
514 TInt aLeftPercentage, |
565 TInt aLeftPercentage, |
515 TInt aRightPercentage ) |
566 TInt aRightPercentage ) |
516 { |
567 { |
|
568 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetRecordBalanceL - Enter")); |
517 TMMFDevSoundProxySettings set; |
569 TMMFDevSoundProxySettings set; |
518 set.iLeftPercentage = aLeftPercentage; |
570 set.iLeftPercentage = aLeftPercentage; |
519 set.iRightPercentage = aRightPercentage; |
571 set.iRightPercentage = aRightPercentage; |
520 TMMFDevSoundProxySettingsPckg pckg(set); |
572 TMMFDevSoundProxySettingsPckg pckg(set); |
521 User::LeaveIfError(SendReceive(EMMFDevSoundProxySetRecordBalance, |
573 User::LeaveIfError(SendReceive(EMMFDevSoundProxySetRecordBalance, |
522 iDestinationPckg, |
574 iDestinationPckg, |
523 pckg)); |
575 pckg)); |
|
576 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetRecordBalanceL - Exit")); |
524 } |
577 } |
525 |
578 |
526 // ----------------------------------------------------------------------------- |
579 // ----------------------------------------------------------------------------- |
527 // RMMFDevSoundProxy::PlayInitL |
580 // RMMFDevSoundProxy::PlayInitL |
528 // Initilaizes DevSound to play digital audio and starts the play process. |
581 // Initilaizes DevSound to play digital audio and starts the play process. |
529 // (other items were commented in a header). |
582 // (other items were commented in a header). |
530 // ----------------------------------------------------------------------------- |
583 // ----------------------------------------------------------------------------- |
531 // |
584 // |
532 EXPORT_C void RMMFDevSoundProxy::PlayInitL() |
585 EXPORT_C void RMMFDevSoundProxy::PlayInitL() |
533 { |
586 { |
|
587 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayInitL - Enter")); |
534 if (!iDevSoundObserver || iState!=EInitialized) |
588 if (!iDevSoundObserver || iState!=EInitialized) |
535 { |
589 { |
536 if (iState == EPlaying || iState == EPlayingBufferWait) |
590 if (iState == EPlaying || iState == EPlayingBufferWait) |
537 { |
591 { |
538 // treat PlayInitL() during play as Resume() |
592 // treat PlayInitL() during play as Resume() |
539 User::LeaveIfError(Resume()); |
593 User::LeaveIfError(Resume()); |
|
594 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayInitL - Exit")); |
540 return; |
595 return; |
541 } |
596 } |
542 User::Leave(KErrNotReady); |
597 User::Leave(KErrNotReady); |
543 } |
598 } |
544 |
599 |
545 User::LeaveIfError(SendReceive(EMMFDevSoundProxyPlayInit, |
600 User::LeaveIfError(SendReceive(EMMFDevSoundProxyPlayInit, |
546 iDestinationPckg)); |
601 iDestinationPckg)); |
547 iState = EPlaying; |
602 iState = EPlaying; |
|
603 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayInitL - Exit")); |
548 } |
604 } |
549 |
605 |
550 // ----------------------------------------------------------------------------- |
606 // ----------------------------------------------------------------------------- |
551 // RMMFDevSoundProxy::RecordInitL |
607 // RMMFDevSoundProxy::RecordInitL |
552 // Initilaizes DevSound to record digital audio and starts the record process. |
608 // Initilaizes DevSound to record digital audio and starts the record process. |
553 // (other items were commented in a header). |
609 // (other items were commented in a header). |
554 // ----------------------------------------------------------------------------- |
610 // ----------------------------------------------------------------------------- |
555 // |
611 // |
556 EXPORT_C void RMMFDevSoundProxy::RecordInitL() |
612 EXPORT_C void RMMFDevSoundProxy::RecordInitL() |
557 { |
613 { |
|
614 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::RecordInitL - Enter")); |
558 if (!iDevSoundObserver || iState!=EInitialized) |
615 if (!iDevSoundObserver || iState!=EInitialized) |
559 { |
616 { |
560 if(iState == ERecording || iState == ERecordingBufferWait || iState == ERecordingInLastBufferCycle |
617 if(iState == ERecording || iState == ERecordingBufferWait || iState == ERecordingInLastBufferCycle |
561 || iState == ERecordingResumingInLastBufferCycle) |
618 || iState == ERecordingResumingInLastBufferCycle) |
562 { |
619 { |
563 // treat RecordInitL() during record as Resume() |
620 // treat RecordInitL() during record as Resume() |
564 User::LeaveIfError(Resume()); |
621 User::LeaveIfError(Resume()); |
|
622 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::RecordInitL - Exit")); |
565 return; |
623 return; |
566 } |
624 } |
567 User::Leave(KErrNotReady); |
625 User::Leave(KErrNotReady); |
568 } |
626 } |
569 |
627 |
570 User::LeaveIfError(SendReceive(EMMFDevSoundProxyRecordInit, |
628 User::LeaveIfError(SendReceive(EMMFDevSoundProxyRecordInit, |
571 iDestinationPckg)); |
629 iDestinationPckg)); |
572 iState = ERecording; |
630 iState = ERecording; |
|
631 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::RecordInitL - Exit")); |
573 } |
632 } |
574 |
633 |
575 // ----------------------------------------------------------------------------- |
634 // ----------------------------------------------------------------------------- |
576 // RMMFDevSoundProxy::PlayData |
635 // RMMFDevSoundProxy::PlayData |
577 // Plays the data in the buffer at the current volume. |
636 // Plays the data in the buffer at the current volume. |
578 // (other items were commented in a header). |
637 // (other items were commented in a header). |
579 // ----------------------------------------------------------------------------- |
638 // ----------------------------------------------------------------------------- |
580 // |
639 // |
581 EXPORT_C void RMMFDevSoundProxy::PlayData() |
640 EXPORT_C void RMMFDevSoundProxy::PlayData() |
582 { |
641 { |
|
642 //SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayData - Enter")); //Uncommenting this will produce a lot of logging! |
583 __ASSERT_ALWAYS(iState == EPlaying || iState == EPlayingBufferWait, |
643 __ASSERT_ALWAYS(iState == EPlaying || iState == EPlayingBufferWait, |
584 Panic(EMMFDevSoundProxyPlayDataWithoutInitialize)); |
644 Panic(EMMFDevSoundProxyPlayDataWithoutInitialize)); |
585 ASSERT(iDevSoundObserver); |
645 ASSERT(iDevSoundObserver); |
586 SYMBIAN_CHECK( iState == EPlayingBufferWait, |
646 SYMBIAN_CHECK( iState == EPlayingBufferWait, |
587 Panic(EMMFDevSoundProxyPlayDataInWrongState)); |
647 Panic(EMMFDevSoundProxyPlayDataInWrongState)); |
590 set.iBufferSize = iBuffer->Data().Size(); |
650 set.iBufferSize = iBuffer->Data().Size(); |
591 TMMFDevSoundProxyHwBufPckg pckg(set); |
651 TMMFDevSoundProxyHwBufPckg pckg(set); |
592 |
652 |
593 SendReceive(EMMFDevSoundProxyPlayData, iDestinationPckg, pckg); |
653 SendReceive(EMMFDevSoundProxyPlayData, iDestinationPckg, pckg); |
594 iState = EPlaying; |
654 iState = EPlaying; |
|
655 //SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayData - Exit")); //Uncommenting this will produce a lot of logging! |
595 } |
656 } |
596 |
657 |
597 // ----------------------------------------------------------------------------- |
658 // ----------------------------------------------------------------------------- |
598 // RMMFDevSoundProxy::RecordData |
659 // RMMFDevSoundProxy::RecordData |
599 // Signals the device to continue recording. |
660 // Signals the device to continue recording. |
600 // (other items were commented in a header). |
661 // (other items were commented in a header). |
601 // ----------------------------------------------------------------------------- |
662 // ----------------------------------------------------------------------------- |
602 // |
663 // |
603 EXPORT_C void RMMFDevSoundProxy::RecordData() |
664 EXPORT_C void RMMFDevSoundProxy::RecordData() |
604 { |
665 { |
|
666 //SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::RecordData - Enter")); //Uncommenting this will produce a lot of logging! |
605 __ASSERT_ALWAYS(iState == ERecording || iState == ERecordingBufferWait || |
667 __ASSERT_ALWAYS(iState == ERecording || iState == ERecordingBufferWait || |
606 iState == ERecordingInLastBufferCycle || iState == ERecordingResumingInLastBufferCycle, |
668 iState == ERecordingInLastBufferCycle || iState == ERecordingResumingInLastBufferCycle, |
607 Panic(EMMFDevSoundProxyRecordDataWithoutInitialize)); |
669 Panic(EMMFDevSoundProxyRecordDataWithoutInitialize)); |
608 ASSERT(iDevSoundObserver); |
670 ASSERT(iDevSoundObserver); |
609 SYMBIAN_CHECK(iState == ERecordingBufferWait || iState == ERecordingInLastBufferCycle || |
671 SYMBIAN_CHECK(iState == ERecordingBufferWait || iState == ERecordingInLastBufferCycle || |
624 // this is a RecordData() following a Resume() in the last cycle. This is where we do the resume! |
686 // this is a RecordData() following a Resume() in the last cycle. This is where we do the resume! |
625 SendReceive(EMMFDevSoundProxyResume, iDestinationPckg); // note ignore any error |
687 SendReceive(EMMFDevSoundProxyResume, iDestinationPckg); // note ignore any error |
626 iState = ERecording; |
688 iState = ERecording; |
627 break; |
689 break; |
628 } |
690 } |
|
691 //SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::RecordData - Exit")); //Uncommenting this will produce a lot of logging! |
629 } |
692 } |
630 |
693 |
631 // ----------------------------------------------------------------------------- |
694 // ----------------------------------------------------------------------------- |
632 // RMMFDevSoundProxy::Stop |
695 // RMMFDevSoundProxy::Stop |
633 // Stops the ongoing opeartion. |
696 // Stops the ongoing opeartion. |
634 // (other items were commented in a header). |
697 // (other items were commented in a header). |
635 // ----------------------------------------------------------------------------- |
698 // ----------------------------------------------------------------------------- |
636 // |
699 // |
637 EXPORT_C void RMMFDevSoundProxy::Stop() |
700 EXPORT_C void RMMFDevSoundProxy::Stop() |
638 { |
701 { |
|
702 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Stop - Enter")); |
639 if (iState > EInitialized) |
703 if (iState > EInitialized) |
640 { |
704 { |
641 SendReceive(EMMFDevSoundProxyStop, iDestinationPckg); |
705 SendReceive(EMMFDevSoundProxyStop, iDestinationPckg); |
642 iState = EInitialized; |
706 iState = EInitialized; |
643 iMsgQueueHandler->Finish(); // will delete the buffer |
707 iMsgQueueHandler->Finish(); // will delete the buffer |
644 } |
708 } |
|
709 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Stop - Exit")); |
645 } |
710 } |
646 |
711 |
647 // ----------------------------------------------------------------------------- |
712 // ----------------------------------------------------------------------------- |
648 // RMMFDevSoundProxy::Pause |
713 // RMMFDevSoundProxy::Pause |
649 // Temporarily stops the ongoing operation. |
714 // Temporarily stops the ongoing operation. |
650 // (other items were commented in a header). |
715 // (other items were commented in a header). |
651 // ----------------------------------------------------------------------------- |
716 // ----------------------------------------------------------------------------- |
652 // |
717 // |
653 EXPORT_C void RMMFDevSoundProxy::Pause() |
718 EXPORT_C void RMMFDevSoundProxy::Pause() |
654 { |
719 { |
|
720 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Pause - Enter")); |
655 if(iState > EInitialized) |
721 if(iState > EInitialized) |
656 { |
722 { |
657 SendReceive(EMMFDevSoundProxyPause, iDestinationPckg); |
723 SendReceive(EMMFDevSoundProxyPause, iDestinationPckg); |
658 } |
724 } |
|
725 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Pause - Exit")); |
659 } |
726 } |
660 |
727 |
661 // ----------------------------------------------------------------------------- |
728 // ----------------------------------------------------------------------------- |
662 // RMMFDevSoundProxy::PlayToneL |
729 // RMMFDevSoundProxy::PlayToneL |
663 // Plays the simple tone. |
730 // Plays the simple tone. |
716 set.iDuration = aDuration; |
788 set.iDuration = aDuration; |
717 TMMFDevSoundProxySettingsPckg pckg(set); |
789 TMMFDevSoundProxySettingsPckg pckg(set); |
718 User::LeaveIfError(SendReceive(EMMFDevSoundProxyPlayDualTone, iDestinationPckg, pckg)); |
790 User::LeaveIfError(SendReceive(EMMFDevSoundProxyPlayDualTone, iDestinationPckg, pckg)); |
719 iState = ETonePlaying; |
791 iState = ETonePlaying; |
720 iToneMode = EDual; |
792 iToneMode = EDual; |
|
793 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayDualToneL - Exit")); |
721 } |
794 } |
722 |
795 |
723 // ----------------------------------------------------------------------------- |
796 // ----------------------------------------------------------------------------- |
724 // RMMFDevSoundProxy::PlayDTMFStringL |
797 // RMMFDevSoundProxy::PlayDTMFStringL |
725 // Plays the DTMF string. |
798 // Plays the DTMF string. |
726 // (other items were commented in a header). |
799 // (other items were commented in a header). |
727 // ----------------------------------------------------------------------------- |
800 // ----------------------------------------------------------------------------- |
728 // |
801 // |
729 EXPORT_C void RMMFDevSoundProxy::PlayDTMFStringL(const TDesC& aDTMFString) |
802 EXPORT_C void RMMFDevSoundProxy::PlayDTMFStringL(const TDesC& aDTMFString) |
730 { |
803 { |
|
804 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayDTMFStringL - Enter")); |
731 if(iState==ETonePlaying) |
805 if(iState==ETonePlaying) |
732 { |
806 { |
|
807 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayDTMFStringL - Exit")); |
733 return; |
808 return; |
734 } |
809 } |
735 |
810 |
736 if (!iDevSoundObserver || iState!=EInitialized) |
811 if (!iDevSoundObserver || iState!=EInitialized) |
737 { |
812 { |
772 User::LeaveIfError(SendReceive(EMMFDevSoundProxyPlayToneSequence, |
850 User::LeaveIfError(SendReceive(EMMFDevSoundProxyPlayToneSequence, |
773 iDestinationPckg, |
851 iDestinationPckg, |
774 aData)); |
852 aData)); |
775 iState = ETonePlaying; |
853 iState = ETonePlaying; |
776 iToneMode = ESequence; |
854 iToneMode = ESequence; |
|
855 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayToneSequenceL - Exit")); |
777 } |
856 } |
778 |
857 |
779 // ----------------------------------------------------------------------------- |
858 // ----------------------------------------------------------------------------- |
780 // RMMFDevSoundProxy::PlayFixedSequenceL |
859 // RMMFDevSoundProxy::PlayFixedSequenceL |
781 // Plays the fixed sequence. |
860 // Plays the fixed sequence. |
782 // (other items were commented in a header). |
861 // (other items were commented in a header). |
783 // ----------------------------------------------------------------------------- |
862 // ----------------------------------------------------------------------------- |
784 // |
863 // |
785 EXPORT_C void RMMFDevSoundProxy::PlayFixedSequenceL(TInt aSequenceNumber) |
864 EXPORT_C void RMMFDevSoundProxy::PlayFixedSequenceL(TInt aSequenceNumber) |
786 { |
865 { |
|
866 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayFixedSequenceL - Enter")); |
787 if(iState==ETonePlaying) |
867 if(iState==ETonePlaying) |
788 { |
868 { |
|
869 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::PlayFixedSequenceL - Exit")); |
789 return; |
870 return; |
790 } |
871 } |
791 |
872 |
792 if (!iDevSoundObserver || iState!=EInitialized) |
873 if (!iDevSoundObserver || iState!=EInitialized) |
793 { |
874 { |
809 EXPORT_C void RMMFDevSoundProxy::SetDTMFLengths( |
891 EXPORT_C void RMMFDevSoundProxy::SetDTMFLengths( |
810 TTimeIntervalMicroSeconds32& aToneOnLength, |
892 TTimeIntervalMicroSeconds32& aToneOnLength, |
811 TTimeIntervalMicroSeconds32& aToneOffLength, |
893 TTimeIntervalMicroSeconds32& aToneOffLength, |
812 TTimeIntervalMicroSeconds32& aPauseLength ) |
894 TTimeIntervalMicroSeconds32& aPauseLength ) |
813 { |
895 { |
|
896 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetDTMFLengths - Enter")); |
814 TMMFDevSoundProxySettings set; |
897 TMMFDevSoundProxySettings set; |
815 set.iToneOnLength = aToneOnLength; |
898 set.iToneOnLength = aToneOnLength; |
816 set.iToneOffLength = aToneOffLength; |
899 set.iToneOffLength = aToneOffLength; |
817 set.iPauseLength = aPauseLength; |
900 set.iPauseLength = aPauseLength; |
818 TMMFDevSoundProxySettingsPckg pckg(set); |
901 TMMFDevSoundProxySettingsPckg pckg(set); |
819 SendReceive(EMMFDevSoundProxySetDTMFLengths, iDestinationPckg, pckg); |
902 SendReceive(EMMFDevSoundProxySetDTMFLengths, iDestinationPckg, pckg); |
|
903 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetDTMFLengths - Exit")); |
820 } |
904 } |
821 |
905 |
822 // ----------------------------------------------------------------------------- |
906 // ----------------------------------------------------------------------------- |
823 // RMMFDevSoundProxy::SetVolumeRamp |
907 // RMMFDevSoundProxy::SetVolumeRamp |
824 // Sets the volume ramp duration. |
908 // Sets the volume ramp duration. |
826 // ----------------------------------------------------------------------------- |
910 // ----------------------------------------------------------------------------- |
827 // |
911 // |
828 EXPORT_C void RMMFDevSoundProxy::SetVolumeRamp( |
912 EXPORT_C void RMMFDevSoundProxy::SetVolumeRamp( |
829 const TTimeIntervalMicroSeconds& aRampDuration) |
913 const TTimeIntervalMicroSeconds& aRampDuration) |
830 { |
914 { |
|
915 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetVolumeRamp - Enter")); |
831 TMMFDevSoundProxySettings set; |
916 TMMFDevSoundProxySettings set; |
832 set.iDuration = aRampDuration; |
917 set.iDuration = aRampDuration; |
833 TMMFDevSoundProxySettingsPckg pckg(set); |
918 TMMFDevSoundProxySettingsPckg pckg(set); |
834 SendReceive(EMMFDevSoundProxySetVolumeRamp, iDestinationPckg, pckg); |
919 SendReceive(EMMFDevSoundProxySetVolumeRamp, iDestinationPckg, pckg); |
|
920 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetVolumeRamp - Exit")); |
835 } |
921 } |
836 |
922 |
837 // ----------------------------------------------------------------------------- |
923 // ----------------------------------------------------------------------------- |
838 // RMMFDevSoundProxy::GetSupportedInputDataTypesL |
924 // RMMFDevSoundProxy::GetSupportedInputDataTypesL |
839 // Returns supported datatypes for playing audio. |
925 // Returns supported datatypes for playing audio. |
931 User::Leave(err); |
1022 User::Leave(err); |
932 } |
1023 } |
933 } |
1024 } |
934 CleanupStack::PopAndDestroy(&stream); |
1025 CleanupStack::PopAndDestroy(&stream); |
935 CleanupStack::PopAndDestroy(buf); |
1026 CleanupStack::PopAndDestroy(buf); |
|
1027 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::GetSupportedOutputDataTypesL - Exit 2")); |
936 } |
1028 } |
937 |
1029 |
938 // ----------------------------------------------------------------------------- |
1030 // ----------------------------------------------------------------------------- |
939 // RMMFDevSoundProxy::SamplesRecorded |
1031 // RMMFDevSoundProxy::SamplesRecorded |
940 // Returns samples recorded so far. |
1032 // Returns samples recorded so far. |
941 // (other items were commented in a header). |
1033 // (other items were commented in a header). |
942 // ----------------------------------------------------------------------------- |
1034 // ----------------------------------------------------------------------------- |
943 // |
1035 // |
944 EXPORT_C TInt RMMFDevSoundProxy::SamplesRecorded() |
1036 EXPORT_C TInt RMMFDevSoundProxy::SamplesRecorded() |
945 { |
1037 { |
|
1038 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SamplesRecorded - Enter")); |
946 TPckgBuf<TInt> numSamples; |
1039 TPckgBuf<TInt> numSamples; |
947 SendReceiveResult(EMMFDevSoundProxySamplesRecorded, |
1040 SendReceiveResult(EMMFDevSoundProxySamplesRecorded, |
948 iDestinationPckg, |
1041 iDestinationPckg, |
949 KNullDesC8, |
1042 KNullDesC8, |
950 numSamples); |
1043 numSamples); |
951 |
1044 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SamplesRecorded - Exit")); |
952 return numSamples(); |
1045 return numSamples(); |
953 } |
1046 } |
954 |
1047 |
955 // ----------------------------------------------------------------------------- |
1048 // ----------------------------------------------------------------------------- |
956 // RMMFDevSoundProxy::SamplesPlayed |
1049 // RMMFDevSoundProxy::SamplesPlayed |
994 // ----------------------------------------------------------------------------- |
1091 // ----------------------------------------------------------------------------- |
995 // |
1092 // |
996 EXPORT_C void RMMFDevSoundProxy::SetPrioritySettings( |
1093 EXPORT_C void RMMFDevSoundProxy::SetPrioritySettings( |
997 const TMMFPrioritySettings& aPrioritySettings) |
1094 const TMMFPrioritySettings& aPrioritySettings) |
998 { |
1095 { |
|
1096 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetPrioritySettings - Enter")); |
999 TPckgBuf<TMMFPrioritySettings> prioritySet(aPrioritySettings); |
1097 TPckgBuf<TMMFPrioritySettings> prioritySet(aPrioritySettings); |
1000 SendReceive(EMMFDevSoundProxySetPrioritySettings, |
1098 SendReceive(EMMFDevSoundProxySetPrioritySettings, |
1001 iDestinationPckg, |
1099 iDestinationPckg, |
1002 prioritySet); |
1100 prioritySet); |
|
1101 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SetPrioritySettings - Exit")); |
1003 } |
1102 } |
1004 |
1103 |
1005 // ----------------------------------------------------------------------------- |
1104 // ----------------------------------------------------------------------------- |
1006 // RMMFDevSoundProxy::FixedSequenceName |
1105 // RMMFDevSoundProxy::FixedSequenceName |
1007 // Returns the name of fixed sequence for a given sequence number. |
1106 // Returns the name of fixed sequence for a given sequence number. |
1008 // (other items were commented in a header). |
1107 // (other items were commented in a header). |
1009 // ----------------------------------------------------------------------------- |
1108 // ----------------------------------------------------------------------------- |
1010 // |
1109 // |
1011 EXPORT_C const TDesC& RMMFDevSoundProxy::FixedSequenceName(TInt /*aSequenceNumber*/) |
1110 EXPORT_C const TDesC& RMMFDevSoundProxy::FixedSequenceName(TInt /*aSequenceNumber*/) |
1012 { |
1111 { |
|
1112 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::FixedSequenceName - Enter")); |
1013 _LIT(KNullDesC, ""); |
1113 _LIT(KNullDesC, ""); |
|
1114 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::FixedSequenceName - Exit")); |
1014 return KNullDesC; |
1115 return KNullDesC; |
1015 } |
1116 } |
1016 |
1117 |
1017 // ----------------------------------------------------------------------------- |
1118 // ----------------------------------------------------------------------------- |
1018 // RMMFDevSoundProxy::CustomInterface |
1119 // RMMFDevSoundProxy::CustomInterface |
1020 // (other items were commented in a header). |
1121 // (other items were commented in a header). |
1021 // ----------------------------------------------------------------------------- |
1122 // ----------------------------------------------------------------------------- |
1022 // |
1123 // |
1023 EXPORT_C TAny* RMMFDevSoundProxy::CustomInterface(TUid aInterfaceId) |
1124 EXPORT_C TAny* RMMFDevSoundProxy::CustomInterface(TUid aInterfaceId) |
1024 { |
1125 { |
|
1126 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::CustomInterface - Enter")); |
1025 TMMFDevSoundProxySettings set; |
1127 TMMFDevSoundProxySettings set; |
1026 set.iInterface = aInterfaceId; |
1128 set.iInterface = aInterfaceId; |
1027 // Added for ask for custom interface |
1129 // Added for ask for custom interface |
1028 TAny* customInterface = NULL; |
1130 TAny* customInterface = NULL; |
1029 if (aInterfaceId == KMmfUidDevSoundCancelInitializeCustomInterface) |
1131 if (aInterfaceId == KMmfUidDevSoundCancelInitializeCustomInterface) |
1030 { |
1132 { |
1031 MMMFDevSoundCancelInitialize* result = this; |
1133 MMMFDevSoundCancelInitialize* result = this; |
|
1134 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::CustomInterface - Exit")); |
1032 return result; |
1135 return result; |
1033 } |
1136 } |
1034 TPckgBuf<TAny*> pckg2(customInterface); |
1137 TPckgBuf<TAny*> pckg2(customInterface); |
1035 |
1138 |
1036 TMMFDevSoundProxySettingsPckg pckg(set); |
1139 TMMFDevSoundProxySettingsPckg pckg(set); |
1037 SendReceiveResult(EMMFDevSoundProxyCustomInterface, |
1140 SendReceiveResult(EMMFDevSoundProxyCustomInterface, |
1038 iDestinationPckg, |
1141 iDestinationPckg, |
1039 pckg, pckg2); |
1142 pckg, pckg2); |
|
1143 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::CustomInterface - Exit")); |
1040 return reinterpret_cast<TAny*> (customInterface); |
1144 return reinterpret_cast<TAny*> (customInterface); |
1041 } |
1145 } |
1042 |
1146 |
1043 // ----------------------------------------------------------------------------- |
1147 // ----------------------------------------------------------------------------- |
1044 // RMMFDevSoundProxy::FixedSequenceCount |
1148 // RMMFDevSoundProxy::FixedSequenceCount |
1064 // ----------------------------------------------------------------------------- |
1169 // ----------------------------------------------------------------------------- |
1065 // |
1170 // |
1066 EXPORT_C TInt RMMFDevSoundProxy::BufferToBeFilledData( |
1171 EXPORT_C TInt RMMFDevSoundProxy::BufferToBeFilledData( |
1067 TBool aRequestChunk, TMMFDevSoundProxyHwBufPckg& aSetPckg) |
1172 TBool aRequestChunk, TMMFDevSoundProxyHwBufPckg& aSetPckg) |
1068 { |
1173 { |
|
1174 //SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::BufferToBeFilledData - Enter")); //Uncommenting this will produce a lot of logging! |
1069 // Note that there will only ever be one of these requests outstanding |
1175 // Note that there will only ever be one of these requests outstanding |
1070 // per session |
1176 // per session |
1071 TPckgBuf<TInt> requestChunkBuf (aRequestChunk); |
1177 TPckgBuf<TInt> requestChunkBuf (aRequestChunk); |
1072 return SendReceiveResult(EMMFDevSoundProxyBTBFData, |
1178 TInt err = SendReceiveResult(EMMFDevSoundProxyBTBFData, |
1073 iDestinationPckg, |
1179 iDestinationPckg, |
1074 requestChunkBuf, |
1180 requestChunkBuf, |
1075 aSetPckg); |
1181 aSetPckg); |
|
1182 //SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::BufferToBeFilledData - Exit [%d]"), err); //Uncommenting this will produce a lot of logging! |
|
1183 return err; |
1076 } |
1184 } |
1077 |
1185 |
1078 // ----------------------------------------------------------------------------- |
1186 // ----------------------------------------------------------------------------- |
1079 // RMMFDevSoundProxy::BufferToBeEmptiedData |
1187 // RMMFDevSoundProxy::BufferToBeEmptiedData |
1080 // Returns data buffer for recording. |
1188 // Returns data buffer for recording. |
1081 // ----------------------------------------------------------------------------- |
1189 // ----------------------------------------------------------------------------- |
1082 // |
1190 // |
1083 EXPORT_C TInt RMMFDevSoundProxy::BufferToBeEmptiedData( |
1191 EXPORT_C TInt RMMFDevSoundProxy::BufferToBeEmptiedData( |
1084 TMMFDevSoundProxyHwBufPckg& aSetPckg) |
1192 TMMFDevSoundProxyHwBufPckg& aSetPckg) |
1085 { |
1193 { |
|
1194 //SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::BufferToBeEmptiedData - Enter")); //Uncommenting this will produce a lot of logging! |
1086 // Note that there will only ever be one of these requests outstanding |
1195 // Note that there will only ever be one of these requests outstanding |
1087 // per session |
1196 // per session |
1088 return SendReceiveResult(EMMFDevSoundProxyBTBEData, |
1197 TInt err = SendReceiveResult(EMMFDevSoundProxyBTBEData, |
1089 iDestinationPckg, |
1198 iDestinationPckg, |
1090 KNullDesC8, |
1199 KNullDesC8, |
1091 aSetPckg); |
1200 aSetPckg); |
|
1201 //SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::BufferToBeEmptiedData - Exit [%d]"), err); //Uncommenting this will produce a lot of logging! |
|
1202 return err; |
1092 } |
1203 } |
1093 |
1204 |
1094 // ----------------------------------------------------------------------------- |
1205 // ----------------------------------------------------------------------------- |
1095 // RMMFDevSoundProxy::RegisterAsClient |
1206 // RMMFDevSoundProxy::RegisterAsClient |
1096 // Registers the client for notification of resource avalibility. |
1207 // Registers the client for notification of resource avalibility. |
1097 // ----------------------------------------------------------------------------- |
1208 // ----------------------------------------------------------------------------- |
1098 // |
1209 // |
1099 EXPORT_C TInt RMMFDevSoundProxy::RegisterAsClient(TUid aEventType, const TDesC8& aNotificationRegistrationData) |
1210 EXPORT_C TInt RMMFDevSoundProxy::RegisterAsClient(TUid aEventType, const TDesC8& aNotificationRegistrationData) |
1100 { |
1211 { |
|
1212 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::RegisterAsClient - Enter")); |
1101 TMMFDevSoundProxySettings set; |
1213 TMMFDevSoundProxySettings set; |
1102 set.iNotificationEventUid = aEventType; |
1214 set.iNotificationEventUid = aEventType; |
1103 TMMFDevSoundProxySettingsPckg pckg(set); |
1215 TMMFDevSoundProxySettingsPckg pckg(set); |
1104 return SendReceive(EMMFDevSoundProxyRequestResourceNotification, iDestinationPckg, pckg, aNotificationRegistrationData); |
1216 TInt err = SendReceive(EMMFDevSoundProxyRequestResourceNotification, iDestinationPckg, pckg, aNotificationRegistrationData); |
|
1217 SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::RegisterAsClient - Exit [%d]"), err); |
|
1218 return err; |
1105 } |
1219 } |
1106 |
1220 |
1107 // ----------------------------------------------------------------------------- |
1221 // ----------------------------------------------------------------------------- |
1108 // RMMFDevSoundProxy::CancelRegisterAsClient |
1222 // RMMFDevSoundProxy::CancelRegisterAsClient |
1109 // Cancels the Registered Notification. |
1223 // Cancels the Registered Notification. |
1110 // ----------------------------------------------------------------------------- |
1224 // ----------------------------------------------------------------------------- |
1111 // |
1225 // |
1112 EXPORT_C TInt RMMFDevSoundProxy::CancelRegisterAsClient(TUid aEventType) |
1226 EXPORT_C TInt RMMFDevSoundProxy::CancelRegisterAsClient(TUid aEventType) |
1113 { |
1227 { |
|
1228 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::CancelRegisterAsClient - Enter")); |
1114 TMMFDevSoundProxySettings set; |
1229 TMMFDevSoundProxySettings set; |
1115 set.iNotificationEventUid = aEventType; |
1230 set.iNotificationEventUid = aEventType; |
1116 TMMFDevSoundProxySettingsPckg pckg(set); |
1231 TMMFDevSoundProxySettingsPckg pckg(set); |
1117 return SendReceiveResult(EMMFDevSoundProxyCancelRequestResourceNotification, iDestinationPckg, KNullDesC8, pckg); |
1232 TInt err = SendReceiveResult(EMMFDevSoundProxyCancelRequestResourceNotification, iDestinationPckg, KNullDesC8, pckg); |
|
1233 SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::CancelRegisterAsClient - Exit [%d]"), err); |
|
1234 return err; |
1118 } |
1235 } |
1119 |
1236 |
1120 // ----------------------------------------------------------------------------- |
1237 // ----------------------------------------------------------------------------- |
1121 // RMMFDevSoundProxy::GetResourceNotificationData |
1238 // RMMFDevSoundProxy::GetResourceNotificationData |
1122 // Returns the Notification data which the client needs to resume playing. |
1239 // Returns the Notification data which the client needs to resume playing. |
1123 // ----------------------------------------------------------------------------- |
1240 // ----------------------------------------------------------------------------- |
1124 // |
1241 // |
1125 EXPORT_C TInt RMMFDevSoundProxy::GetResourceNotificationData(TUid aEventType, TDes8& aNotificationData) |
1242 EXPORT_C TInt RMMFDevSoundProxy::GetResourceNotificationData(TUid aEventType, TDes8& aNotificationData) |
1126 { |
1243 { |
|
1244 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::GetResourceNotificationData - Enter")); |
1127 TMMFDevSoundProxySettings set; |
1245 TMMFDevSoundProxySettings set; |
1128 set.iNotificationEventUid = aEventType; |
1246 set.iNotificationEventUid = aEventType; |
1129 TMMFDevSoundProxySettingsPckg pckg(set); |
1247 TMMFDevSoundProxySettingsPckg pckg(set); |
1130 return SendReceiveResult(EMMFDevSoundProxyGetResourceNotificationData, iDestinationPckg, pckg, aNotificationData); |
1248 TInt err = SendReceiveResult(EMMFDevSoundProxyGetResourceNotificationData, iDestinationPckg, pckg, aNotificationData); |
|
1249 SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::GetResourceNotificationData - Exit [%d]"), err); |
|
1250 return err; |
1131 } |
1251 } |
1132 |
1252 |
1133 // ----------------------------------------------------------------------------- |
1253 // ----------------------------------------------------------------------------- |
1134 // RMMFDevSoundProxy::WillResumePlay |
1254 // RMMFDevSoundProxy::WillResumePlay |
1135 // Wait for the clients to resume play back even after the default timeout |
1255 // Wait for the clients to resume play back even after the default timeout |
1149 // ----------------------------------------------------------------------------- |
1272 // ----------------------------------------------------------------------------- |
1150 // |
1273 // |
1151 |
1274 |
1152 EXPORT_C TInt RMMFDevSoundProxy::EmptyBuffers() |
1275 EXPORT_C TInt RMMFDevSoundProxy::EmptyBuffers() |
1153 { |
1276 { |
|
1277 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::EmptyBuffers - Enter")); |
1154 TInt error = SendReceive(EMMFDevSoundProxyEmptyBuffers, iDestinationPckg); |
1278 TInt error = SendReceive(EMMFDevSoundProxyEmptyBuffers, iDestinationPckg); |
1155 |
1279 |
1156 if(error==KErrNone) |
1280 if(error==KErrNone) |
1157 { |
1281 { |
1158 if (iState==EPlayingBufferWait) |
1282 if (iState==EPlayingBufferWait) |
1159 { |
1283 { |
1160 // Empty buffers terminates the buffer cycle |
1284 // Empty buffers terminates the buffer cycle |
1161 iState = EPlaying; |
1285 iState = EPlaying; |
1162 } |
1286 } |
1163 } |
1287 } |
|
1288 SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::EmptyBuffers - Exit [%d]"), error); |
1164 return error; |
1289 return error; |
1165 } |
1290 } |
1166 |
1291 |
1167 // ----------------------------------------------------------------------------- |
1292 // ----------------------------------------------------------------------------- |
1168 // RMMFDevSoundProxy::CancelInitialize |
1293 // RMMFDevSoundProxy::CancelInitialize |
1169 // Cancels the initialization process |
1294 // Cancels the initialization process |
1170 // ----------------------------------------------------------------------------- |
1295 // ----------------------------------------------------------------------------- |
1171 // |
1296 // |
1172 EXPORT_C TInt RMMFDevSoundProxy::CancelInitialize() |
1297 EXPORT_C TInt RMMFDevSoundProxy::CancelInitialize() |
1173 { |
1298 { |
|
1299 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::CancelInitialize - Enter")); |
1174 TInt err=KErrNone; |
1300 TInt err=KErrNone; |
1175 |
1301 |
1176 if (iState==EInitializing) |
1302 if (iState==EInitializing) |
1177 { |
1303 { |
1178 err = SendReceive(EMMFDevSoundProxyCancelInitialize, iDestinationPckg); |
1304 err = SendReceive(EMMFDevSoundProxyCancelInitialize, iDestinationPckg); |
1263 TInt aFunction, |
1400 TInt aFunction, |
1264 const TDesC8& aDataTo1, |
1401 const TDesC8& aDataTo1, |
1265 const TDesC8& aDataTo2, |
1402 const TDesC8& aDataTo2, |
1266 TRequestStatus& aStatus ) |
1403 TRequestStatus& aStatus ) |
1267 { |
1404 { |
|
1405 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::CustomCommandAsync - Enter")); |
1268 SendReceive(aFunction, aDestination, aDataTo1, aDataTo2, aStatus); |
1406 SendReceive(aFunction, aDestination, aDataTo1, aDataTo2, aStatus); |
|
1407 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::CustomCommandAsync - Exit")); |
1269 } |
1408 } |
1270 |
1409 |
1271 // implementation of a simple CustomCommand() scheme |
1410 // implementation of a simple CustomCommand() scheme |
1272 EXPORT_C TInt RMMFDevSoundProxy::SyncCustomCommand(TUid aUid, const TDesC8& aParam1, const TDesC8& aParam2, TDes8* aOutParam) |
1411 EXPORT_C TInt RMMFDevSoundProxy::SyncCustomCommand(TUid aUid, const TDesC8& aParam1, const TDesC8& aParam2, TDes8* aOutParam) |
1273 { |
1412 { |
|
1413 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SyncCustomCommand - Enter")); |
1274 TMMFMessageDestinationPckg dest(TMMFMessageDestination(aUid, KMMFObjectHandleDevSound)); |
1414 TMMFMessageDestinationPckg dest(TMMFMessageDestination(aUid, KMMFObjectHandleDevSound)); |
1275 |
1415 |
|
1416 TInt err = KErrNone; |
1276 if (aOutParam==NULL) |
1417 if (aOutParam==NULL) |
1277 { |
1418 { |
1278 return SendReceive(EMMFDevSoundProxySyncCustomCommand, dest, aParam1, aParam2); |
1419 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SyncCustomCommand - Exit")); |
|
1420 err = SendReceive(EMMFDevSoundProxySyncCustomCommand, dest, aParam1, aParam2); |
|
1421 return err; |
1279 } |
1422 } |
1280 else |
1423 else |
1281 { |
1424 { |
1282 return SendReceiveResult(EMMFDevSoundProxySyncCustomCommandResult, dest, aParam1, aParam2, *aOutParam); |
1425 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::SyncCustomCommand - Exit")); |
|
1426 err = SendReceiveResult(EMMFDevSoundProxySyncCustomCommandResult, dest, aParam1, aParam2, *aOutParam); |
|
1427 return err; |
1283 } |
1428 } |
1284 } |
1429 } |
1285 |
1430 |
1286 EXPORT_C void RMMFDevSoundProxy::AsyncCustomCommand(TUid aUid, TRequestStatus& aStatus, const TDesC8& aParam1, const TDesC8& aParam2, TDes8* aOutParam) |
1431 EXPORT_C void RMMFDevSoundProxy::AsyncCustomCommand(TUid aUid, TRequestStatus& aStatus, const TDesC8& aParam1, const TDesC8& aParam2, TDes8* aOutParam) |
1287 { |
1432 { |
|
1433 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::AsyncCustomCommand - Enter")); |
1288 TMMFMessageDestination dest(aUid, KMMFObjectHandleDevSound); |
1434 TMMFMessageDestination dest(aUid, KMMFObjectHandleDevSound); |
1289 iCustIntPckg = dest; |
1435 iCustIntPckg = dest; |
1290 if (aOutParam==NULL) |
1436 if (aOutParam==NULL) |
1291 { |
1437 { |
|
1438 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::AsyncCustomCommand - Exit")); |
1292 SendReceive(EMMFDevSoundProxyAsyncCustomCommand, iCustIntPckg, aParam1, aParam2, aStatus); |
1439 SendReceive(EMMFDevSoundProxyAsyncCustomCommand, iCustIntPckg, aParam1, aParam2, aStatus); |
1293 } |
1440 } |
1294 else |
1441 else |
1295 { |
1442 { |
|
1443 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::AsyncCustomCommand - Exit")); |
1296 SendReceiveResult(EMMFDevSoundProxyAsyncCustomCommandResult, iCustIntPckg, aParam1, aParam2, *aOutParam, aStatus); |
1444 SendReceiveResult(EMMFDevSoundProxyAsyncCustomCommandResult, iCustIntPckg, aParam1, aParam2, *aOutParam, aStatus); |
1297 } |
1445 } |
1298 } |
1446 } |
1299 |
1447 |
1300 EXPORT_C TInt RMMFDevSoundProxy::GetTimePlayed(TTimeIntervalMicroSeconds& aTime) |
1448 EXPORT_C TInt RMMFDevSoundProxy::GetTimePlayed(TTimeIntervalMicroSeconds& aTime) |
1301 { |
1449 { |
|
1450 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::GetTimePlayed - Enter")); |
1302 TTimeIntervalMicroSeconds time(0); |
1451 TTimeIntervalMicroSeconds time(0); |
1303 TPckgBuf<TTimeIntervalMicroSeconds> timePckg(time); |
1452 TPckgBuf<TTimeIntervalMicroSeconds> timePckg(time); |
1304 TInt err = SendReceiveResult(EMMFDevSoundProxyGetTimePlayed, iDestinationPckg, KNullDesC8, timePckg); |
1453 TInt err = SendReceiveResult(EMMFDevSoundProxyGetTimePlayed, iDestinationPckg, KNullDesC8, timePckg); |
1305 if(err==KErrNone) |
1454 if(err==KErrNone) |
1306 { |
1455 { |
1307 aTime = timePckg(); |
1456 aTime = timePckg(); |
1308 } |
1457 } |
|
1458 SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::GetTimePlayed - Exit [%d]"), err); |
1309 return err; |
1459 return err; |
1310 } |
1460 } |
1311 |
1461 |
1312 EXPORT_C TBool RMMFDevSoundProxy::IsResumeSupported() |
1462 EXPORT_C TBool RMMFDevSoundProxy::IsResumeSupported() |
1313 { |
1463 { |
|
1464 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::IsResumeSupported - Enter")); |
1314 TPckgBuf<TBool> isResumeSupported; |
1465 TPckgBuf<TBool> isResumeSupported; |
1315 TInt err = SendReceiveResult(EMMFDevSoundProxyIsResumeSupported, |
1466 TInt err = SendReceiveResult(EMMFDevSoundProxyIsResumeSupported, |
1316 iDestinationPckg, |
1467 iDestinationPckg, |
1317 KNullDesC8, |
1468 KNullDesC8, |
1318 isResumeSupported); |
1469 isResumeSupported); |
1319 if(err == KErrNone) |
1470 if(err == KErrNone) |
1320 { |
1471 { |
|
1472 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::IsResumeSupported - Exit")); |
1321 return isResumeSupported(); |
1473 return isResumeSupported(); |
1322 } |
1474 } |
1323 else |
1475 else |
1324 { |
1476 { |
|
1477 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::IsResumeSupported - Exit")); |
1325 return EFalse; |
1478 return EFalse; |
1326 } |
1479 } |
1327 } |
1480 } |
1328 |
1481 |
1329 EXPORT_C TInt RMMFDevSoundProxy::Resume() |
1482 EXPORT_C TInt RMMFDevSoundProxy::Resume() |
1330 { |
1483 { |
|
1484 SYMBIAN_DEBPRN0(_L("RMMFDevSoundProxy[0x%x]::Resume - Enter")); |
1331 TInt err = KErrNone; |
1485 TInt err = KErrNone; |
1332 if (!iDevSoundObserver || iState <= EInitialized ) |
1486 if (!iDevSoundObserver || iState <= EInitialized ) |
1333 { |
1487 { |
1334 err = KErrNotReady; |
1488 err = KErrNotReady; |
1335 } |
1489 } |
1336 else if(iState == ETonePlaying && iToneMode != ESequence) |
1490 else if(iState == ETonePlaying && iToneMode != ESequence) |
1337 { |
1491 { |
|
1492 SYMBIAN_DEBPRN1(_L("RMMFDevSoundProxy[0x%x]::Resume - Exit [%d]"), err); |
1338 return KErrNotSupported; |
1493 return KErrNotSupported; |
1339 } |
1494 } |
1340 else |
1495 else |
1341 { |
1496 { |
1342 if (iState==ERecordingInLastBufferCycle) |
1497 if (iState==ERecordingInLastBufferCycle) |