MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / DoAutosave

Method DoAutosave

Source/ModularSynth.cpp:3197–3213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3195}
3196
3197void ModularSynth::DoAutosave()
3198{
3199 const int kMaxAutosaveSlots = 10;
3200
3201 juce::File parentDirectory(ofToDataPath("savestate/autosave"));
3202 Array<juce::File> autosaveFiles;
3203 parentDirectory.findChildFiles(autosaveFiles, juce::File::findFiles, false, "*.bsk");
3204 if (autosaveFiles.size() >= kMaxAutosaveSlots)
3205 {
3206 FileTimeComparator cmp;
3207 autosaveFiles.sort(cmp, false);
3208 for (int i = kMaxAutosaveSlots; i < autosaveFiles.size(); ++i) //delete oldest files beyond slot limit
3209 autosaveFiles[i].deleteFile();
3210 }
3211
3212 SaveState(ofToDataPath(ofGetTimestampString("savestate/autosave/autosave_%Y-%m-%d_%H-%M-%S.bsk")), true);
3213}
3214
3215IDrawableModule* ModularSynth::SpawnModuleOnTheFly(ModuleFactory::Spawnable spawnable, float x, float y, bool addToContainer, std::string name)
3216{

Callers

nothing calls this directly

Calls 3

ofToDataPathFunction · 0.85
ofGetTimestampStringFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected