| 3195 | } |
| 3196 | |
| 3197 | void 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 | |
| 3215 | IDrawableModule* ModularSynth::SpawnModuleOnTheFly(ModuleFactory::Spawnable spawnable, float x, float y, bool addToContainer, std::string name) |
| 3216 | { |
nothing calls this directly
no test coverage detected