GUI: add setting to play on load
This commit is contained in:
parent
03383cff80
commit
86c1104529
|
@ -2112,6 +2112,7 @@ int FurnaceGUI::save(String path, int dmfVersion) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int FurnaceGUI::load(String path) {
|
int FurnaceGUI::load(String path) {
|
||||||
|
bool wasPlaying=e->isPlaying();
|
||||||
if (!path.empty()) {
|
if (!path.empty()) {
|
||||||
logI("loading module...");
|
logI("loading module...");
|
||||||
FILE* f=ps_fopen(path.c_str(),"rb");
|
FILE* f=ps_fopen(path.c_str(),"rb");
|
||||||
|
@ -2188,6 +2189,12 @@ int FurnaceGUI::load(String path) {
|
||||||
showWarning(e->getWarnings(),GUI_WARN_GENERIC);
|
showWarning(e->getWarnings(),GUI_WARN_GENERIC);
|
||||||
}
|
}
|
||||||
pushRecentFile(path);
|
pushRecentFile(path);
|
||||||
|
// do not auto-play a backup
|
||||||
|
if (path.find(backupPath)!=0) {
|
||||||
|
if (settings.playOnLoad==2 || (settings.playOnLoad==1 && wasPlaying)) {
|
||||||
|
play();
|
||||||
|
}
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1547,6 +1547,7 @@ class FurnaceGUI {
|
||||||
int noDMFCompat;
|
int noDMFCompat;
|
||||||
int removeInsOff;
|
int removeInsOff;
|
||||||
int removeVolOff;
|
int removeVolOff;
|
||||||
|
int playOnLoad;
|
||||||
unsigned int maxUndoSteps;
|
unsigned int maxUndoSteps;
|
||||||
String mainFontPath;
|
String mainFontPath;
|
||||||
String headFontPath;
|
String headFontPath;
|
||||||
|
@ -1708,6 +1709,7 @@ class FurnaceGUI {
|
||||||
noDMFCompat(0),
|
noDMFCompat(0),
|
||||||
removeInsOff(0),
|
removeInsOff(0),
|
||||||
removeVolOff(0),
|
removeVolOff(0),
|
||||||
|
playOnLoad(0),
|
||||||
maxUndoSteps(100),
|
maxUndoSteps(100),
|
||||||
mainFontPath(""),
|
mainFontPath(""),
|
||||||
headFontPath(""),
|
headFontPath(""),
|
||||||
|
|
|
@ -437,6 +437,17 @@ void FurnaceGUI::drawSettings() {
|
||||||
ImGui::SetTooltip("do not report any issues arising from the use of this option!");
|
ImGui::SetTooltip("do not report any issues arising from the use of this option!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui::Text("Play after opening song:");
|
||||||
|
if (ImGui::RadioButton("No##pol0",settings.playOnLoad==0)) {
|
||||||
|
settings.playOnLoad=0;
|
||||||
|
}
|
||||||
|
if (ImGui::RadioButton("Only if already playing##pol1",settings.playOnLoad==1)) {
|
||||||
|
settings.playOnLoad=1;
|
||||||
|
}
|
||||||
|
if (ImGui::RadioButton("Yes##pol0",settings.playOnLoad==2)) {
|
||||||
|
settings.playOnLoad=2;
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::Text("Audio export loop/fade out time:");
|
ImGui::Text("Audio export loop/fade out time:");
|
||||||
if (ImGui::RadioButton("Set to these values on start-up:##fot0",settings.persistFadeOut==0)) {
|
if (ImGui::RadioButton("Set to these values on start-up:##fot0",settings.persistFadeOut==0)) {
|
||||||
settings.persistFadeOut=0;
|
settings.persistFadeOut=0;
|
||||||
|
@ -2935,6 +2946,7 @@ void FurnaceGUI::syncSettings() {
|
||||||
settings.noDMFCompat=e->getConfInt("noDMFCompat",0);
|
settings.noDMFCompat=e->getConfInt("noDMFCompat",0);
|
||||||
settings.removeInsOff=e->getConfInt("removeInsOff",0);
|
settings.removeInsOff=e->getConfInt("removeInsOff",0);
|
||||||
settings.removeVolOff=e->getConfInt("removeVolOff",0);
|
settings.removeVolOff=e->getConfInt("removeVolOff",0);
|
||||||
|
settings.playOnLoad=e->getConfInt("playOnLoad",0);
|
||||||
|
|
||||||
clampSetting(settings.mainFontSize,2,96);
|
clampSetting(settings.mainFontSize,2,96);
|
||||||
clampSetting(settings.headFontSize,2,96);
|
clampSetting(settings.headFontSize,2,96);
|
||||||
|
@ -3068,6 +3080,7 @@ void FurnaceGUI::syncSettings() {
|
||||||
clampSetting(settings.noDMFCompat,0,1);
|
clampSetting(settings.noDMFCompat,0,1);
|
||||||
clampSetting(settings.removeInsOff,0,1);
|
clampSetting(settings.removeInsOff,0,1);
|
||||||
clampSetting(settings.removeVolOff,0,1);
|
clampSetting(settings.removeVolOff,0,1);
|
||||||
|
clampSetting(settings.playOnLoad,0,2);
|
||||||
|
|
||||||
if (settings.exportLoops<0.0) settings.exportLoops=0.0;
|
if (settings.exportLoops<0.0) settings.exportLoops=0.0;
|
||||||
if (settings.exportFadeOut<0.0) settings.exportFadeOut=0.0;
|
if (settings.exportFadeOut<0.0) settings.exportFadeOut=0.0;
|
||||||
|
@ -3301,6 +3314,7 @@ void FurnaceGUI::commitSettings() {
|
||||||
e->setConf("noDMFCompat",settings.noDMFCompat);
|
e->setConf("noDMFCompat",settings.noDMFCompat);
|
||||||
e->setConf("removeInsOff",settings.removeInsOff);
|
e->setConf("removeInsOff",settings.removeInsOff);
|
||||||
e->setConf("removeVolOff",settings.removeVolOff);
|
e->setConf("removeVolOff",settings.removeVolOff);
|
||||||
|
e->setConf("playOnLoad",settings.playOnLoad);
|
||||||
|
|
||||||
// colors
|
// colors
|
||||||
for (int i=0; i<GUI_COLOR_MAX; i++) {
|
for (int i=0; i<GUI_COLOR_MAX; i++) {
|
||||||
|
|
Loading…
Reference in a new issue