summaryrefslogtreecommitdiff
path: root/apps/plugins/announce_status.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/announce_status.c')
-rw-r--r--apps/plugins/announce_status.c19
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 ******************/
188static 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
189void announce(void) 194void 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')