@@ -10,7 +10,7 @@ extern bool gSkipAutosaveOnLaunch; | |||||
extern bool b_touchkeyboard_enable; | extern bool b_touchkeyboard_enable; | ||||
void settingsSave(std::string filename); | void settingsSave(std::string filename); | ||||
void settingsLoad(std::string filename, bool bWindowSizeOnly); | |||||
bool settingsLoad(std::string filename, bool bWindowSizeOnly); | |||||
} // namespace rack | } // namespace rack |
@@ -91,7 +91,8 @@ int vst2_init(int argc, char* argv[], bool _bFX) { | |||||
printf("xxx vst2_init: 9\n"); | printf("xxx vst2_init: 9\n"); | ||||
appInit(devMode); | appInit(devMode); | ||||
printf("xxx vst2_init: 10\n"); | printf("xxx vst2_init: 10\n"); | ||||
settingsLoad(assetLocal("settings.json"), false/*bWindowSizeOnly*/); | |||||
if(!settingsLoad(assetLocal("settings.json"), false/*bWindowSizeOnly*/)) | |||||
settingsLoad(assetLocal("settings_default.json"), false/*bWindowSizeOnly*/); | |||||
printf("xxx vst2_init: 11\n"); | printf("xxx vst2_init: 11\n"); | ||||
#if 0 | #if 0 | ||||
@@ -471,11 +471,11 @@ void settingsSave(std::string filename) { | |||||
} | } | ||||
} | } | ||||
void settingsLoad(std::string filename, bool bWindowSizeOnly) { | |||||
bool settingsLoad(std::string filename, bool bWindowSizeOnly) { | |||||
info("Loading settings %s", filename.c_str()); | info("Loading settings %s", filename.c_str()); | ||||
FILE *file = fopen(filename.c_str(), "r"); | FILE *file = fopen(filename.c_str(), "r"); | ||||
if (!file) | if (!file) | ||||
return; | |||||
return false; | |||||
json_error_t error; | json_error_t error; | ||||
json_t *rootJ = json_loadf(file, 0, &error); | json_t *rootJ = json_loadf(file, 0, &error); | ||||
@@ -488,6 +488,7 @@ void settingsLoad(std::string filename, bool bWindowSizeOnly) { | |||||
} | } | ||||
fclose(file); | fclose(file); | ||||
return true; | |||||
} | } | ||||