Categories: S60 | Symbian C++ | Telephony | Audio | Code Examples
This page was last modified 09:36, 9 April 2008.
CR Keys To Control Phone Volume API
From Forum Nokia Wiki
| Note! |
|---|
|
Purpose
CR Keys To Control Phone Volume API provides keys for controlling the phone volume of an ongoing call.
Use cases
- KTelephonyIncallEarVolume and KTelephonyIncallLoudspeakerVolume CR Keys can be used to increase or decrease the phone volume of an ongoing call.
Example code
Header Files:
#include <telephonyinternalcrkeys_partner.h> //CR Keys To Control Phone Volume #include <centralrepository.h> //CRepository
Link against:
centralrepository.lib //CRepository
Capabilities
CAPABILITY WriteUserData //required for Setting the Volume:
//Telephony Call Handling Persistent Info API. //This API provides information related to call handling. const TUid KCRUidCallHandling = {0x101F8784}; //Used by phone application, which contains the integer value //of Incall in ear piece betweeen 1-10. const TUint32 KTelephonyIncallEarVolume = 0x00000001; //Used by phone application, which contains the integer value //of Incall in Loud speaker betweeen 1-10. const TUint32 KTelephonyIncallLoudspeakerVolume = 0x00000002;
The telephony Incall volume of ear piece and loud speaker can be controlled by passing the "KTelephonyIncallEarVolume"or "TelephonyIncallLoudspeakerVolume" to Get() and Set() methods of CRepository.
//To create a CRepository object for accessing Phone Volume repository: iRepository = CRepository::NewL(KCRUidCallHandling);
The following is the code snippet for retrieving the Incall Ear Volume:
TBuf<3> lBufVol; TInt lVol; User::LeaveIfError(iRepository->Get(KTelephonyIncallEarVolume,lVol)); lBufVol.AppendNum(lVol); CEikonEnv::InfoWinL(_L("Phone Incall Ear Volume:"),lBufVol);
The following is the code snippet for retrieving the Incall Loud Speaker Volume:
TBuf<3> lBufVol; TInt lVol; User::LeaveIfError(iRepository->Get(KTelephonyIncallLoudspeakerVolume, lVol)); lBufVol.AppendNum(lVol); CEikonEnv::InfoWinL(_L("Phone Incall Loud Speaker Volume:"),lBufVol);
The following is the code snippet for setting the Incall Ear and Loud Speaker Volume:
TInt lVol = 6; TInt lErr = iRepository->Set(KTelephonyIncallEarVolume,lVol); TBuf<10> lBufErr; lBufErr.AppendNum(lErr); if ( lErr == KErrNone ) { CEikonEnv::InfoWinL(_L("Phone Ear Volume Set:"),_L("Successful")); } else { CEikonEnv::InfoWinL(_L("Phone Ear Volume Set Err:"),lBufErr); } lBufErr.Zero(); lErr = iRepository->Set(KTelephonyIncallLoudspeakerVolume,lVol); lBufErr.AppendNum(lErr); if ( lErr == KErrNone ) { CEikonEnv::InfoWinL(_L("Phone Loud Speaker Volume Set:"),_L("Successful")); } else { CEikonEnv::InfoWinL(_L("Phone Loud Speaker Vol Set Err:"),lBufErr); }
Example Project
Example application to Control Phone Volume
Example application to Control Phone Earpiece/loudspeaker
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| EDWIN that accepts only numbers? | rahulchavan_2000 | General Symbian C++ | 4 | 2005-04-20 13:30 |
| S60 platform | desijatt | Series 40 & S60 Platform Feedback | 7 | 2007-02-02 18:32 |
| Nokia 6230i: Ascending call alert starting at MINIMUM volume? | tommm1 | General Discussion | 0 | 2005-12-08 13:49 |
| CAknDoubleGraphicStyleListBox not operating on arrow keys. | vp_mhaske | General Symbian C++ | 2 | 2006-11-16 11:24 |
| Using front panel keys on S80 | EManahov | Symbian User Interface | 0 | 2005-07-31 19:33 |
