mmserv/tms/tmsserver/src/tmsrtplayer.cpp
changeset 42 1fa3fb47b1e3
parent 31 8dfd592727cb
child 55 e267340986c9
equal deleted inserted replaced
32:94fc26b6e006 42:1fa3fb47b1e3
    46 const TInt KTMSTtsDelaysCount = sizeof(KTMSTtsDelays) / sizeof (TInt);
    46 const TInt KTMSTtsDelaysCount = sizeof(KTMSTtsDelays) / sizeof (TInt);
    47 const TInt Kkilo = 1024;
    47 const TInt Kkilo = 1024;
    48 
    48 
    49 _LIT(KTMSTtsHeader, "(tts)");
    49 _LIT(KTMSTtsHeader, "(tts)");
    50 
    50 
    51 #ifdef __WINS__
    51 #ifdef __WINSCW__
    52 //_LIT(KTMSDefaultSoundFile, "z:\\data\\sounds\\digital\\Nokia_tune.aac");
    52 //_LIT(KTMSDefaultSoundFile, "z:\\data\\sounds\\digital\\Nokia_tune.aac");
    53 _LIT(KTMSDefaultSoundFile, "Z:\\Data\\Sounds\\Digital\\Nokia tune.aac");
    53 _LIT(KTMSDefaultSoundFile, "Z:\\Data\\Sounds\\Digital\\Nokia tune.aac");
    54 //_LIT(KTMSDefaultSoundFile, "c:\\data\\sounds\\digital\\test_8khz.wav");
    54 //_LIT(KTMSDefaultSoundFile, "c:\\data\\sounds\\digital\\test_8khz.wav");
    55 _LIT(KTMSNoSoundSequence,  "z:\\data\\sounds\\digital\\clock.aac");
    55 _LIT(KTMSNoSoundSequence,  "z:\\data\\sounds\\digital\\clock.aac");
    56 //_LIT(KTMSNoSoundSequence, "c:\\data\\sounds\\digital\\test_8khz.wav");
    56 //_LIT(KTMSNoSoundSequence, "c:\\data\\sounds\\digital\\test_8khz.wav");
    65 \xFC\x40\x64\x0A\x08\x40\x32\x0A\xF7\x06\x0B");
    65 \xFC\x40\x64\x0A\x08\x40\x32\x0A\xF7\x06\x0B");
    66 _LIT8(KTMSNoSoundSequence, "\x00\x11\x0A\x05\xFC\x0A\x08\x40\x32\x0A\xF7\
    66 _LIT8(KTMSNoSoundSequence, "\x00\x11\x0A\x05\xFC\x0A\x08\x40\x32\x0A\xF7\
    67 \x40\x64\x06\x0B");
    67 \x40\x64\x06\x0B");
    68 _LIT8(KTMSUnsecureVoIPCall, "\x00\x11\x0B\x67\x04\x40\x04\x67\x04\x40\x04\
    68 _LIT8(KTMSUnsecureVoIPCall, "\x00\x11\x0B\x67\x04\x40\x04\x67\x04\x40\x04\
    69 \x6C\x04\x40\x04\x6D\x04\x0B");
    69 \x6C\x04\x40\x04\x6D\x04\x0B");
    70 #endif // __WINS__
    70 #endif // __WINSCW__
    71 
    71 
    72 // -----------------------------------------------------------------------------
    72 // -----------------------------------------------------------------------------
    73 // TMSRingTonePlayer::NewL
    73 // TMSRingTonePlayer::NewL
    74 // -----------------------------------------------------------------------------
    74 // -----------------------------------------------------------------------------
    75 //
    75 //
   113     // Checks if DRM extend security is needed
   113     // Checks if DRM extend security is needed
   114     // Check video player configuration.
   114     // Check video player configuration.
   115 
   115 
   116     iEngine =  ProEngFactory::NewEngineL();
   116     iEngine =  ProEngFactory::NewEngineL();
   117 
   117 
   118     InitRtParamsL(EPlayerBackup);
   118     InitRtParams(EPlayerBackup);
   119     //CreateDefaultRingToneL();
   119     //CreateDefaultRingToneL();
   120     CreateBkpRtPlayerL();
   120     CreateBkpRtPlayerL();
   121     //GetMaxToneFileSizeL(iToneFileSizeLimitKB);
   121     //GetMaxToneFileSizeL(iToneFileSizeLimitKB);
   122 
   122 
   123     TRACE_PRN_FN_EXT;
   123     TRACE_PRN_FN_EXT;
   150 
   150 
   151     TRACE_PRN_FN_EXT;
   151     TRACE_PRN_FN_EXT;
   152     }
   152     }
   153 
   153 
   154 // -----------------------------------------------------------------------------
   154 // -----------------------------------------------------------------------------
   155 // TMSRingTonePlayer::InitRtParamsL
   155 // TMSRingTonePlayer::InitRtParams
   156 // -----------------------------------------------------------------------------
   156 // -----------------------------------------------------------------------------
   157 //
   157 //
   158 void TMSRingTonePlayer::InitRtParamsL(TRtPlayerType aPlayerType)
   158 void TMSRingTonePlayer::InitRtParams(TRtPlayerType aPlayerType)
   159     {
   159     {
   160     TRACE_PRN_FN_ENT;
   160     TRACE_PRN_FN_ENT;
   161 
   161 
   162     iRtParam.iType = aPlayerType;
   162     iRtParam.iType = aPlayerType;
   163     iRtParam.iPriority = KAudioPriorityPhoneCall;
   163     iRtParam.iPriority = KAudioPriorityPhoneCall;
   181 //
   181 //
   182 void TMSRingTonePlayer::CreateDefaultRingToneL()
   182 void TMSRingTonePlayer::CreateDefaultRingToneL()
   183     {
   183     {
   184     TRACE_PRN_FN_ENT;
   184     TRACE_PRN_FN_ENT;
   185 
   185 
   186     InitRtParamsL(EPlayerDefault);
   186     InitRtParams(EPlayerDefault);
   187     LoadProfileRingToneL();
   187     LoadProfileRingToneL();
   188 
   188 
   189     TRACE_PRN_FN_EXT;
   189     TRACE_PRN_FN_EXT;
   190     }
   190     }
   191 
   191 
   369     TRACE_PRN_FN_ENT;
   369     TRACE_PRN_FN_ENT;
   370 
   370 
   371     delete iBeepOncePlayer;
   371     delete iBeepOncePlayer;
   372     iBeepOncePlayer = NULL;
   372     iBeepOncePlayer = NULL;
   373 
   373 
   374 #ifdef __WINS__
   374 #ifdef __WINSCW__
   375     TParse* fp = new (ELeave) TParse();
   375     TParse* fp = new (ELeave) TParse();
   376     fp->Set(KTMSBeepSequence, NULL, NULL);
   376     fp->Set(KTMSBeepSequence, NULL, NULL);
   377     TFileName fileName(fp->FullName());
   377     TFileName fileName(fp->FullName());
   378     delete fp;
   378     delete fp;
   379     iBeepOncePlayer = TMSRtAudioHdlr::NewL(fileName, iRtParam.iPriority,
   379     iBeepOncePlayer = TMSRtAudioHdlr::NewL(fileName, iRtParam.iPriority,
   380             iRtParam.iPreference, *this, EPlayerBeepOnce);
   380             iRtParam.iPreference, *this, EPlayerBeepOnce);
   381 #else
   381 #else
   382     iBeepOncePlayer = TMSRtAudioHdlr::NewSeqL(KTMSBeepSequence(),
   382     iBeepOncePlayer = TMSRtAudioHdlr::NewSeqL(KTMSBeepSequence(),
   383             iRtParam.iPriority, iRtParam.iPreference, *this, EPlayerBeepOnce);
   383             iRtParam.iPriority, iRtParam.iPreference, *this, EPlayerBeepOnce);
   384 #endif // __WINS__
   384 #endif // __WINSCW__
   385 
   385 
   386     iRtParam.iType = EPlayerBeepOnce;
   386     iRtParam.iType = EPlayerBeepOnce;
   387     TRACE_PRN_FN_EXT;
   387     TRACE_PRN_FN_EXT;
   388     }
   388     }
   389 
   389 
   397 
   397 
   398     iRtParam.iVolume = 0;
   398     iRtParam.iVolume = 0;
   399     delete iSilentPlayer;
   399     delete iSilentPlayer;
   400     iSilentPlayer = NULL;
   400     iSilentPlayer = NULL;
   401 
   401 
   402 #ifdef __WINS__
   402 #ifdef __WINSCW__
   403     TParse* fp = new (ELeave) TParse();
   403     TParse* fp = new (ELeave) TParse();
   404     fp->Set(KTMSNoSoundSequence, NULL, NULL);
   404     fp->Set(KTMSNoSoundSequence, NULL, NULL);
   405     TFileName fileName(fp->FullName());
   405     TFileName fileName(fp->FullName());
   406     delete fp;
   406     delete fp;
   407     iSilentPlayer = TMSRtAudioHdlr::NewL(fileName, iRtParam.iPriority,
   407     iSilentPlayer = TMSRtAudioHdlr::NewL(fileName, iRtParam.iPriority,
   408             iRtParam.iPreference, *this, EPlayerSilent);
   408             iRtParam.iPreference, *this, EPlayerSilent);
   409 #else
   409 #else
   410     iSilentPlayer = TMSRtAudioHdlr::NewSeqL(KTMSNoSoundSequence(),
   410     iSilentPlayer = TMSRtAudioHdlr::NewSeqL(KTMSNoSoundSequence(),
   411             iRtParam.iPriority, iRtParam.iPreference, *this, EPlayerSilent);
   411             iRtParam.iPriority, iRtParam.iPreference, *this, EPlayerSilent);
   412 #endif // __WINS__
   412 #endif // __WINSCW__
   413 
   413 
   414     iRtParam.iType = EPlayerSilent;
   414     iRtParam.iType = EPlayerSilent;
   415     TRACE_PRN_FN_EXT;
   415     TRACE_PRN_FN_EXT;
   416     }
   416     }
   417 
   417 
   424     TRACE_PRN_FN_ENT;
   424     TRACE_PRN_FN_ENT;
   425 
   425 
   426     delete iUnsecureVoIPTonePlayer;
   426     delete iUnsecureVoIPTonePlayer;
   427     iUnsecureVoIPTonePlayer = NULL;
   427     iUnsecureVoIPTonePlayer = NULL;
   428 
   428 
   429 #ifdef __WINS__
   429 #ifdef __WINSCW__
   430     TParse* fp = new (ELeave) TParse();
   430     TParse* fp = new (ELeave) TParse();
   431     fp->Set(KTMSUnsecureVoIPCall, NULL, NULL);
   431     fp->Set(KTMSUnsecureVoIPCall, NULL, NULL);
   432     TFileName fileName(fp->FullName());
   432     TFileName fileName(fp->FullName());
   433     delete fp;
   433     delete fp;
   434     iUnsecureVoIPTonePlayer = TMSRtAudioHdlr::NewL(fileName,
   434     iUnsecureVoIPTonePlayer = TMSRtAudioHdlr::NewL(fileName,
   436             EPlayerUnsecureVoIP);
   436             EPlayerUnsecureVoIP);
   437 #else
   437 #else
   438     iUnsecureVoIPTonePlayer = TMSRtAudioHdlr::NewSeqL(KTMSUnsecureVoIPCall(),
   438     iUnsecureVoIPTonePlayer = TMSRtAudioHdlr::NewSeqL(KTMSUnsecureVoIPCall(),
   439             iRtParam.iPriority, iRtParam.iPreference, *this,
   439             iRtParam.iPriority, iRtParam.iPreference, *this,
   440             EPlayerUnsecureVoIP);
   440             EPlayerUnsecureVoIP);
   441 #endif // __WINS__
   441 #endif // __WINSCW__
   442 
   442 
   443     iRtParam.iType = EPlayerUnsecureVoIP;
   443     iRtParam.iType = EPlayerUnsecureVoIP;
   444     TRACE_PRN_FN_EXT;
   444     TRACE_PRN_FN_EXT;
   445     }
   445     }
   446 
   446 
   447 // -----------------------------------------------------------------------------
   447 // -----------------------------------------------------------------------------
   448 // TMSRingTonePlayer::CreateCustomSequencePlayerL
   448 // TMSRingTonePlayer::CreateCustomSequencePlayerL
   449 // -----------------------------------------------------------------------------
   449 // -----------------------------------------------------------------------------
   450 //
   450 //
   451 void TMSRingTonePlayer::CreateCustomSequencePlayerL(const TDesC8&
   451 void TMSRingTonePlayer::CreateCustomSequencePlayerL(const TDesC8&
   452 #ifdef __WINS__
   452 #ifdef __WINSCW__
   453         /*aSequence*/)
   453         /*aSequence*/)
   454 #else
   454 #else
   455         aSequence)
   455         aSequence)
   456 #endif
   456 #endif
   457     {
   457     {
   458     TRACE_PRN_FN_ENT;
   458     TRACE_PRN_FN_ENT;
   459 
   459 
   460     delete iSequencePlayer;
   460     delete iSequencePlayer;
   461     iSequencePlayer = NULL;
   461     iSequencePlayer = NULL;
   462 
   462 
   463 #ifdef __WINS__
   463 #ifdef __WINSCW__
   464     TParse* fp = new (ELeave) TParse();
   464     TParse* fp = new (ELeave) TParse();
   465     fp->Set(KTMSBeepSequence, NULL, NULL);
   465     fp->Set(KTMSBeepSequence, NULL, NULL);
   466     TFileName fileName(fp->FullName());
   466     TFileName fileName(fp->FullName());
   467     delete fp;
   467     delete fp;
   468     iSequencePlayer = TMSRtAudioHdlr::NewL(fileName, iRtParam.iPriority,
   468     iSequencePlayer = TMSRtAudioHdlr::NewL(fileName, iRtParam.iPriority,
   469             iRtParam.iPreference, *this, EPlayerSequence);
   469             iRtParam.iPreference, *this, EPlayerSequence);
   470 #else
   470 #else
   471     iSequencePlayer = TMSRtAudioHdlr::NewSeqL(aSequence, iRtParam.iPriority,
   471     iSequencePlayer = TMSRtAudioHdlr::NewSeqL(aSequence, iRtParam.iPriority,
   472             iRtParam.iPreference, *this, EPlayerSequence);
   472             iRtParam.iPreference, *this, EPlayerSequence);
   473 #endif // __WINS__
   473 #endif // __WINSCW__
   474 
   474 
   475     iRtParam.iType = EPlayerSequence;
   475     iRtParam.iType = EPlayerSequence;
   476     TRACE_PRN_FN_EXT;
   476     TRACE_PRN_FN_EXT;
   477     }
   477     }
   478 
   478 
  1376                     DeletePlayerAsync(EPlayerAudio);
  1376                     DeletePlayerAsync(EPlayerAudio);
  1377                     }
  1377                     }
  1378                 iAudioPlayer = NULL;
  1378                 iAudioPlayer = NULL;
  1379                 }
  1379                 }
  1380 
  1380 
  1381 #ifdef __WINS__
  1381 #ifdef __WINSCW__
  1382             TRAP_IGNORE(PlayAudioRingToneL());
  1382             TRAP_IGNORE(PlayAudioRingToneL());
  1383             iTonePlayingStatus = EDefaultTonePlaying;
  1383             iTonePlayingStatus = EDefaultTonePlaying;
  1384 #else
  1384 #else
  1385             TRAP_IGNORE(PlayDefaultToneL());
  1385             TRAP_IGNORE(PlayDefaultToneL());
  1386 #endif
  1386 #endif //__WINSCW__
  1387             break;
  1387             break;
  1388             }
  1388             }
  1389         case EDefaultTonePlaying:
  1389         case EDefaultTonePlaying:
  1390             {
  1390             {
  1391             if (aDelete)
  1391             if (aDelete)
  1708         }
  1708         }
  1709 
  1709 
  1710     return audioHdlr;
  1710     return audioHdlr;
  1711     }
  1711     }
  1712 
  1712 
  1713 //  End of File