diff options
author | William Wilgus <wilgus.william@gmail.com> | 2021-08-18 01:23:26 -0400 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2021-08-19 01:17:29 +0000 |
commit | 24e8fa317e9905ee30d195c4beedd7b8939ed6e1 (patch) | |
tree | b1dbca81e43d045c2df6fa9848e3a5bb4e9d91e8 /apps/plugins/announce_status.c | |
parent | 4cbb5b42010309677f3590e3a716c69c12e8adf2 (diff) | |
download | rockbox-24e8fa317e9905ee30d195c4beedd7b8939ed6e1.tar.gz rockbox-24e8fa317e9905ee30d195c4beedd7b8939ed6e1.zip |
plugins trade talk_value for talk_value_decimal
talk_value is just talk_value_decimal with 0 decimals
lets add the extended function instead
static inline int talk_val(long n, int unit, bool enqueue)
{
#define NODECIMALS 0
return rb->talk_value_decimal(n, unit, NODECIMALS, enqueue);
}
Change-Id: Iaba3d2f95785f2e1855e294ccf099a977bb6cb20
Diffstat (limited to 'apps/plugins/announce_status.c')
-rw-r--r-- | apps/plugins/announce_status.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/apps/plugins/announce_status.c b/apps/plugins/announce_status.c index 84a44556ef..5a112ed6df 100644 --- a/apps/plugins/announce_status.c +++ b/apps/plugins/announce_status.c | |||
@@ -185,6 +185,11 @@ static void config_reset_voice(void) | |||
185 | } | 185 | } |
186 | 186 | ||
187 | /****************** helper fuctions ******************/ | 187 | /****************** helper fuctions ******************/ |
188 | static inline int talk_val(long n, int unit, bool enqueue) | ||
189 | { | ||
190 | #define NODECIMALS 0 | ||
191 | return rb->talk_value_decimal(n, unit, NODECIMALS, enqueue); | ||
192 | } | ||
188 | 193 | ||
189 | void announce(void) | 194 | void announce(void) |
190 | { | 195 | { |
@@ -658,7 +663,7 @@ static unsigned char* voice_info_group(unsigned char* current_token, bool testin | |||
658 | if (current_char == 'T') | 663 | if (current_char == 'T') |
659 | { | 664 | { |
660 | runtime = rb->global_status->runtime; | 665 | runtime = rb->global_status->runtime; |
661 | rb->talk_value(runtime, UNIT_TIME, true); | 666 | talk_val(runtime, UNIT_TIME, true); |
662 | } | 667 | } |
663 | /* prefix suffix connectives */ | 668 | /* prefix suffix connectives */ |
664 | else if (current_char == '1') | 669 | else if (current_char == '1') |
@@ -669,7 +674,7 @@ static unsigned char* voice_info_group(unsigned char* current_token, bool testin | |||
669 | { | 674 | { |
670 | if (current_char == 'S') | 675 | if (current_char == 'S') |
671 | { | 676 | { |
672 | rb->talk_value(sleep_remaining, UNIT_TIME, true); | 677 | talk_val(sleep_remaining, UNIT_TIME, true); |
673 | } | 678 | } |
674 | /* prefix suffix connectives */ | 679 | /* prefix suffix connectives */ |
675 | else if (current_char == '2') | 680 | else if (current_char == '2') |
@@ -704,15 +709,15 @@ static unsigned char* voice_info_group(unsigned char* current_token, bool testin | |||
704 | 709 | ||
705 | if (current_char == 'E') | 710 | if (current_char == 'E') |
706 | { | 711 | { |
707 | rb->talk_value(elapsed_length, UNIT_TIME, true); | 712 | talk_val(elapsed_length, UNIT_TIME, true); |
708 | } | 713 | } |
709 | else if (current_char == 'L') | 714 | else if (current_char == 'L') |
710 | { | 715 | { |
711 | rb->talk_value(track_length, UNIT_TIME, true); | 716 | talk_val(track_length, UNIT_TIME, true); |
712 | } | 717 | } |
713 | else if (current_char == 'R') | 718 | else if (current_char == 'R') |
714 | { | 719 | { |
715 | rb->talk_value(track_remaining, UNIT_TIME, true); | 720 | talk_val(track_remaining, UNIT_TIME, true); |
716 | } | 721 | } |
717 | else if (current_char == 'T' && id3->title) | 722 | else if (current_char == 'T' && id3->title) |
718 | { | 723 | { |
@@ -797,11 +802,11 @@ static unsigned char* voice_info_group(unsigned char* current_token, bool testin | |||
797 | 802 | ||
798 | if (current_char == 'P') | 803 | if (current_char == 'P') |
799 | { | 804 | { |
800 | rb->talk_value(rb->battery_level(), UNIT_PERCENT, true); | 805 | talk_val(rb->battery_level(), UNIT_PERCENT, true); |
801 | } | 806 | } |
802 | else if (current_char == 'M') | 807 | else if (current_char == 'M') |
803 | { | 808 | { |
804 | rb->talk_value(rb->battery_time() * 60, UNIT_TIME, true); | 809 | talk_val(rb->battery_time() * 60, UNIT_TIME, true); |
805 | } | 810 | } |
806 | /* prefix suffix connectives */ | 811 | /* prefix suffix connectives */ |
807 | else if (current_char == '1') | 812 | else if (current_char == '1') |