WEB开发网
开发学院手机开发Symbian 开发 symbian 来电铃声及情景模式设置 阅读

symbian 来电铃声及情景模式设置

 2010-08-11 12:19:00 来源:WEB开发网   
核心提示://设置信息提示声 信息铃声设置不需要重启情景模式TBool CRingManager::SetMsgRing(const TDesC& aPath){TInt ret = KErrNone;RFs aFs;aFs.Connect();if (!(BaflUtils::FileExists(aFs, aPath))){

//设置信息提示声 信息铃声设置不需要重启情景模式

TBool CRingManager::SetMsgRing(const TDesC& aPath)

{

TInt ret = KErrNone;

RFs aFs;

aFs.Connect();

if (!(BaflUtils::FileExists(aFs, aPath)))

{

ret = KErrNotFound;

}

aFs.Close();

if (ret == KErrNone)

{

const TUid KUidSound =

{

0x101f8798

};

CRepository* repository = CRepository::NewL(KUidSound);

TInt mode = -1;

repository->Get(0x7e000001, mode);

TInt k = mode << 24 | 0x06; //信息提示声

ret=repository->Set(k, aPath);

delete repository;

repository = NULL;

}

if (ret == KErrNone)

{

return TRUE;

}

else

{

return FALSE;

}

}

//=============================================================================

//获取信息提示声

TFileName CRingManager::GetMsgRing()

{

TFileName toneFile;

const TUid KUidSound =

{

0x101f8798

};

CRepository* repository = CRepository::NewL(KUidSound);

TInt mode = -1;

repository->Get(0x7e000001, mode);

TInt k = mode << 24 | 0x06; //信息提示声

repository->Get(k,toneFile);

delete repository;

repository = NULL;

return toneFile;

}

//=============================================================================

//设置振动开关

TBool CRingManager::SetLibrateRing(TBool bOpen)

{

//设置当前情景模式与铃声

const TUid KUidSound =

{

0x101f8798

};

CRepository* repository = CRepository::NewL(KUidSound);

上一页  1 2 3 4 5  下一页

Tags:symbian 来电 铃声

编辑录入:coldstar [复制链接] [打 印]
赞助商链接