summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorWilliam Wilgus <me.theuser@yahoo.com>2018-12-17 22:27:55 -0600
committerWilliam Wilgus <me.theuser@yahoo.com>2018-12-22 12:27:21 -0600
commita06d9c85f7475d650cc451fb0f537623c0206f5a (patch)
tree952a0e7265e836328873a5e2f6eb0ca8ec3cc06a /firmware
parentb3356e3aff34a4ab94778e7f6a8db43f9135296c (diff)
downloadrockbox-a06d9c85f7475d650cc451fb0f537623c0206f5a.tar.gz
rockbox-a06d9c85f7475d650cc451fb0f537623c0206f5a.tar.bz2
rockbox-a06d9c85f7475d650cc451fb0f537623c0206f5a.zip
Auto-Ranging Time Formatting For Menus (hh:mm:ss:mss)
Unifies time formatting in settings_list.c allows time format to display as HH:MM:SS.MSS or any consecutive combination thereof (hh:mm:ss, mm:ss, mm:ss.mss, ss.mss, hh, mm, ss ,mss) works in INT and TABLE settings with the addition of flag 'F_TIME_SETTING' Time is auto-ranged dependent on value Adds talk_time_intervals to allow time values to be spoken similar to display format: x Hours, x Minutes, x Seconds, x Milliseconds Table lookups merged or removed from recording, clip meter and lcd timeout -String_Choice replaced with TABLE_SETTING or INT_SETTING for these functions as well, cleaned-up cfg_vals that get saved to cfgfile RTL Languages ARE supported Negative values ARE supported Backlight on/off are now Always and Never to share formatter with LCD Timeout Added flag to allow ranged units to be locked to a minimum index Added flag to allow leading zero to be supressed from the largest unit merged talk_time_unit() and talk_time_intervals() optimized time_split() optimized format_time_auto() Backlight time-out list same as original Change-Id: I59027c62d3f2956bd16fdcc1a48b2ac32c084abd
Diffstat (limited to 'firmware')
-rw-r--r--firmware/backlight.c18
-rw-r--r--firmware/export/audio.h2
-rw-r--r--firmware/export/backlight.h2
3 files changed, 8 insertions, 14 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c
index 25c295197f..3acc89c27c 100644
--- a/firmware/backlight.c
+++ b/firmware/backlight.c
@@ -191,10 +191,6 @@ static int remote_backlight_on_button_hold = 0;
#ifdef HAVE_LCD_SLEEP
#ifdef HAVE_LCD_SLEEP_SETTING
-const signed char lcd_sleep_timeout_value[10] =
-{
- -1, 0, 5, 10, 15, 20, 30, 45, 60, 90
-};
static int lcd_sleep_timeout = 10*HZ;
#else
/* Target defines needed value */
@@ -885,23 +881,21 @@ void backlight_set_on_button_hold(int index)
#endif /* HAS_BUTTON_HOLD */
#ifdef HAVE_LCD_SLEEP_SETTING
-void lcd_set_sleep_after_backlight_off(int index)
+void lcd_set_sleep_after_backlight_off(int timeout_seconds)
{
- if ((unsigned)index >= sizeof(lcd_sleep_timeout_value))
- /* if given a weird value, use default */
- index = 3;
-
- lcd_sleep_timeout = HZ * lcd_sleep_timeout_value[index];
+ lcd_sleep_timeout = HZ * timeout_seconds;
if (is_backlight_on(true))
- /* Timer will be set when bl turns off or bl set to on. */
+ /* Timer will be set when bl turns off or bl set to on. */
return;
/* Backlight is Off */
if (lcd_sleep_timeout < 0)
+ lcd_sleep_timer = 0; /* Never */
+ else if (lcd_sleep_timeout == 0)
lcd_sleep_timer = 1; /* Always - sleep next tick */
else
- lcd_sleep_timer = lcd_sleep_timeout; /* Never, other */
+ lcd_sleep_timer = lcd_sleep_timeout; /* other */
}
#endif /* HAVE_LCD_SLEEP_SETTING */
diff --git a/firmware/export/audio.h b/firmware/export/audio.h
index 5710f9f653..5ed9c706a4 100644
--- a/firmware/export/audio.h
+++ b/firmware/export/audio.h
@@ -69,7 +69,7 @@ struct mp3entry* audio_current_track(void);
struct mp3entry* audio_next_track(void);
bool audio_peek_track(struct mp3entry* id3, int offset);
#ifdef HAVE_DISK_STORAGE
-void audio_set_buffer_margin(int setting);
+void audio_set_buffer_margin(int seconds);
#endif
void audio_error_clear(void);
int audio_get_file_pos(void);
diff --git a/firmware/export/backlight.h b/firmware/export/backlight.h
index 19e5f9b91b..a1c65a3b4e 100644
--- a/firmware/export/backlight.h
+++ b/firmware/export/backlight.h
@@ -57,7 +57,7 @@ void backlight_set_on_button_hold(int index);
#endif
#if defined(HAVE_LCD_SLEEP) && defined(HAVE_LCD_SLEEP_SETTING)
-void lcd_set_sleep_after_backlight_off(int index);
+void lcd_set_sleep_after_backlight_off(int timeout_seconds);
#endif
#else /* !HAVE_BACKLIGHT */