EXPORT_C_(uint32) CDVDopen(const char* title) { string path; int i = theApp.GetConfig("drive", -1); if(i >= 'A' && i <= 'Z') { path = format("\\\\.\\%c:", i); } else { path = theApp.GetConfig("iso", ""); } return s_cdvd.Open(path.c_str()) ? 0 : -1; }
EXPORT_C_(uint32) CDVDgetTD(uint8 track, cdvdTD* buff) { return s_cdvd.GetTD(track, buff); }
EXPORT_C_(uint32) CDVDgetTN(cdvdTN* buff) { return s_cdvd.GetTN(buff); }
EXPORT_C_(uint8*) CDVDgetBuffer() { return s_cdvd.GetBuffer(); }
EXPORT_C_(uint32) CDVDreadTrack(int lsn, int mode) { return s_cdvd.Read(lsn, mode) ? 0 : -1; }
EXPORT_C CDVDclose() { s_cdvd.Close(); }
void CDVDSettingsDlg::UpdateDrives() { int drive = theApp.GetConfig("drive", -1); INT_PTR data = 0; if(ComboBoxGetSelData(IDC_COMBO1, data)) { drive = (int)data; } vector<CDVDSetting> drives; for(int i = 'A'; i <= 'Z'; i++) { string path = format("%c:", i); if(GetDriveType(path.c_str()) == DRIVE_CDROM) { string label = path; path = format("\\\\.\\%c:", i); CDVD cdvd; if(cdvd.Open(path.c_str())) { string str = cdvd.GetLabel(); if(str.empty()) { str = "(no label)"; } label = "[" + label + "] " + str; } else { label = "[" + label + "] (未检测到)"; } CDVDSetting s; s.id = i; s.name = label; drives.push_back(s); } } { CDVDSetting s; s.id = -1; s.name = "其它..."; drives.push_back(s); } ComboBoxInit(IDC_COMBO1, &drives[0], drives.size(), drive); }