mmserv/tms/tmsserver/src/tmsrtaudiohdlr.cpp
changeset 33 5e8b14bae8c3
parent 20 b67dd1fc57c5
child 53 eabc8c503852
equal deleted inserted replaced
28:ebf79c79991a 33:5e8b14bae8c3
   390 // -----------------------------------------------------------------------------
   390 // -----------------------------------------------------------------------------
   391 //
   391 //
   392 void TMSRtAudioHdlr::MapcInitComplete(TInt aError,
   392 void TMSRtAudioHdlr::MapcInitComplete(TInt aError,
   393         const TTimeIntervalMicroSeconds& /*aDuration*/)
   393         const TTimeIntervalMicroSeconds& /*aDuration*/)
   394     {
   394     {
   395     TRACE_PRN_N2(
   395     TRACE_PRN_FN_ENT;
   396             _L("TMS->TMSRtAudioHdlr::MapcInitComplete: player[%d], err[%d]"),
   396     TRACE_PRN_N2(_L("RT player type[%d], err[%d]"), iRtType, aError);
   397             iRtType, aError);
       
   398 
   397 
   399     __ASSERT_DEBUG((iFormat == EFormatSample) ||
   398     __ASSERT_DEBUG((iFormat == EFormatSample) ||
   400             ((iFormat == EFormatTts) && (iPlayerStatus == EToneLoading)),
   399             ((iFormat == EFormatTts) && (iPlayerStatus == EToneLoading)),
   401             PANIC(TMS_RESULT_INVALID_STATE));
   400             PANIC(TMS_RESULT_INVALID_STATE));
   402 
   401 
   412             {
   411             {
   413             iPlayerStatus = EToneReady;
   412             iPlayerStatus = EToneReady;
   414             }
   413             }
   415         }
   414         }
   416     iObserver.RtAudioHdlrEvent(ECmdRingToneOpenComplete, aError, iRtType);
   415     iObserver.RtAudioHdlrEvent(ECmdRingToneOpenComplete, aError, iRtType);
       
   416     TRACE_PRN_FN_EXT;
   417     }
   417     }
   418 
   418 
   419 // -----------------------------------------------------------------------------
   419 // -----------------------------------------------------------------------------
   420 // TMSRtAudioHdlr::MapcPlayComplete
   420 // TMSRtAudioHdlr::MapcPlayComplete
   421 // -----------------------------------------------------------------------------
   421 // -----------------------------------------------------------------------------
   422 //
   422 //
   423 void TMSRtAudioHdlr::MapcPlayComplete(TInt aError)
   423 void TMSRtAudioHdlr::MapcPlayComplete(TInt aError)
   424     {
   424     {
   425     TRACE_PRN_N2(
   425     TRACE_PRN_FN_ENT;
   426             _L("TMS->TMSRtAudioHdlr::MapcPlayComplete: player[%d], err[%d]"),
   426     TRACE_PRN_N2(_L("RT player type[%d], err[%d]"), iRtType, aError);
   427             iRtType, aError);
       
   428 
   427 
   429     iPlayerStatus = EToneReady;
   428     iPlayerStatus = EToneReady;
   430 
   429 
   431     // Delete 3D plugin before RT player. In case of continuous ringing type,
   430     // Delete 3D plugin before RT player. In case of continuous ringing type,
   432     // 3D plugin is destructed in StopPlaying().
   431     // 3D plugin is destructed in StopPlaying().
   435         i3DPlugin->Stop();
   434         i3DPlugin->Stop();
   436         delete i3DPlugin;
   435         delete i3DPlugin;
   437         i3DPlugin = NULL;
   436         i3DPlugin = NULL;
   438         }*/
   437         }*/
   439     iObserver.RtAudioHdlrEvent(ECmdRingTonePlayComplete, aError, iRtType);
   438     iObserver.RtAudioHdlrEvent(ECmdRingTonePlayComplete, aError, iRtType);
       
   439     TRACE_PRN_FN_EXT;
   440     }
   440     }
   441 
   441 
   442 // -----------------------------------------------------------------------------
   442 // -----------------------------------------------------------------------------
   443 // TMSRtAudioHdlr::MatoPrepareComplete
   443 // TMSRtAudioHdlr::MatoPrepareComplete
   444 // -----------------------------------------------------------------------------
   444 // -----------------------------------------------------------------------------
   445 //
   445 //
   446 void TMSRtAudioHdlr::MatoPrepareComplete(TInt aError)
   446 void TMSRtAudioHdlr::MatoPrepareComplete(TInt aError)
   447     {
   447     {
   448     TRACE_PRN_N2(
   448     TRACE_PRN_FN_ENT;
   449             _L("TMS->TMSRtAudioHdlr::MatoPrepareComplete: player[%d], err[%d]"),
   449     TRACE_PRN_N2(_L("RT player type[%d], err[%d]"), iRtType, aError);
   450             iRtType, aError);
       
   451 
   450 
   452     __ASSERT_DEBUG(((iFormat == EFormatTone) &&
   451     __ASSERT_DEBUG(((iFormat == EFormatTone) &&
   453             (iPlayerStatus == EToneLoading)), PANIC(TMS_RESULT_INVALID_STATE));
   452             (iPlayerStatus == EToneLoading)), PANIC(TMS_RESULT_INVALID_STATE));
   454 
   453 
   455     if (aError == TMS_RESULT_SUCCESS)
   454     if (aError == TMS_RESULT_SUCCESS)
   464             {
   463             {
   465             iPlayerStatus = EToneReady;
   464             iPlayerStatus = EToneReady;
   466             }
   465             }
   467         }
   466         }
   468     iObserver.RtAudioHdlrEvent(ECmdRingToneOpenComplete, aError, iRtType);
   467     iObserver.RtAudioHdlrEvent(ECmdRingToneOpenComplete, aError, iRtType);
       
   468     TRACE_PRN_FN_ENT;
   469     }
   469     }
   470 
   470 
   471 // -----------------------------------------------------------------------------
   471 // -----------------------------------------------------------------------------
   472 // TMSRtAudioHdlr::MatoPlayComplete
   472 // TMSRtAudioHdlr::MatoPlayComplete
   473 // -----------------------------------------------------------------------------
   473 // -----------------------------------------------------------------------------
   474 //
   474 //
   475 void TMSRtAudioHdlr::MatoPlayComplete(TInt aError)
   475 void TMSRtAudioHdlr::MatoPlayComplete(TInt aError)
   476     {
   476     {
   477     TRACE_PRN_N2(
   477     TRACE_PRN_FN_ENT;
   478             _L("TMS->TMSRtAudioHdlr::MatoPlayComplete: player[%d], err[%d]"),
   478     TRACE_PRN_N2(_L("RT player type[%d], err[%d]"), iRtType, aError);
   479             iRtType, aError);
       
   480 
       
   481     iObserver.RtAudioHdlrEvent(ECmdRingTonePlayComplete, aError, iRtType);
   479     iObserver.RtAudioHdlrEvent(ECmdRingTonePlayComplete, aError, iRtType);
   482     }
   480     TRACE_PRN_FN_EXT;
       
   481    }
   483 
   482 
   484 // -----------------------------------------------------------------------------
   483 // -----------------------------------------------------------------------------
   485 // TMSRtAudioHdlr::DoPlay
   484 // TMSRtAudioHdlr::DoPlay
   486 // -----------------------------------------------------------------------------
   485 // -----------------------------------------------------------------------------
   487 //
   486 //
   503         {
   502         {
   504         iTtsPlayer->Play();
   503         iTtsPlayer->Play();
   505         }
   504         }
   506     else
   505     else
   507         {
   506         {
   508 #ifdef __WINS__
   507 #ifdef __WINSCW__
   509         iSamplePlayer->Play();
   508         iSamplePlayer->Play();
   510 #else
   509 #else
   511 /*
   510 /*
   512         //TODO: compare with phoneapp
   511         //TODO: compare with phoneapp
   513         TInt err = KErrNone;
   512         TInt err = KErrNone;
   527                 {
   526                 {
   528                 TRAP(err, iAudioOutput->SetAudioOutputL(CAudioOutput::EAll));
   527                 TRAP(err, iAudioOutput->SetAudioOutputL(CAudioOutput::EAll));
   529                 }
   528                 }
   530             }*/
   529             }*/
   531         iSamplePlayer->Play();
   530         iSamplePlayer->Play();
   532 #endif //__WINS__
   531 #endif //__WINSCW__
   533         }
   532         }
   534 
   533 
   535     TRACE_PRN_FN_EXT;
   534     TRACE_PRN_FN_EXT;
   536     }
   535     }
   537 
   536 
   828         // Mute during EToneLoading state.
   827         // Mute during EToneLoading state.
   829         iToBePlaying = EFalse;
   828         iToBePlaying = EFalse;
   830         }
   829         }
   831     }
   830     }
   832 
   831 
   833 //  End of File