From 62e71036461529aed661d8e3993c4e314f2cb285 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 21 Nov 2016 13:51:09 +0100 Subject: [PATCH] Add sublabel --- intl/msg_hash_us.h | 4 ++++ menu/cbs/menu_cbs_sublabel.c | 14 ++++++++++++++ msg_hash.h | 6 ++++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 4f7ea642fb..04e63c8e10 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -2086,3 +2086,7 @@ MSG_HASH( MENU_ENUM_SUBLABEL_INPUT_ALL_USERS_CONTROL_MENU, "Allows any user to control the menu. If disabled, only User 1 can control the menu." ) +MSG_HASH( + MENU_ENUM_SUBLABEL_AUDIO_VOLUME, + "Audio volume (in dB). 0 dB is normal volume, no gain applied." + ) diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index dfd34f6dfe..6390a38230 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -523,6 +523,17 @@ static int action_bind_sublabel_input_all_users_control_menu( return 0; } +static int action_bind_sublabel_audio_volume( + file_list_t *list, + unsigned type, unsigned i, + const char *label, const char *path, + char *s, size_t len) +{ + + strlcpy(s, msg_hash_to_str(MENU_ENUM_SUBLABEL_AUDIO_VOLUME), len); + return 0; +} + int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, const char *path, const char *label, unsigned type, size_t idx) { @@ -535,6 +546,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, { switch (cbs->enum_idx) { + case MENU_ENUM_LABEL_AUDIO_VOLUME: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_audio_volume); + break; case MENU_ENUM_LABEL_INPUT_ALL_USERS_CONTROL_MENU: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_all_users_control_menu); break; diff --git a/msg_hash.h b/msg_hash.h index 0838a946b5..f141cd0549 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -1121,7 +1121,6 @@ enum msg_hash_enums /* Audio */ MENU_ENUM_LABEL_AUDIO_ENABLE, MENU_ENUM_LABEL_AUDIO_SYNC, - MENU_ENUM_LABEL_AUDIO_VOLUME, MENU_ENUM_LABEL_AUDIO_MAX_TIMING_SKEW, MENU_ENUM_LABEL_AUDIO_DEVICE, MENU_ENUM_LABEL_AUDIO_BLOCK_FRAMES, @@ -1137,10 +1136,13 @@ enum msg_hash_enums MENU_ENUM_LABEL_VALUE_AUDIO_BLOCK_FRAMES, MENU_ENUM_LABEL_VALUE_AUDIO_ENABLE, MENU_ENUM_LABEL_VALUE_AUDIO_SYNC, - MENU_ENUM_LABEL_VALUE_AUDIO_VOLUME, MENU_ENUM_LABEL_VALUE_AUDIO_MAX_TIMING_SKEW, MENU_ENUM_LABEL_VALUE_AUDIO_DEVICE, + MENU_ENUM_LABEL_AUDIO_VOLUME, + MENU_ENUM_SUBLABEL_AUDIO_VOLUME, + MENU_ENUM_LABEL_VALUE_AUDIO_VOLUME, + MENU_ENUM_LABEL_AUDIO_RATE_CONTROL_DELTA, MENU_ENUM_SUBLABEL_AUDIO_RATE_CONTROL_DELTA, MENU_ENUM_LABEL_VALUE_AUDIO_RATE_CONTROL_DELTA,