MCPcopy Create free account
hub / github.com/HertzDevil/0CC-FamiTracker / OnFileImportText

Method OnFileImportText

Source/MainFrm.cpp:1954–1977  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1952}
1953
1954void CMainFrame::OnFileImportText()
1955{
1956 CFamiTrackerDoc &Doc = GetDoc();
1957 if (!Doc.SaveModified())
1958 return;
1959
1960 if (auto path = GetLoadPath("", "", IDS_FILTER_TXT, L"*.txt")) {
1961 try {
1962 CTextExport { }.ImportFile(*path, Doc);
1963 }
1964 catch (std::runtime_error err) {
1965 AfxMessageBox(conv::to_wide(err.what()).data(), MB_OK | MB_ICONEXCLAMATION);
1966 }
1967
1968 SetSongInfo(*Doc.GetModule()); // // //
1969 Doc.SetModifiedFlag(FALSE);
1970 Doc.SetExceededFlag(false); // // //
1971 // TODO figure out how to handle this case, call OnInitialUpdate??
1972 //Doc.UpdateAllViews(NULL, CHANGED_ERASE); // Remove
1973 Doc.UpdateAllViews(NULL, UPDATE_PROPERTIES);
1974 Doc.UpdateAllViews(NULL, UPDATE_INSTRUMENT);
1975 FTEnv.GetSoundGenerator()->DocumentPropertiesChanged(&Doc);
1976 }
1977}
1978
1979void CMainFrame::OnFileExportText()
1980{

Callers

nothing calls this directly

Calls 10

GetLoadPathFunction · 0.85
to_wideFunction · 0.85
ImportFileMethod · 0.80
whatMethod · 0.80
GetModuleMethod · 0.80
SetModifiedFlagMethod · 0.80
SetExceededFlagMethod · 0.80
dataMethod · 0.45
GetSoundGeneratorMethod · 0.45

Tested by

no test coverage detected