void Resume::ReadVlcResumeFile() { Sleep(100); //wait for VLC to write file (TODO: make threaded) //get username TCHAR username[UNLEN + 1]; DWORD username_len = UNLEN + 1; GetUserName(username, &username_len); RString strTemp; RString strVlcFile; //build path to vlc info file RString strFilePath = _T("C:\\Users\\"); strFilePath += username; strFilePath += _T("\\AppData\\Roaming\\vlc\\vlc-qt-interface.ini"); //read VLC resume file into str if (!FileToString(strFilePath, strVlcFile)) return; if (GetFirstMatch(strVlcFile, _T("list=([^$]*?$)"), &strTemp)) { strTemp.Replace(_T(" "), _T("")); RArray<const TCHAR*> moviesTemp = SplitString(strTemp, _T(","), true); size = moviesTemp.GetSize(); if (size > MAX_SIZE) size = MAX_SIZE; for(int i=0; i<size; i++) { //remove % codes and turn + to space RString strTempMovie = URLDecode(moviesTemp[i]); //remove file:/// or file:// if (strTempMovie.Left(8) == _T("file:///")) strTempMovie = strTempMovie.Right(strTempMovie.GetLength() - 8); else strTempMovie = strTempMovie.Right(strTempMovie.GetLength() - 5); strTempMovie.Replace(_T("/"), _T("\\\\")); movies[i] = strTempMovie; } } if (GetFirstMatch(strVlcFile, _T("times=([^$]*?$)"), &strTemp)) { strTemp.Replace(_T(" "), _T("")); RArray<const TCHAR*> strTimes = SplitString(strTemp, _T(","), true); for(int i=0; i<strTimes.GetSize(); i++) times[i] = StringToNumber(strTimes[i])/1000; //milliseconds to seconds } UpdateResumeTimes(); }