| 17 | }; |
| 18 | |
| 19 | void PresetManager::Reset(const CString &filepath) |
| 20 | { |
| 21 | path = filepath; |
| 22 | |
| 23 | char buf[128*64+2]; |
| 24 | GetPrivateProfileSectionNames(buf,128*64+2,path); |
| 25 | |
| 26 | CString name; |
| 27 | char *p = buf; |
| 28 | std::set<CString> sects; |
| 29 | |
| 30 | while(1) |
| 31 | { |
| 32 | name = ""; |
| 33 | |
| 34 | while(*p!='\0') |
| 35 | name.AppendChar(*p++); |
| 36 | p++; |
| 37 | |
| 38 | if(name == "") break; |
| 39 | |
| 40 | if(name.Left(6)=="PRESET") |
| 41 | sects.insert(name); |
| 42 | } |
| 43 | |
| 44 | presetSect2Name.clear(); |
| 45 | presetName2Sect.clear(); |
| 46 | |
| 47 | std::set<CString>::iterator it; |
| 48 | for(it=sects.begin();it!=sects.end();it++) |
| 49 | { |
| 50 | GetPrivateProfileString((*it),"NAME","ERROR",buf,128,path); |
| 51 | presetName2Sect[(CString)buf]=(*it); |
| 52 | presetSect2Name[(*it)] = (CString)buf; |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | bool |
| 57 | PresetManager::CreatePreset( xgm::NSFPlayerConfigIni *cfg, const CString &name ) |