summaryrefslogtreecommitdiff
path: root/apps/gui/option_select.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2023-12-08 20:30:59 -0500
committerSolomon Peachy <pizza@shaftnet.org>2024-04-21 18:27:11 -0400
commit7b1dd6b60a1b39468be02bb7a1e71f4be354ce0f (patch)
tree877e3de05638c85d6876b64d536232951e47db88 /apps/gui/option_select.c
parente8a51569ada3bfd85fc0c93911bd5061ce3b6017 (diff)
downloadrockbox-7b1dd6b60a1b39468be02bb7a1e71f4be354ce0f.tar.gz
rockbox-7b1dd6b60a1b39468be02bb7a1e71f4be354ce0f.zip
RFC: Extend skin engine to handle EQ settings
EQ settings are actually an array of 3 ints. I added a skin parameter token that allows specifying which array element to use. So instead of this now-incorrect syntax: %St(0,0,-,-,image,eqbar.bmp,vertical,setting,eq band 1 gain) You would use: %St(0,0,-,-,image,eqbar.bmp,vertical,soffset,2,setting,eq peak filter 1) (the 'gain' is the third element in the eq setting array, thus soffset 2) Change-Id: Ibda712ab87759efb45420566c967742bcefb513b
Diffstat (limited to 'apps/gui/option_select.c')
-rw-r--r--apps/gui/option_select.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/gui/option_select.c b/apps/gui/option_select.c
index afc11fc4ee..1ce7fd5026 100644
--- a/apps/gui/option_select.c
+++ b/apps/gui/option_select.c
@@ -594,7 +594,7 @@ bool option_screen(const struct settings_list *setting,
594 return false; 594 return false;
595} 595}
596 596
597int get_setting_info_for_bar(const struct settings_list *setting, int *count, int *val) 597int get_setting_info_for_bar(const struct settings_list *setting, int offset, int *count, int *val)
598{ 598{
599 int var_type = setting->flags&F_T_MASK; 599 int var_type = setting->flags&F_T_MASK;
600 void (*function)(int) = NULL; 600 void (*function)(int) = NULL;
@@ -602,7 +602,9 @@ int get_setting_info_for_bar(const struct settings_list *setting, int *count, in
602 602
603 if (var_type == F_T_INT || var_type == F_T_UINT) 603 if (var_type == F_T_INT || var_type == F_T_UINT)
604 { 604 {
605 oldvalue = *(int*)setting->setting; 605 if (!(setting->flags&F_EQSETTING) || offset > 2)
606 offset = 0;
607 oldvalue = ((int*)setting->setting)[offset];
606 } 608 }
607 else if (var_type == F_T_BOOL) 609 else if (var_type == F_T_BOOL)
608 { 610 {
@@ -620,14 +622,16 @@ int get_setting_info_for_bar(const struct settings_list *setting, int *count, in
620} 622}
621 623
622#ifdef HAVE_TOUCHSCREEN 624#ifdef HAVE_TOUCHSCREEN
623void update_setting_value_from_touch(const struct settings_list *setting, int selection) 625void update_setting_value_from_touch(const struct settings_list *setting, int offset, int selection)
624{ 626{
625 int new_val = selection_to_val(setting, selection); 627 int new_val = selection_to_val(setting, selection);
626 int var_type = setting->flags&F_T_MASK; 628 int var_type = setting->flags&F_T_MASK;
627 629
628 if (var_type == F_T_INT || var_type == F_T_UINT) 630 if (var_type == F_T_INT || var_type == F_T_UINT)
629 { 631 {
630 *(int*)setting->setting = new_val; 632 if (!(setting->flags&F_EQSETTING) || offset > 2)
633 offset = 0;
634 ((int*)setting->setting)[offset] = new_val;
631 } 635 }
632 else if (var_type == F_T_BOOL) 636 else if (var_type == F_T_BOOL)
633 { 637 {