diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2020-07-27 18:41:02 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2020-07-27 22:42:34 +0000 |
commit | 3f828e9244140e7860e961917fc96e42b2a866ca (patch) | |
tree | 6d063ae785df4616b4f909da11a802df47a95636 | |
parent | b9d13b898d6cb81f60eb819f53276a9ac1e11dad (diff) | |
download | rockbox-3f828e9.tar.gz rockbox-3f828e9.zip |
FS#13220: Allow sound settings to be saved again
(Basically this reverts bf546fbfcb and its successors)
Change-Id: I044cfb797d306412837e7509cb85b65bc6ffacca
-rw-r--r-- | apps/settings.c | 9 | ||||
-rw-r--r-- | apps/settings_list.c | 6 |
2 files changed, 4 insertions, 11 deletions
diff --git a/apps/settings.c b/apps/settings.c index 6cecffcb91..b72808b510 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -300,14 +300,7 @@ bool settings_load_config(const char* file, bool apply) #endif if (settings[i].cfg_vals == NULL) { - int temp = atoi(value); - if (settings[i].flags&F_ALLOW_ARBITRARY_VALS || - (temp >= settings[i].int_setting->min && - temp <= settings[i].int_setting->max && - temp % settings[i].int_setting->step == 0)) - { - *(int*)settings[i].setting = temp; - } + *(int*)settings[i].setting = atoi(value); } else { diff --git a/apps/settings_list.c b/apps/settings_list.c index e5e523da93..d322074962 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c @@ -93,7 +93,7 @@ /* Use for int settings which use the set_sound() function to set them */ #define SOUND_SETTING(flags,var,lang_id,name,setting) \ - {flags|F_T_INT|F_T_SOUND|F_SOUNDSETTING, &global_settings.var, \ + {flags|F_T_INT|F_T_SOUND|F_SOUNDSETTING|F_ALLOW_ARBITRARY_VALS, &global_settings.var, \ lang_id, NODEFAULT,name,NULL, \ {.sound_setting=(struct sound_setting[]){{setting}}} } @@ -817,14 +817,14 @@ const struct settings_list settings[] = { #endif /* HAVE_WM8978 */ #endif /* AUDIOHW_HAVE_EQ */ /* 3-d enhancement effect */ - CHOICE_SETTING(F_SOUNDSETTING, channel_config, LANG_CHANNEL_CONFIGURATION, + CHOICE_SETTING(0, channel_config, LANG_CHANNEL_CONFIGURATION, 0,"channels", "stereo,mono,custom,mono left,mono right,karaoke", sound_set_channels, 6, ID2P(LANG_CHANNEL_STEREO), ID2P(LANG_CHANNEL_MONO), ID2P(LANG_CHANNEL_CUSTOM), ID2P(LANG_CHANNEL_LEFT), ID2P(LANG_CHANNEL_RIGHT), ID2P(LANG_CHANNEL_KARAOKE)), - SOUND_SETTING(F_SOUNDSETTING, stereo_width, LANG_STEREO_WIDTH, + SOUND_SETTING(0, stereo_width, LANG_STEREO_WIDTH, "stereo_width", SOUND_STEREO_WIDTH), #ifdef AUDIOHW_HAVE_DEPTH_3D SOUND_SETTING(0,depth_3d, LANG_DEPTH_3D, "3-d enhancement", |