All pastes #629519 Raw Edit

Anonymous

public text v1 · immutable
#629519 ·published 2007-07-22 11:37 UTC
rendered paste body
Index: apps/lang/english.lang
===================================================================
--- apps/lang/english.lang	(révision 13956)
+++ apps/lang/english.lang	(copie de travail)
@@ -3199,13 +3199,13 @@
   desc: Backlight behaviour setting
   user:
   <source>
-    *: "First Keypress Enables Backlight Only"
+    *: "Keypress effects when backlight is off"
   </source>
   <dest>
-    *: "First Keypress Enables Backlight Only"
+    *: "Keypress effects when backlight is off"
   </dest>
   <voice>
-    *: "First Keypress Enables Backlight Only"
+    *: "Keypress effects when backlight is off"
   </voice>
 </phrase>
 <phrase>
@@ -11048,3 +11048,65 @@
     *: "Can't write to recording directory"
   </voice>
 </phrase>
+<phrase>
+  id: LANG_BACKLIGHT_FILTER_MODE0
+  desc: Backlight behaviour setting
+  user:
+  <source>
+    *: "All: BL & action"
+  </source>
+  <dest>
+    *: "All: BL & action"
+  </dest>
+  <voice>
+    *: "All: BL & action"
+  </voice>
+</phrase>
+<phrase>
+  id: LANG_BACKLIGHT_FILTER_MODE1
+  desc: Backlight behaviour setting
+  user:
+  <source>
+    *: "All: BL & no action"
+  </source>
+  <dest>
+    *: "All: BL & no action"
+  </dest>
+  <voice>
+    *: "All: BL & no action"
+  </voice>
+</phrase>
+<phrase>
+  id: LANG_BACKLIGHT_FILTER_MODE2
+  desc: Backlight behaviour setting
+  user:
+  <source>
+    *: "Select: BL, others: action & BL"
+    h300: "NAVI: BL, others: action & BL"
+  </source>
+  <dest>
+    *: "Select: BL, others: action & BL"
+    h300: "NAVI: BL, others: action & BL"
+  </dest>
+  <voice>
+    *: "Select: BL, others: action & BL"
+    h300: "NAVI: BL, others: action & BL"
+  </voice>
+</phrase>
+<phrase>
+  id: LANG_BACKLIGHT_FILTER_MODE3
+  desc: Backlight behaviour setting
+  user:
+  <source>
+    *: "Select: BL, Mode: action & BL, others: action"
+    h300: "NAVI: BL, A-B: action & BL, others: action"
+  </source>
+  <dest>
+    *: "Select: BL, Mode: action & BL, others: action"
+    h300: "NAVI: BL, A-B: action & BL, others: action"
+  </dest>
+  <voice>
+    *: "Select: BL, Mode: action & BL, others: action"
+    h300: "NAVI: BL, A-B: action & BL, others: action"
+  </voice>
+</phrase>
Index: apps/settings.h
===================================================================
--- apps/settings.h	(révision 13956)
+++ apps/settings.h	(copie de travail)
@@ -634,7 +634,7 @@
     bool party_mode;    /* party mode - unstoppable music */
     
 #ifdef HAVE_BACKLIGHT
-    bool bl_filter_first_keypress;   /* filter first keypress when dark? */
+    int bl_filter_first_keypress;   /* filter first keypress when dark? */
 #ifdef HAVE_REMOTE_LCD
     bool remote_bl_filter_first_keypress; /* filter first remote keypress when remote dark? */
 #endif
Index: apps/settings_list.c
===================================================================
--- apps/settings_list.c	(révision 13956)
+++ apps/settings_list.c	(copie de travail)
@@ -533,9 +533,9 @@
 #endif
 
 #ifdef HAVE_BACKLIGHT
