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

Method OnOpenDocument

Source/FamiTrackerDoc.cpp:93–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93BOOL 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
131BOOL CFamiTrackerDoc::OnSaveDocument(LPCWSTR lpszPathName)
132{

Callers 2

InitInstanceMethod · 0.80
CommandLineExportMethod · 0.80

Calls 6

ModuleChipChangedMethod · 0.80
SelectTrackMethod · 0.80
ResetDumpInstrumentMethod · 0.45
GetSoundGeneratorMethod · 0.45
SetRecordChannelMethod · 0.45
GetMainFrameMethod · 0.45

Tested by

no test coverage detected