Skip to content

Commit b308854

Browse files
committed
Update PlayerDoc.cpp
1 parent d24b65b commit b308854

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

Player/PlayerDoc.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,10 @@ BEGIN_MESSAGE_MAP(CPlayerDoc, CDocument)
341341
END_MESSAGE_MAP()
342342

343343

344+
const TCHAR szPlayerInitFlags[] = _T("PlayerInitFlags");
345+
const TCHAR szMaximalResolution[] = _T("MaximalResolution");
346+
const TCHAR szUsingSAN[] = _T("UsingSAN");
347+
344348
// CPlayerDoc construction/destruction
345349

346350
CPlayerDoc::CPlayerDoc()
@@ -350,10 +354,22 @@ CPlayerDoc::CPlayerDoc()
350354
std::bind(&CPlayerDoc::getVideoSpeed, this))))
351355
{
352356
m_frameDecoder->setDecoderListener(this);
357+
358+
if (auto pApp = AfxGetApp())
359+
{
360+
m_maximalResolution = !!pApp->GetProfileInt(szPlayerInitFlags, szMaximalResolution, false);
361+
m_bUsingSAN = !!pApp->GetProfileInt(szPlayerInitFlags, szUsingSAN, true);
362+
}
353363
}
354364

355365
CPlayerDoc::~CPlayerDoc()
356366
{
367+
if (auto pApp = AfxGetApp())
368+
{
369+
pApp->WriteProfileInt(szPlayerInitFlags, szMaximalResolution, m_maximalResolution);
370+
pApp->WriteProfileInt(szPlayerInitFlags, szUsingSAN, m_bUsingSAN);
371+
}
372+
357373
onDestructing();
358374

359375
ASSERT(framePositionChanged.empty());

0 commit comments

Comments
 (0)