1 /* |
1 /* |
2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
108 |
108 |
109 const TUint8 KKeyZero = 0x30; |
109 const TUint8 KKeyZero = 0x30; |
110 const TUint8 KKeyNine = 0x39; |
110 const TUint8 KKeyNine = 0x39; |
111 const TUint8 KHwAsterisk = 0x2a; // In hw scan code value for asterisk |
111 const TUint8 KHwAsterisk = 0x2a; // In hw scan code value for asterisk |
112 |
112 |
|
113 // The max volume value from settings. |
|
114 // From TProfileToneSettings.h |
|
115 const TInt KMaxVolumeFromProfile( 10 ); |
|
116 |
113 // ================= MEMBER FUNCTIONS ======================= |
117 // ================= MEMBER FUNCTIONS ======================= |
114 |
118 |
115 // C++ default constructor can NOT contain any code, that |
119 // C++ default constructor can NOT contain any code, that |
116 // might leave. |
120 // might leave. |
117 // |
121 // |
1557 |
1561 |
1558 iPlayer = CMdaAudioToneUtility::NewL(*this); |
1562 iPlayer = CMdaAudioToneUtility::NewL(*this); |
1559 |
1563 |
1560 TInt volume( iPlayer->MaxVolume() ); |
1564 TInt volume( iPlayer->MaxVolume() ); |
1561 iPlayer->SetVolume( volume ); |
1565 iPlayer->SetVolume( volume ); |
|
1566 TFLOGSTRING2( "CSatUiViewAppUi::PlayStandardToneL SetVolume %d", |
|
1567 volume ) |
1562 |
1568 |
1563 iPlayer->PrepareToPlayDesSequence( aSequence ); |
1569 iPlayer->PrepareToPlayDesSequence( aSequence ); |
1564 |
1570 |
1565 TTimeIntervalMicroSeconds max32Bit( |
1571 TTimeIntervalMicroSeconds max32Bit( |
1566 static_cast<TInt64>( K32TIntMaxValue ) ); |
1572 static_cast<TInt64>( K32TIntMaxValue ) ); |
3219 |
3225 |
3220 // Takes a current warning and gametones setting. |
3226 // Takes a current warning and gametones setting. |
3221 const TProfileToneSettings& ts = tones.ToneSettings(); |
3227 const TProfileToneSettings& ts = tones.ToneSettings(); |
3222 iWarningAndPlayTones = ts.iWarningAndGameTones; |
3228 iWarningAndPlayTones = ts.iWarningAndGameTones; |
3223 iVolume = ts.iRingingVolume; |
3229 iVolume = ts.iRingingVolume; |
|
3230 TFLOGSTRING2( "CSatUiViewAppUi::GetProfileParamsL \ |
|
3231 iVolume before mapping %d", iVolume ) |
|
3232 |
|
3233 // Max volume from profile is KMaxVolumeFromProfile, Max volume from |
|
3234 // CMdaAudioToneUtility is different, maybe 10,000. So, |
|
3235 // rate = maxVolumeFromPlayer / KMaxVolumeFromProfile |
|
3236 // User may never hear the TONE, because volume is too small. |
|
3237 // iVolume times the rate make it can be heard. |
|
3238 |
|
3239 CMdaAudioToneUtility* toneUtl = CMdaAudioToneUtility::NewL( *this ); |
|
3240 TInt maxVolumeFromPlayer( toneUtl->MaxVolume() ); |
|
3241 iVolume *= maxVolumeFromPlayer / KMaxVolumeFromProfile; |
|
3242 delete toneUtl; |
|
3243 toneUtl = NULL; |
|
3244 TFLOGSTRING2( "CSatUiViewAppUi::GetProfileParamsL \ |
|
3245 iVolume after mapping %d", iVolume ) |
3224 |
3246 |
3225 if ( ( ESatUserSelectedToneIncomingSms == aTone ) && ( aToneName ) ) |
3247 if ( ( ESatUserSelectedToneIncomingSms == aTone ) && ( aToneName ) ) |
3226 { |
3248 { |
3227 TFLOGSTRING( "CSatUiViewAppUi::GetProfileParamsL message tone" ) |
3249 TFLOGSTRING( "CSatUiViewAppUi::GetProfileParamsL message tone" ) |
3228 aToneName->Copy( tones.MessageAlertTone() ); |
3250 aToneName->Copy( tones.MessageAlertTone() ); |