20 // INCLUDE FILES |
20 // INCLUDE FILES |
21 #include "cpeaudiodata.h" // CPEAudioData header |
21 #include "cpeaudiodata.h" // CPEAudioData header |
22 #include "cpeaudioinbandtoneplayer.h" |
22 #include "cpeaudioinbandtoneplayer.h" |
23 #include "cpeaudiofactory.h" |
23 #include "cpeaudiofactory.h" |
24 #include "cpeaudiotoneutility.h" |
24 #include "cpeaudiotoneutility.h" |
25 #include <AudioPreference.h> |
25 #include <AudioPreference.h> |
26 #include <barsc.h> |
26 #include <barsc.h> |
27 #include <barsread.h> |
27 #include <barsread.h> |
28 #include <data_caging_path_literals.hrh> |
28 #include <data_caging_path_literals.hrh> |
29 #include <defaultbeep.rsg> |
29 #include <defaultbeep.rsg> |
30 #include <featmgr.h> |
30 #include <featdiscovery.h> |
31 #include <pepanic.pan> |
31 #include <pepanic.pan> |
32 #include <talogger.h> |
32 #include <talogger.h> |
33 |
33 |
34 |
34 |
35 // EXTERNAL DATA STRUCTURES |
35 // EXTERNAL DATA STRUCTURES |
147 HBufC8* resourceCongestion = resourceFile.AllocReadL( R_NET_CONGESTION ); |
147 HBufC8* resourceCongestion = resourceFile.AllocReadL( R_NET_CONGESTION ); |
148 HBufC8* resourceSpecial = resourceFile.AllocReadL( R_NET_SPECIAL_INFORMATION ); |
148 HBufC8* resourceSpecial = resourceFile.AllocReadL( R_NET_SPECIAL_INFORMATION ); |
149 HBufC8* resourceRadioPath = resourceFile.AllocReadL( R_NET_RADIO_NOT_AVAILABLE ); |
149 HBufC8* resourceRadioPath = resourceFile.AllocReadL( R_NET_RADIO_NOT_AVAILABLE ); |
150 HBufC8* resourceRingGoing = resourceFile.AllocReadL( R_NET_RING_GOING ); |
150 HBufC8* resourceRingGoing = resourceFile.AllocReadL( R_NET_RING_GOING ); |
151 |
151 |
|
152 |
152 HBufC8* resourceCallWaiting; |
153 HBufC8* resourceCallWaiting; |
153 |
154 |
154 if ( FeatureManager::FeatureSupported( KFeatureIdFfAlternativeCallWaitingTone ) ) |
155 if ( CFeatureDiscovery::IsFeatureSupportedL( KFeatureIdFfAlternativeCallWaitingTone ) ) |
155 { |
156 { |
156 resourceCallWaiting = resourceFile.AllocReadL( R_NET_CALL_WAITING_ALTERNATIVE_TONE ); |
157 resourceCallWaiting = resourceFile.AllocReadL( R_NET_CALL_WAITING_ALTERNATIVE_TONE ); |
157 } |
158 } |
158 else |
159 else |
159 { |
160 { |
160 resourceCallWaiting = resourceFile.AllocReadL( R_NET_CALL_WAITING ); |
161 resourceCallWaiting = resourceFile.AllocReadL( R_NET_CALL_WAITING ); |
161 } |
162 } |
162 |
163 |
|
164 |
163 HBufC8* dataCallTone = resourceFile.AllocReadL( R_DATA_CALL_TONE ); |
165 HBufC8* dataCallTone = resourceFile.AllocReadL( R_DATA_CALL_TONE ); |
164 HBufC8* noSoundSequence = resourceFile.AllocReadL( R_NO_SOUND_SEQUENCE ); |
166 HBufC8* noSoundSequence = resourceFile.AllocReadL( R_NO_SOUND_SEQUENCE ); |
165 HBufC8* beepSequence = resourceFile.AllocReadL( R_BEEP_SEQUENCE ); |
167 HBufC8* beepSequence = resourceFile.AllocReadL( R_BEEP_SEQUENCE ); |
166 |
168 |
167 CleanupStack::PopAndDestroy( &resourceFile ); |
169 CleanupStack::PopAndDestroy( &resourceFile ); |
362 break; |
364 break; |
363 default: |
365 default: |
364 TEFLOGSTRING2( KTAINT, "AUD CPEAudioInbandTonePlayer::PlayInbandTone: No InbandTone defined to play with: %d", aTone ); |
366 TEFLOGSTRING2( KTAINT, "AUD CPEAudioInbandTonePlayer::PlayInbandTone: No InbandTone defined to play with: %d", aTone ); |
365 __ASSERT_DEBUG( EFalse, Panic( EPEPanicNotCompleted ) ); |
367 __ASSERT_DEBUG( EFalse, Panic( EPEPanicNotCompleted ) ); |
366 break; |
368 break; |
367 } |
369 } |
368 } |
370 } |
369 |
371 |
370 // ----------------------------------------------------------------------------- |
372 // ----------------------------------------------------------------------------- |
371 // CPEAudioInbandTonePlayer::Cancel |
373 // CPEAudioInbandTonePlayer::Cancel |
372 // Cancels the currently playing tone. |
374 // Cancels the currently playing tone. |
423 KAudioPriorityNetMsg, |
425 KAudioPriorityNetMsg, |
424 static_cast < TMdaPriorityPreference > ( KAudioPrefBusy ) ); |
426 static_cast < TMdaPriorityPreference > ( KAudioPrefBusy ) ); |
425 break; |
427 break; |
426 case ECCPToneRadioPathNotAvailable: |
428 case ECCPToneRadioPathNotAvailable: |
427 iCurrent->SetRepeats( |
429 iCurrent->SetRepeats( |
428 KPhoneInbandToneRepeatOnce, |
430 KPhoneInbandToneRepeatOnce, |
429 TTimeIntervalMicroSeconds( KPhoneInbandToneZero ) ); |
431 TTimeIntervalMicroSeconds( KPhoneInbandToneZero ) ); |
430 iCurrent->SetPriority( |
432 iCurrent->SetPriority( |
431 KAudioPriorityNetMsg, |
433 KAudioPriorityNetMsg, |
432 static_cast < TMdaPriorityPreference > ( KAudioPrefRadioNotAvailable ) ); |
434 static_cast < TMdaPriorityPreference > ( KAudioPrefRadioNotAvailable ) ); |
433 break; |
435 break; |
463 KAudioPriorityNetMsg, |
465 KAudioPriorityNetMsg, |
464 static_cast < TMdaPriorityPreference > ( KAudioPrefRingGoing ) ); |
466 static_cast < TMdaPriorityPreference > ( KAudioPrefRingGoing ) ); |
465 break; |
467 break; |
466 case ECCPCallWaiting: |
468 case ECCPCallWaiting: |
467 iCurrent->SetRepeats( |
469 iCurrent->SetRepeats( |
468 KPhoneInbandToneNoRepeat, |
470 KPhoneInbandToneNoRepeat, |
469 TTimeIntervalMicroSeconds( KPhoneInbandToneZero ) ); |
471 TTimeIntervalMicroSeconds( KPhoneInbandToneZero ) ); |
470 iCurrent->SetPriority( |
472 iCurrent->SetPriority( |
471 KAudioPriorityNetMsg, |
473 KAudioPriorityNetMsg, |
472 static_cast < TMdaPriorityPreference > ( KAudioPrefCallWaiting )); |
474 static_cast < TMdaPriorityPreference > ( KAudioPrefCallWaiting )); |
473 break; |
475 break; |
491 TTimeIntervalMicroSeconds( KPhoneInbandToneZero ) ); |
493 TTimeIntervalMicroSeconds( KPhoneInbandToneZero ) ); |
492 } |
494 } |
493 if ( iRingingType == EProfileRingingTypeRingingOnce ) |
495 if ( iRingingType == EProfileRingingTypeRingingOnce ) |
494 { |
496 { |
495 iCurrent->SetRepeats( |
497 iCurrent->SetRepeats( |
496 KPhoneInbandToneNoRepeat, |
498 KPhoneInbandToneNoRepeat, |
497 TTimeIntervalMicroSeconds( KPhoneInbandToneZero ) ); |
499 TTimeIntervalMicroSeconds( KPhoneInbandToneZero ) ); |
498 } |
500 } |
499 break; |
501 break; |
500 case ECCPNoSoundSequence: |
502 case ECCPNoSoundSequence: |
501 case ECCPBeepSequence: |
503 case ECCPBeepSequence: |
504 TTimeIntervalMicroSeconds( KPhoneInbandToneZero ) ); |
506 TTimeIntervalMicroSeconds( KPhoneInbandToneZero ) ); |
505 iCurrent->SetPriority( |
507 iCurrent->SetPriority( |
506 KAudioPriorityPhoneCall, |
508 KAudioPriorityPhoneCall, |
507 static_cast < TMdaPriorityPreference > ( KAudioPrefIncomingCall ) ); |
509 static_cast < TMdaPriorityPreference > ( KAudioPrefIncomingCall ) ); |
508 iCurrent->SetRepeats( |
510 iCurrent->SetRepeats( |
509 KPhoneInbandToneNoRepeat, |
511 KPhoneInbandToneNoRepeat, |
510 TTimeIntervalMicroSeconds( KPhoneInbandToneZero ) ); |
512 TTimeIntervalMicroSeconds( KPhoneInbandToneZero ) ); |
511 iCurrent->SetVolumeRamp( TTimeIntervalMicroSeconds( KPhoneInbandToneZero ) ); |
513 iCurrent->SetVolumeRamp( TTimeIntervalMicroSeconds( KPhoneInbandToneZero ) ); |
512 break; |
514 break; |
513 default: |
515 default: |
514 TEFLOGSTRING2( KTAREQOUT, |
516 TEFLOGSTRING2( KTAREQOUT, |
515 "AUD CPEAudioInbandTonePlayer::PlayCurrentTone: No InbandTone defined to set priority with %d", |
517 "AUD CPEAudioInbandTonePlayer::PlayCurrentTone: No InbandTone defined to set priority with %d", |