summaryrefslogtreecommitdiff
path: root/apps/menus
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2021-03-14 12:48:56 -0400
committerSolomon Peachy <pizza@shaftnet.org>2021-04-07 14:38:54 -0400
commit213d372c929668417e7c89468a0adf284377b161 (patch)
tree4f4b9760fac4851dcdb9ae8bf738b1c7beee44e6 /apps/menus
parentc5cf15ed02aefe4f2654ae6a0b7794733125b8d2 (diff)
FS#13272: Fix up volume_limit to respect decimilaztion.
Change-Id: Ib0e5ddcd660115f156ddb545e45bbe7da42f9709
Diffstat (limited to 'apps/menus')
-rw-r--r--apps/menus/sound_menu.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/apps/menus/sound_menu.c b/apps/menus/sound_menu.c
index b88fc2a043..00fe006399 100644
--- a/apps/menus/sound_menu.c
+++ b/apps/menus/sound_menu.c
@@ -38,6 +38,14 @@
#include "option_select.h"
#include "misc.h"
+static const char* vol_limit_format(char* buffer, size_t buffer_size, int value,
+ const char* unit)
+{
+ (void)unit;
+ format_sound_value(buffer, buffer_size, SOUND_VOLUME, value);
+ return buffer;
+}
+
static int volume_limit_callback(int action,
const struct menu_item_ex *this_item,
struct gui_synclist *this_list)
@@ -51,13 +59,13 @@ static int volume_limit_callback(int action,
volume_limit_int_setting.min = sound_min(SOUND_VOLUME);
volume_limit_int_setting.max = sound_max(SOUND_VOLUME);
volume_limit_int_setting.step = sound_steps(SOUND_VOLUME);
- volume_limit_int_setting.formatter = NULL;
+ volume_limit_int_setting.formatter = vol_limit_format;
volume_limit_int_setting.get_talk_id = NULL;
struct settings_list setting;
setting.flags = F_BANFROMQS|F_INT_SETTING|F_T_INT|F_NO_WRAP;
setting.lang_id = LANG_VOLUME_LIMIT;
- setting.default_val.int_ = sound_max(SOUND_VOLUME);
+ setting.default_val.int_ = volume_limit_int_setting.max;
setting.int_setting = &volume_limit_int_setting;
switch (action)
@@ -253,4 +261,3 @@ MAKE_MENU(sound_settings, ID2P(LANG_SOUND_SETTINGS), NULL, Icon_Audio,
,&speaker_mode
#endif
);
-