Skip to content

Commit

Permalink
Update PlayerDoc.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
aliakseis committed Apr 25, 2024
1 parent a94417a commit bf1e789
Showing 1 changed file with 32 additions and 4 deletions.
36 changes: 32 additions & 4 deletions Player/PlayerDoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,28 @@ void ensureSeparator(CString& filePath)
}
}

CString StrikeThrough(const CString& str, bool doIt)
{
if (!doIt)
return str;

CString result;
// Iterate over each character in the original string
for (int i = 0; i < str.GetLength(); ++i)
{
// Append the current character
result += str[i];
// Append the Combining Long Stroke Overlay character
result += L'\u0336';
}
return result;
}

CString NoBreak(CString s)
{
s.Replace(L' ', L'\u00A0');
return s;
}

std::unique_ptr<IAudioPlayer> GetAudioPlayer()
{
Expand Down Expand Up @@ -716,7 +738,7 @@ BOOL CPlayerDoc::OnSaveDocument(LPCTSTR lpszPathName)
strParams += _T(" -y \"");
strParams += lpszPathName;
strParams += _T('"');
TRACE(_T("FFmpeg parameters generated: %s\n"), strParams);
TRACE(_T("FFmpeg parameters generated: %s\n"), static_cast<LPCTSTR>(strParams));
}
TCHAR pszPath[MAX_PATH] = { 0 };
GetModuleFileName(NULL, pszPath, ARRAYSIZE(pszPath));
Expand Down Expand Up @@ -1245,8 +1267,7 @@ float CPlayerDoc::getVideoSpeed() const
}

CString CPlayerDoc::generateConversionScript(CString outputFolder) const
{

{
ensureSeparator(outputFolder);

std::vector<CString> videoFiles;
Expand Down Expand Up @@ -1573,7 +1594,14 @@ void CPlayerDoc::OnConvertVideosIntoCompatibleFormat()
}

CFolderPickerDialog dlg;
if (dlg.DoModal() != IDOK)
if (IDOK != dlg.DoModal()
|| IDOK != AfxMessageBox(_T("Destination: ") +
NoBreak(dlg.GetPathName()) + _T("\nOptions:") +
StrikeThrough(_T(" Multiple,"), !m_autoPlay) +
(m_autoPlay ? StrikeThrough(_T(" Preceding,"), !m_looping) : _T("")) +
StrikeThrough(_T(" Separate Audio Files,"), !m_separateFileDiff) +
StrikeThrough(_T(" Separate Subtitles"), !m_subtitlesFileDiff) + _T("\n\nConvert files?"),
MB_OKCANCEL | MB_ICONQUESTION))
{
CloseHandle(scriptFileHandle);
return;
Expand Down

0 comments on commit bf1e789

Please sign in to comment.