[prev in list] [next in list] [prev in thread] [next in thread] 

List:       rockbox-cvs
Subject:    quickscreen: fix EQ enable not working in quickscreen
From:       rockbox-gerrit-noreply--- via rockbox-cvs <rockbox-cvs () cool ! haxx ! se>
Date:       2021-08-26 19:34:19
Message-ID: 202108261934.17QJYJkn2366560 () stuffed ! shaftnet ! org
[Download RAW message or body]

commit 30e96a373210f47da7a25276d49d5f7672f893d5
Author: Aidan MacDonald <amachronic@protonmail.com>
Date:   Wed Aug 25 20:10:37 2021 +0100

    quickscreen: fix EQ enable not working in quickscreen
    
    The EQ enabled setting needs to call into the DSP core when it's
    changed but this was only hooked into the EQ menu. The quickscreen
    uses option_select_next_val() so those DSP hooks were not getting
    called because the setting did not have any callback defined.
    
    It seems this bug was introduced by 362f7a3220 removing the blanket
    call to settings_apply(). Other settings might be affected too.
    
    Change-Id: Idcce5809c525fa619e6bdf1be50c98a5df103fec

diff --git a/apps/menus/eq_menu.c b/apps/menus/eq_menu.c
index 656fe7b282..79389ae561 100644
--- a/apps/menus/eq_menu.c
+++ b/apps/menus/eq_menu.c
@@ -51,6 +51,8 @@
 #include "option_select.h"
 #include "string-extra.h"
 
+static void eq_apply(void);
+
 /*
  * Utility functions
  */
@@ -69,6 +71,12 @@ const char* eq_precut_format(char* buffer, size_t buffer_size, int value, const
     return buffer;
 }
 
+void eq_enabled_option_callback(bool enabled)
+{
+    (void)enabled;
+    eq_apply();
+}
+
 /*
  * Settings functions
  */
diff --git a/apps/menus/eq_menu.h b/apps/menus/eq_menu.h
index 04e8be2ead..f99f83d94f 100644
--- a/apps/menus/eq_menu.h
+++ b/apps/menus/eq_menu.h
@@ -48,4 +48,7 @@ const char* eq_q_format(char* buffer, size_t buffer_size, int value,
 const char* eq_precut_format(char* buffer, size_t buffer_size, int value,
                              const char* unit);
 
+/* callbacks for settings_list.c */
+void eq_enabled_option_callback(bool enabled);
+
 #endif
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 5464416b21..ab99b58a1c 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -1570,7 +1570,7 @@ const struct settings_list settings[] = {
 
     /* equalizer */
     OFFON_SETTING(F_EQSETTING, eq_enabled, LANG_EQUALIZER_ENABLED, false,
-                  "eq enabled", NULL),
+                  "eq enabled", eq_enabled_option_callback),
 
     INT_SETTING_NOWRAP(F_EQSETTING, eq_precut, LANG_EQUALIZER_PRECUT, 0,
                        "eq precut", UNIT_DB, 0, 240, 1, eq_precut_format,
_______________________________________________
rockbox-cvs mailing list
rockbox-cvs@cool.haxx.se
https://cool.haxx.se/cgi-bin/mailman/listinfo/rockbox-cvs

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic