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
This commit is contained in:
William Wilgus 2018-12-17 22:27:55 -06:00
parent b3356e3aff
commit a06d9c85f7
17 changed files with 619 additions and 336 deletions

View file

@ -78,34 +78,6 @@
#include "appevents.h"
#ifdef HAVE_RECORDING
/* This array holds the record timer interval lengths, in minutes */
static const unsigned short rec_timer_minutes[] =
{
0, /* 0 means OFF */
5, /* 00:05 */
10, /* 00:10 */
15, /* 00:15 */
30, /* 00:30 */
60, /* 01:00 */
74, /* 01:14 */
80, /* 01:20 */
2*60, /* 02:00 */
4*60, /* 04:00 */
6*60, /* 06:00 */
8*60, /* 08:00 */
10*60, /* 10:00 */
12*60, /* 12:00 */
18*60, /* 18:00 */
24*60 /* 24:00 */
};
static unsigned int rec_timesplit_seconds(void)
{
unsigned long tm_min = rec_timer_minutes[global_settings.rec_timesplit];
unsigned long tm_sec = tm_min * 60;
return tm_sec;
}
/* This array holds the record size interval lengths, in mebibytes */
static const unsigned short rec_size_mbytes[] =
{
@ -1003,8 +975,8 @@ bool recording_screen(bool no_source)
int audio_stat = 0; /* status of the audio system */
int last_audio_stat = -1; /* previous status so we can act on changes */
struct viewport vp_list[NB_SCREENS], vp_top[NB_SCREENS]; /* the viewports */
const long split_seconds = rec_timesplit_seconds();
const long split_bytes = rec_sizesplit_bytes();
const unsigned long split_seconds = (unsigned) global_settings.rec_timesplit;
const unsigned long split_bytes = rec_sizesplit_bytes();
#if CONFIG_CODEC == SWCODEC
int warning_counter = 0;