| 91 | } |
| 92 | |
| 93 | BOOL CFamiTrackerDoc::OnOpenDocument(LPCWSTR lpszPathName) |
| 94 | { |
| 95 | // This function is called by the GUI to load a file |
| 96 | |
| 97 | //DeleteContents(); |
| 98 | FTEnv.GetSoundGenerator()->ResetDumpInstrument(); |
| 99 | FTEnv.GetSoundGenerator()->SetRecordChannel({ }); // // // |
| 100 | |
| 101 | // Load file |
| 102 | if (!Locked([&] { return OpenDocument(lpszPathName); })) { // // // |
| 103 | // Loading failed, create empty document |
| 104 | /* |
| 105 | DeleteContents(); |
| 106 | CreateEmpty(); |
| 107 | for (int i = UPDATE_TRACK; i <= UPDATE_COLUMNS; ++i) // // // test |
| 108 | UpdateAllViews(NULL, i); |
| 109 | */ |
| 110 | // and tell doctemplate that loading failed |
| 111 | return FALSE; |
| 112 | } |
| 113 | |
| 114 | // Update main frame |
| 115 | FTEnv.GetSoundGenerator()->ModuleChipChanged(); // // // |
| 116 | |
| 117 | #ifdef AUTOSAVE |
| 118 | SetupAutoSave(); |
| 119 | #endif |
| 120 | |
| 121 | // Remove modified flag |
| 122 | SetModifiedFlag(FALSE); |
| 123 | SetExceededFlag(FALSE); // // // |
| 124 | |
| 125 | if (auto *pMainFrame = FTEnv.GetMainFrame()) // // // |
| 126 | pMainFrame->SelectTrack(0); |
| 127 | |
| 128 | return TRUE; |
| 129 | } |
| 130 | |
| 131 | BOOL CFamiTrackerDoc::OnSaveDocument(LPCWSTR lpszPathName) |
| 132 | { |
no test coverage detected