summaryrefslogtreecommitdiffstats
path: root/apps/menus/sound_menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/menus/sound_menu.c')
-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
);
-