symbian 来电铃声及情景模式设置
2010-08-11 12:19:00 来源:WEB开发网TInt mode = -1;
repository->Get(0x7e000001, mode);
TInt k = mode << 24 | 0x0a;
TInt ret = KErrNone;
ret = repository->Set(k, bOpen);
delete repository;
repository = NULL;
//重起情景模式。
MProfileEngine* profileEngine = CreateProfileEngineL();
CleanupReleasePushL(*profileEngine);
profileEngine->SetActiveProfileL(profileEngine->ActiveProfileId());
CleanupStack::PopAndDestroy(1);
if (ret == KErrNone)
{
return TRUE;
}
else
{
return FALSE;
}
}
TBool CRingManager::GetLibrateRing()
{
const TUid KUidSound =
{
0x101f8798
};
CRepository* repository = CRepository::NewL(KUidSound);
TInt mode = -1;
repository->Get(0x7e000001, mode);
TInt k = mode << 24 | 0x0a;
TBool bLibrate=false;
repository->Get(k,bLibrate);
delete repository;
repository = NULL;
return bLibrate;
}
//=============================================================================
//设置音量大小( aVolume(0,10))
TBool CRingManager::SetRingVolume(TInt aVolume)
{
if (aVolume < 1)
aVolume = 1;
if (aVolume > 10)
aVolume = 10;
const TUid KUidSound =
{
0x101f8798
};
CRepository* repository = CRepository::NewL(KUidSound);
TInt mode = -1,ret;
repository->Get(0x7e000001, mode);
for(int i=0;i<100;i++)
{
TInt k = mode << 24 | i;
ret=repository->Set(k, 1);
}
delete repository;
repository = NULL;
更多精彩
赞助商链接