diff -r 427125ac6cb8 -r 7eb70891911c satui/satapp/src/satappplaytoneprovider.cpp --- a/satui/satapp/src/satappplaytoneprovider.cpp Thu May 27 13:23:05 2010 +0300 +++ b/satui/satapp/src/satappplaytoneprovider.cpp Fri Jun 11 14:07:16 2010 +0300 @@ -21,8 +21,8 @@ #include #include #include -#include //KAudioPriorityLowLevel -#include //KMdaRepeatForever +#include //KAudioPriorityLowLevel +#include //KMdaRepeatForever #include // timeout callback #include //playtone note #include // for CMdaAudioToneUtility&CMdaAudioPlayerUtility @@ -40,6 +40,11 @@ // Audio sample is repeated indefinitely. const TInt KSoundPlayerRepeatForever = KMdaRepeatForever; +// The max volume value from settings. +// From TProfileToneSettings.h +const TInt KMaxVolumeFromProfile( 10 ); + + // ---------------------------------------------------------------------------- // SatAppPlayToneProvider::SatAppPlayToneProvider // (other items were commented in a header). @@ -220,6 +225,24 @@ const TProfileToneSettings& ts = tones.ToneSettings(); mWarningAndPlayTones = ts.iWarningAndGameTones; mVolume = ts.iRingingVolume; + + TFLOGSTRING2( "SatAppCommandHandler::GetProfileParamsL \ + mVolume before mapping %d", mVolume ) + + // Max volume from profile is KMaxVolumeFromProfile, Max volume from + // CMdaAudioToneUtility is different, maybe 10,000. So, + // rate = maxVolumeFromPlayer / KMaxVolumeFromProfile + // User may never hear the TONE, because volume is too small. + // iVolume times the rate make it can be heard. + + CMdaAudioToneUtility* toneUtl = CMdaAudioToneUtility::NewL( *this ); + TInt maxVolumeFromPlayer( toneUtl->MaxVolume() ); + mVolume *= maxVolumeFromPlayer / KMaxVolumeFromProfile; + delete toneUtl; + toneUtl = NULL; + TFLOGSTRING2( "CSatUiViewAppUi::GetProfileParamsL \ + mVolume after mapping %d", mVolume ) + if ( ( ESatUserSelectedToneIncomingSms == aTone ) && ( aToneName ) ) { TFLOGSTRING("SatAppCommandHandler::GetProfileParamsL message tone")