change a ringtone programatically in profile

王朝other·作者佚名  2006-01-09
宽屏版  字体: |||超大  

http://forum.newlc.com/index.php/topic,229.15.html

Include <profileApi.h> and link with ProfileEngine.lib

Code:

_LIT(KProfileDatabase,"c:\\system\\Apps\\profileApp\\dbProfile.db");

_LIT(KGeneral,"PRS0");

_LIT(KRingtone,"c:\\system\\data\\profiles\\ring.mid")

CPermanentFileStore* fstore = CPermanentFileStore::OpenLC(CEikonEnv::Static()->FsSession(),KProfileDatabase,EFileRead|EFileWrite);

RDbStoreDatabase database;

database.OpenL(fstore,fstore->Root());

RDbTable table;

table.Open(database, KGeneral);

table.FirstL();

table.UpdateL();

TDbColType colType = table.ColType(5);

if ((!table.IsColNull(5)) && (colType == EDbColLongText))

{

RDbColWriteStream writeStream;

writeStream.OpenL(table, 5);

writeStream.WriteL(KRingtone());

writeStream.Close();

table.PutL();

}

table.Close();

database.Close();

store->CommitL();

CleanupStack::PopAndDestroy(store);

this will only work with Series60 platform 1.0 it doesn't work with N6600 or S60 Platform 2.0 Phones

I'm trying to edit the profiles in a series 60 >1.0 too, and I found them in seperate files (for every profile) in the C:\System\Data\Profiles directory of my 6630. I decoded the format partly (see below), I have no idea how the checksum should be constructed though, and what happens if it's not correct. Who can help me?

4 bytes adress or something ...

4 bytes adress or something ...

2 bytes

1 byte profile number

4 bytes

1 byte (n :=) profile name length

2n bytes profile name

1 byte

1 byte (n :=) number of groups to accept incoming call from

4n bytes group related

1 byte (n :=) ringtone path length

2n bytes ringtone path

1 byte

1 byte (n :=) ringtone 2 path length

2n bytes ringtone 2 path

1 byte

1 byte (n :=) message alert tone path length

2n bytes message alert tone path

1 byte

1 byte ringing type

3 bytes

1 byte keypad tones

4 bytes

1 byte Vibrating alert

1 byte warning tones

1 byte (n :=) chat alert tone path length

2n bytes chat alert tone path

1

1 byte (n :=) chat alert tone path length

2n bytes chat alert tone path

9 bytes

4 bytes checksum (probably)

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
© 2005- 王朝网络 版权所有