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-3f828e9244140e7860e961917fc96e42b2a866ca.tar.gz rockbox-3f828e9244140e7860e961917fc96e42b2a866ca.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) | |||
300 | #endif | 300 | #endif |
301 | if (settings[i].cfg_vals == NULL) | 301 | if (settings[i].cfg_vals == NULL) |
302 | { | 302 | { |
303 | int temp = atoi(value); | 303 | *(int*)settings[i].setting = atoi(value); |
304 | if (settings[i].flags&F_ALLOW_ARBITRARY_VALS || | ||
305 | (temp >= settings[i].int_setting->min && | ||
306 | temp <= settings[i].int_setting->max && | ||
307 | temp % settings[i].int_setting->step == 0)) | ||
308 | { | ||
309 | *(int*)settings[i].setting = temp; | ||
310 | } | ||
311 | } | 304 | } |
312 | else | 305 | else |
313 | { | 306 | { |
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 @@ | |||
93 | 93 | ||
94 | /* Use for int settings which use the set_sound() function to set them */ | 94 | /* Use for int settings which use the set_sound() function to set them */ |
95 | #define SOUND_SETTING(flags,var,lang_id,name,setting) \ | 95 | #define SOUND_SETTING(flags,var,lang_id,name,setting) \ |
96 | {flags|F_T_INT|F_T_SOUND|F_SOUNDSETTING, &global_settings.var, \ | 96 | {flags|F_T_INT|F_T_SOUND|F_SOUNDSETTING|F_ALLOW_ARBITRARY_VALS, &global_settings.var, \ |
97 | lang_id, NODEFAULT,name,NULL, \ | 97 | lang_id, NODEFAULT,name,NULL, \ |
98 | {.sound_setting=(struct sound_setting[]){{setting}}} } | 98 | {.sound_setting=(struct sound_setting[]){{setting}}} } |
99 | 99 | ||
@@ -817,14 +817,14 @@ const struct settings_list settings[] = { | |||
817 | #endif /* HAVE_WM8978 */ | 817 | #endif /* HAVE_WM8978 */ |
818 | #endif /* AUDIOHW_HAVE_EQ */ | 818 | #endif /* AUDIOHW_HAVE_EQ */ |
819 | /* 3-d enhancement effect */ | 819 | /* 3-d enhancement effect */ |
820 | CHOICE_SETTING(F_SOUNDSETTING, channel_config, LANG_CHANNEL_CONFIGURATION, | 820 | CHOICE_SETTING(0, channel_config, LANG_CHANNEL_CONFIGURATION, |
821 | 0,"channels", | 821 | 0,"channels", |
822 | "stereo,mono,custom,mono left,mono right,karaoke", | 822 | "stereo,mono,custom,mono left,mono right,karaoke", |
823 | sound_set_channels, 6, | 823 | sound_set_channels, 6, |
824 | ID2P(LANG_CHANNEL_STEREO), ID2P(LANG_CHANNEL_MONO), | 824 | ID2P(LANG_CHANNEL_STEREO), ID2P(LANG_CHANNEL_MONO), |
825 | ID2P(LANG_CHANNEL_CUSTOM), ID2P(LANG_CHANNEL_LEFT), | 825 | ID2P(LANG_CHANNEL_CUSTOM), ID2P(LANG_CHANNEL_LEFT), |
826 | ID2P(LANG_CHANNEL_RIGHT), ID2P(LANG_CHANNEL_KARAOKE)), | 826 | ID2P(LANG_CHANNEL_RIGHT), ID2P(LANG_CHANNEL_KARAOKE)), |
827 | SOUND_SETTING(F_SOUNDSETTING, stereo_width, LANG_STEREO_WIDTH, | 827 | SOUND_SETTING(0, stereo_width, LANG_STEREO_WIDTH, |
828 | "stereo_width", SOUND_STEREO_WIDTH), | 828 | "stereo_width", SOUND_STEREO_WIDTH), |
829 | #ifdef AUDIOHW_HAVE_DEPTH_3D | 829 | #ifdef AUDIOHW_HAVE_DEPTH_3D |
830 | SOUND_SETTING(0,depth_3d, LANG_DEPTH_3D, "3-d enhancement", | 830 | SOUND_SETTING(0,depth_3d, LANG_DEPTH_3D, "3-d enhancement", |