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

Method DeleteContents

Source/FamiTrackerDoc.cpp:173–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171}
172
173void CFamiTrackerDoc::DeleteContents()
174{
175 // Current document is being unloaded, clear and reset variables and memory
176 // Delete everything because the current object is being reused in SDI
177
178 // Make sure player is stopped
179 FTEnv.GetSoundGenerator()->StopPlayer(); // // //
180 FTEnv.GetSoundGenerator()->WaitForStop();
181
182 Locked([&] { // // //
183 // Mark file as unloaded
184 m_bFileLoaded = false;
185 m_bForceBackup = false;
186 m_bBackupDone = true; // No backup on new modules
187
188 UpdateAllViews(NULL, UPDATE_CLOSE); // TODO remove
189 module_ = std::make_unique<CFamiTrackerModule>(); // // //
190 FTEnv.GetSoundGenerator()->DocumentPropertiesChanged(this); // // // rebind module
191 FTEnv.GetSoundGenerator()->ModuleChipChanged();
192
193#ifdef AUTOSAVE
194 ClearAutoSave();
195#endif
196
197 // Remove modified flag
198 SetModifiedFlag(FALSE);
199 SetExceededFlag(FALSE); // // //
200 });
201
202 CDocument::DeleteContents();
203}
204
205void CFamiTrackerDoc::SetModifiedFlag(BOOL bModified)
206{

Callers

nothing calls this directly

Calls 5

WaitForStopMethod · 0.80
ModuleChipChangedMethod · 0.80
StopPlayerMethod · 0.45
GetSoundGeneratorMethod · 0.45

Tested by

no test coverage detected