-    OFFON_SETTING(0,bl_filter_first_keypress,
-        LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS, false,
-        "backlight filters first keypress", NULL),
+    {F_T_INT,GS(bl_filter_first_keypress), LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS,
+            INT(0),"backlight filters first keypress",
+            "mode0,mode1,mode2,mode3",UNUSED},
 #ifdef HAVE_REMOTE_LCD
     OFFON_SETTING(0,remote_bl_filter_first_keypress,
         LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS, false,
Index: firmware/export/button.h
===================================================================
--- firmware/export/button.h	(révision 13956)
+++ firmware/export/button.h	(copie de travail)
@@ -34,7 +34,7 @@
 void button_set_flip(bool flip); /* turn 180 degrees */
 #endif
 #ifdef HAVE_BACKLIGHT
-void set_backlight_filter_keypress(bool value);
+void set_backlight_filter_keypress(int value);
 #ifdef HAVE_REMOTE_LCD
 void set_remote_backlight_filter_keypress(bool value);
 #endif
Index: firmware/drivers/button.c
===================================================================
--- firmware/drivers/button.c	(révision 13956)
+++ firmware/drivers/button.c	(copie de travail)
@@ -53,7 +53,7 @@
 static bool flipped;  /* buttons can be flipped to match the LCD flip */
 #endif
 #ifdef HAVE_BACKLIGHT
-static bool filter_first_keypress;
+static int filter_first_keypress;
 #ifdef HAVE_REMOTE_LCD
 static bool remote_filter_first_keypress;
 #endif
@@ -82,6 +82,7 @@
     static bool post = false;
 #ifdef HAVE_BACKLIGHT
     static bool skip_release = false;
+    bool turn_backlight_on = true;
 #ifdef HAVE_REMOTE_LCD
     static bool skip_remote_release = false;
 #endif
@@ -236,14 +237,42 @@
                     }
                     else
 #endif
-                        if (!filter_first_keypress || is_backlight_on()
+                        if (is_backlight_on()
 #if BUTTON_REMOTE
                                 || (btn&BUTTON_REMOTE)
 #endif
                            )
+                        {
                             queue_post(&button_queue, btn, 0);
+                        }
                         else
+                        {
+                            switch (filter_first_keypress)
+                            {
+                                case 0:
+                                    queue_post(&button_queue, btn, NULL);
+                                    break;
+                                case 1:
+                                    skip_release = true;
+                                    break;
+                                case 2:
+                                    if (btn == BUTTON_SELECT)
+                                        skip_release = true;
+                                    else
+                                        queue_post(&button_queue, btn, NULL);
+                                    break;
+                                case 3:
+                                    if (btn == BUTTON_SELECT)
                             skip_release = true;
+                                    else
+                                    {
+                                        if (btn != BUTTON_MODE)
+                                            turn_backlight_on = false;
+                                        queue_post(&button_queue, btn, NULL);
+                                    }
+                                    break;
+                            }
+                        }
 #else /* no backlight, nothing to skip */
                     queue_post(&button_queue, btn, 0);
 #endif
@@ -254,11 +283,13 @@
                     remote_backlight_on();
                 else
 #endif
+                    if (turn_backlight_on)
+                    {
                     backlight_on();
-
                 reset_poweroff_timer();
             }
         }
+        }
         else
         {
             repeat = false;
@@ -352,7 +383,7 @@
     flipped = false;
 #endif
 #ifdef HAVE_BACKLIGHT
-    filter_first_keypress = false;
+    filter_first_keypress = 0;
 #ifdef HAVE_REMOTE_LCD
     remote_filter_first_keypress = false;
 #endif    
@@ -424,7 +455,7 @@
 #endif /* HAVE_LCD_BITMAP */
 
 #ifdef HAVE_BACKLIGHT
-void set_backlight_filter_keypress(bool value)
+void set_backlight_filter_keypress(int value)
 {
     filter_first_keypress = value;
 }
Index: uisimulator/sdl/button.c
===================================================================
--- uisimulator/sdl/button.c	(révision 13956)
+++ uisimulator/sdl/button.c	(copie de travail)
@@ -52,7 +52,7 @@
 #ifdef HAVE_BACKLIGHT
 static bool filter_first_keypress;
 
-void set_backlight_filter_keypress(bool value)
+void set_backlight_filter_keypress(int value)
 {
     filter_first_keypress = value;
 }