You Are Here:

Community: Wiki

This page was last modified on 29 September 2009, at 12:37.

CR Keys To Control Phone Volume API

From Forum Nokia Wiki

Reviewer Approved   
Note!
This API is not part of the public SDK. It can be found in the SDK API Plug-in.


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 Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZdescriptionQSxEa0E20WikiE20javaE20symbianE5fosE20s60E20maemoE20cE2bE2bE20WikiE20HomeE20WikiE20HelpE20OverviewE20GlossaryE20CreateE20PageE20ProposeE20anE20ArticleE20SpotlightE20TopicE20E2dE20WE52TE20WidgetsE20ProgrammingE20E4canguageE20E2dE20SymbianE20CE2bE2bE20E2dE20OpenE20CE2fCE2bE2bE20E2dE20JavaE20E2dE20FlashE20E4citeE20E2dE20PythonE20WebE20TechnologiesE20E2dE20WE52TE20WidgetsE20E2dE20WidSetsE20ToolsE20andE20SE44KE20CodeE20E45E78amplesE20KnowledgeE20BaseE20TechnologyE20AreasE20SoftwareE20PlatformsE20E44evelopmentE20ProcessE20E3fE3fWikiE20ChineseE20E3fE3fE3fWikiE20JapaneseE20PortugueseE2fBrazilianE20E52ussianE20WhatE20linksE20hereE20UploadE20fileE20SpecialE20pagesE20PrintableE20versionE44ownloadE20asE20PE44FE20GoE20ToE20E2eE2eE2eX qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fMusicE5fPlayerE5fE52emoteE5fControlE5fAPIX qdcZpublisherQUxhttpE3aE2fE2fswE2enokiaE2ecomE2fidE2fc764fd1cE2d8b06E2d499aE2d9a6aE2d17c3903d5a65E2fforumE5fnokiaE5fcrawlerE5fagentX qdcZtitleQSxMusicE20PlayerE20E52emoteE20ControlE20APIE20E2dE20ForumE20NokiaE20WikiX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qrssZdescriptionQSxEa0E20WikiE20javaE20symbianE5fosE20s60E20maemoE20cE2bE2bE20WikiE20HomeE20WikiE20HelpE20OverviewE20GlossaryE20CreateE20PageE20ProposeE20anE20ArticleE20SpotlightE20TopicE20E2dE20WE52TE20WidgetsE20ProgrammingE20E4canguageE20E2dE20SymbianE20CE2bE2bE20E2dE20OpenE20CE2fCE2bE2bE20E2dE20JavaE20E2dE20FlashE20E4citeE20E2dE20PythonE20WebE20TechnologiesE20E2dE20WE52TE20WidgetsE20E2dE20WidSetsE20ToolsE20andE20SE44KE20CodeE20E45E78amplesE20KnowledgeE20BaseE20TechnologyE20AreasE20SoftwareE20PlatformsE20E44evelopmentE20ProcessE20E3fE3fWikiE20ChineseE20E3fE3fE3fWikiE20JapaneseE20PortugueseE2fBrazilianE20E52ussianE20WhatE20linksE20hereE20UploadE20fileE20SpecialE20pagesE20PrintableE20versionE44ownloadE20asE20PE44FE20GoE20ToE20E2eE2eE2eX qfnZdistributionQUxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2fX qfnZtopicQUqfnTopicZaudioQRqdcZtypeQUqrdfsZE52esourceQRqmarsZrelevanceQNx100X qfnZtopicQUqfnTopicZmultimediaQRqmarsZrelevanceQNx100X qfnZtopicQUqfnTopicZseriesE5f60QRqdcZtypeQUqrdfsZE52esourceQRqmarsZrelevanceQNx100X qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qfnZupdatedQDx2008E2d10E2d02X qfnZuserE5ftagQSxaudioX qfnZuserE5ftagQSxmultimediaX qfnZuserE5ftagQSxs60X qmarsZdescriptionQSxEa0E20WikiE20javaE20symbianE5fosE20s60E20maemoE20cE2bE2bE20WikiE20HomeE20WikiE20HelpE20OverviewE20GlossaryE20CreateE20PageE20ProposeE20anE20ArticleE20SpotlightE20TopicE20E2dE20WE52TE20WidgetsE20ProgrammingE20E4canguageE20E2dE20SymbianE20CE2bE2bE20E2dE20OpenE20CE2fCE2bE2bE20E2dE20JavaE20E2dE20FlashE20E4citeE20E2dE20PythonE20WebE20TechnologiesE20E2dE20WE52TE20WidgetsE20E2dE20WidSetsE20ToolsE20andE20SE44KE20CodeE20E45E78amplesE20KnowledgeE20BaseE20TechnologyE20AreasE20SoftwareE20PlatformsE20E44evelopmentE20ProcessE20E3fE3fWikiE20ChineseE20E3fE3fE3fWikiE20JapaneseE20PortugueseE2fBrazilianE20E52ussianE20WhatE20linksE20hereE20UploadE20fileE20SpecialE20pagesE20PrintableE20versionE44ownloadE20asE20PE44FE20GoE20ToE20E2eE2eE2eX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