Public feed #726581

Unnamed

public text v1 · immutable
Raw Edit
·published 2007-10-05 10:37 UTC
rendered paste body
Index: apps/action.h
===================================================================
--- apps/action.h	(revision 14986)
+++ apps/action.h	(working copy)
@@ -83,6 +83,8 @@
     ACTION_STD_PREV, 
     ACTION_STD_PREVREPEAT,
     ACTION_STD_NEXT,
+    ACTION_TALK_INFO,
+    ACTION_GO_TO_RADIO,
     ACTION_STD_NEXTREPEAT,
     
     ACTION_STD_OK,
Index: apps/recorder/radio.c
===================================================================
--- apps/recorder/radio.c	(revision 14986)
+++ apps/recorder/radio.c	(working copy)
@@ -541,6 +541,9 @@
 #endif
         switch(button)
         {
+            case ACTION_TALK_INFO:
+                info ();
+                break;
              case ACTION_FM_STOP:
 #if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR)
                 if(audio_status() == AUDIO_STATUS_RECORD)
Index: apps/tree.c
===================================================================
--- apps/tree.c	(revision 14986)
+++ apps/tree.c	(working copy)
@@ -22,6 +22,7 @@
 #include <stdbool.h>
 
 #include "applimits.h"
+#include "radio.h"
 #include "dir.h"
 #include "file.h"
 #include "lcd.h"
@@ -609,6 +610,12 @@
         need_update = gui_synclist_do_button(&tree_lists, &button,LIST_WRAP_UNLESS_HELD);
         tc.selected_item = gui_synclist_get_sel_pos(&tree_lists);
         switch ( button ) {
+            case ACTION_TALK_INFO:
+                info ();
+                break;
+            case ACTION_GO_TO_RADIO:
+                radio_screen();
+                break;
             case ACTION_STD_OK:
                 /* nothing to do if no files to display */
                 if ( numentries == 0 )
@@ -663,12 +670,6 @@
             case ACTION_STD_MENU:
                 return GO_TO_ROOT;
                 break;
-
-#ifdef HAVE_RECORDING
-            case ACTION_STD_REC:
-                return GO_TO_RECSCREEN;
-#endif
-
             case ACTION_TREE_WPS:
                 return GO_TO_PREVIOUS_MUSIC;
                 break;
Index: apps/gui/gwps.c
===================================================================
--- apps/gui/gwps.c	(revision 14986)
+++ apps/gui/gwps.c	(working copy)
@@ -23,6 +23,8 @@
 
 #include "system.h"
 #include "file.h"
+#include "talk.h"
+#include "radio.h"
 #include "lcd.h"
 #include "font.h"
 #include "backlight.h"
@@ -234,6 +236,12 @@
 #endif
         switch(button)
         {
+            case ACTION_TALK_INFO:
+                info ();
+                break;
+            case ACTION_GO_TO_RADIO:
+                radio_screen();
+                break;
             case ACTION_WPS_CONTEXT:
 #if LCD_DEPTH > 1
                 show_main_backdrop();
Index: apps/alarm_menu.c
===================================================================
--- apps/alarm_menu.c	(revision 14986)
+++ apps/alarm_menu.c	(working copy)
@@ -27,6 +27,7 @@
 #include "kernel.h"
 #include "sprintf.h"
 #include <string.h>
+#include "radio.h"
 #include "settings.h"
 #include "power.h"
 #include "icons.h"
@@ -103,6 +104,12 @@
         button = get_action(CONTEXT_SETTINGS,HZ);
 
         switch(button) {
+            case ACTION_TALK_INFO:
+                info ();
+                break;
+            case ACTION_GO_TO_RADIO:
+                radio_screen();
+                break;
             case ACTION_STD_OK:
             /* prevent that an alarm occurs in the shutdown procedure */
             /* accept alarms only if they are in 2 minutes or more */
Index: apps/playlist_viewer.c
===================================================================
--- apps/playlist_viewer.c	(revision 14986)
+++ apps/playlist_viewer.c	(working copy)
@@ -28,6 +28,7 @@
 #include "screens.h"
 #include "status.h"
 #include "settings.h"
+#include "radio.h"
 #include "icons.h"
 #include "menu.h"
 #include "plugin.h"
@@ -663,6 +664,12 @@
 
                 break;
             }
+            case ACTION_TALK_INFO:
+                info ();
+                break;
+            case ACTION_GO_TO_RADIO:
+                radio_screen();
+                break;
             case ACTION_STD_CONTEXT:
             {
                 /* ON+PLAY menu */
Index: apps/talk.c
===================================================================
--- apps/talk.c	(revision 14986)
+++ apps/talk.c	(working copy)
@@ -27,6 +27,7 @@
 #include "file.h"
 #include "buffer.h"
 #include "system.h"
+#include "radio.h"
 #include "kernel.h"
 #include "settings.h"
 #include "mp3_playback.h"
@@ -864,3 +865,77 @@
 {    
     talk_menu_disable--;
 }
+
+void info (void)
+{
+    if(talk_menus_enabled ())
+    {
+        talk_id(LANG_BATTERY_MENU, true); /*Say "battery" instead of 
+            "battery level"*/
+        talk_value(battery_level(), UNIT_PERCENT, true);
+
+        /*voice the time code*/
+#if CONFIG_RTC
+                {
+                    struct tm* tm = get_time();
+                    talk_id(VOICE_CURRENT_TIME, true);
+                    if (global_settings.timeformat == 1)
+                    {
+                        long am_pm_id = VOICE_AM;
+                        int hour = tm->tm_hour;
+
+                        if (hour >= 12)
+                        {
+                            am_pm_id = VOICE_PM;
+                            hour -= 12;
+                        }
+                        if (hour == 0)
+                            hour = 12;
+                            
+                        talk_number(hour, true);
+
+                        /* Voice the minutes */
+                        if (tm->tm_min == 0)
+                        {
+                            /* Say o'clock if the minute is 0. */
+                            talk_id(VOICE_OCLOCK, true);
+                        }
+                        else
+                        {
+                            /* Pronounce the leading 0 */
+                            if(tm->tm_min < 10)
+                            {
+                                talk_id(VOICE_OH, true);
+                            }
+                            talk_number(tm->tm_min, true);
+                        }
+                        talk_id(am_pm_id, true);
+                    }
+                    else
+                    {
+                        /* Voice the time in 24 hour format */
+                        talk_number(tm->tm_hour, true);
+                        if (tm->tm_min == 0)
+                        {
+                            talk_id(VOICE_HUNDRED, true);
+                            talk_id(VOICE_HOUR, true);
+                        }
+                        else
+                        {
+                            /* Pronounce the leading 0 */
+                            if(tm->tm_min < 10)
+                            {
+                                talk_id(VOICE_OH, true);
+                            }
+                            talk_number(tm->tm_min, true);
+                        }
+                    }
+                    
+                    talk_id(LANG_MONTH_JANUARY + tm->tm_mon, true);
+                    talk_number(tm->tm_mday, true);
+                    talk_number(1900 + tm->tm_year, true);
+                }
+#endif
+        /*speak the disk free info*/
+    }
+}
\ No newline at end of file
Index: apps/talk.h
===================================================================
--- apps/talk.h	(revision 14986)
+++ apps/talk.h	(working copy)
@@ -74,6 +74,7 @@
 int talk_value(long n, int unit, bool enqueue); /* say a numeric value */
 int talk_spell(const char* spell, bool enqueue); /* spell a string */
 bool talk_menus_enabled(void); /* returns true if menus should be voiced */
+void info (void);
 void talk_disable_menus(void); /* disable voice menus (temporarily, not persisted) */
 void talk_enable_menus(void); /* re-enable voice menus */
 int do_shutup(void); /* kill voice unconditionally */
Index: apps/keymaps/keymap-h1x0_h3x0.c
===================================================================
--- apps/keymaps/keymap-h1x0_h3x0.c	(revision 14986)
+++ apps/keymaps/keymap-h1x0_h3x0.c	(working copy)
@@ -61,6 +61,8 @@
     { ACTION_STD_OK,            BUTTON_SELECT|BUTTON_REL,   BUTTON_SELECT },
     { ACTION_STD_OK,            BUTTON_RIGHT,               BUTTON_NONE },
     { ACTION_STD_OK,            BUTTON_ON|BUTTON_REL,       BUTTON_NONE },
+    { ACTION_TALK_INFO,           BUTTON_REC|BUTTON_REPEAT,        BUTTON_REC },
+    { ACTION_GO_TO_RADIO,           BUTTON_REC|BUTTON_REL,        BUTTON_NONE },
     { ACTION_STD_REC,           BUTTON_REC|BUTTON_REPEAT,        BUTTON_NONE },
     
     LAST_ITEM_IN_LIST
Index: apps/playlist_catalog.c
===================================================================
--- apps/playlist_catalog.c	(revision 14986)
+++ apps/playlist_catalog.c	(working copy)
@@ -23,6 +23,8 @@
 #include <string.h>
 #include "action.h"
 #include "dir.h"
+#include "talk.h"
+#include "radio.h"
 #include "file.h"
 #include "filetree.h"
 #include "kernel.h"
@@ -255,6 +257,12 @@
 
         switch (button)
         {
+            case ACTION_TALK_INFO:
+                info ();
+                break;
+            case ACTION_GO_TO_RADIO:
+                radio_screen();
+                break;
             case ACTION_STD_CANCEL:
                 exit = true;
                 break;