GUI: add setting to play on load

This commit is contained in:
tildearrow 2023-08-05 14:43:29 -05:00
parent 03383cff80
commit 86c1104529
3 changed files with 23 additions and 0 deletions

View file

@ -2112,6 +2112,7 @@ int FurnaceGUI::save(String path, int dmfVersion) {
}
int FurnaceGUI::load(String path) {
bool wasPlaying=e->isPlaying();
if (!path.empty()) {
logI("loading module...");
FILE* f=ps_fopen(path.c_str(),"rb");
@ -2188,6 +2189,12 @@ int FurnaceGUI::load(String path) {
showWarning(e->getWarnings(),GUI_WARN_GENERIC);
}
pushRecentFile(path);
// do not auto-play a backup
if (path.find(backupPath)!=0) {
if (settings.playOnLoad==2 || (settings.playOnLoad==1 && wasPlaying)) {
play();
}
}
return 0;
}