1
0
Fork 0
forked from len0rd/rockbox

[BugFix] pitch screen load config fd wasn't closed

check file_exist(PITCH_CFG_FILE)
close fd when finished

If you already have a setting saved and you reenter the pitch plugin
with differing pitch settings you will be asked to restore your
default settings

update manual entry to be a clearer

Change-Id: Iaaaf08983a355f9848412d1c6b0bba25d6ea8f39
This commit is contained in:
William Wilgus 2025-01-18 11:08:13 -05:00
parent a8f6ddc5ed
commit c4ceea40bf
4 changed files with 49 additions and 31 deletions

View file

@ -1241,6 +1241,21 @@ enum plugin_status plugin_start(const void* parameter)
rb->settings_save();
}
gui = true;
if (rb->file_exists(CFG_FILE))
{
if (configfile_load(CFG_FILE, pitchcfg, 2, CFG_VER) >= 0)
{
if (pitch_vars.pitch != cur.pitch || pitch_vars.stretch != cur.stretch)
{
if (rb->yesno_pop(ID2P(LANG_REVERT_TO_DEFAULT_SETTINGS)))
{
rb->sound_set_pitch(pitch_vars.pitch);
rb->dsp_set_timestretch(pitch_vars.stretch);
}
}
}
}
}
else
{
@ -1294,9 +1309,7 @@ enum plugin_status plugin_start(const void* parameter)
if (pitch_vars.pitch != cur.pitch || pitch_vars.stretch != cur.stretch)
{
if (configfile_save(CFG_FILE, pitchcfg, 2, CFG_VER) >= 0)
rb->splash(HZ, ID2P(LANG_SETTINGS_SAVED));
else
if (configfile_save(CFG_FILE, pitchcfg, 2, CFG_VER) < 0)
rb->splash(HZ, ID2P(LANG_ERROR_WRITING_CONFIG));
}
}