Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: RE: voice in keyboard.c
From: Aman Singer (aman_at_asinger.net)
Date: 2004-05-29


Hi.
        I understand Jörg already implemented it? The CVS list says

Update of /cvsroot/rockbox/apps/recorder
In directory labb.contactor.se:/var/tmp/cvs-serv11919/apps/recorder

Modified Files:
        keyboard.c
Log Message:
voice in keyboard, inspired by Christopher Moore

        Aman
-----Original Message-----
From: rockbox-bounces_at_cool.haxx.se [mailto:rockbox-bounces_at_cool.haxx.se] On
Behalf Of Rocker
Sent: May 29, 2004 12:38 PM
To: Rockbox development
Subject: Re: voice in keyboard.c

Hello, How do I go about implementing this patch on my fmr?

Cheers...rocker

----- Original Message -----
From: "Christopher Moore" <christopher.h.moore_at_verizon.net>
To: "rockbox devel" <rockbox_at_cool.haxx.se>
Sent: Monday, May 03, 2004 1:34 PM
Subject: voice in keyboard.c

Hello,
Below is a simple patch to keyboard.c which gives voice output when renaming
files/directories or creating directories. Voice output has been added to
the following keys:
left, right, on+left, on+right and play.

I've only tested the patch on an fmr and have not looked into whether the
same logic would work on the player side. If anyone wishes to test this on
an fmr, I can send a prebuilt binary (.ajz file) privately.

Chris

--- apps/recorder/keyboard.c.orig 2004-04-30 15:40:36.000000000 -0400
+++ apps/recorder/keyboard.c 2004-05-03 14:48:41.000000000 -0400
@@ -26,6 +26,7 @@
 #include "font.h"
 #include "screens.h"
 #include "status.h"
+#include "talk.h"

 #define KEYBOARD_LINES 4
 #define KEYBOARD_PAGES 3
@@ -72,6 +73,7 @@

     char outline[256];
     char c = 0;
+ char spell_char[2]; /* store char to pass to talk_spell */
     struct font* font = font_get(FONT_SYSFIXED);

     lcd_setfont(FONT_SYSFIXED);
@@ -89,6 +91,7 @@
     max_chars = LCD_WIDTH / font_w;
     kbd_setupkeys(line, page);

+ talk_spell(text, true); /* spell initial test */
     while(!done)
     {
         len = strlen(text);
@@ -193,7 +196,12 @@
             case BUTTON_RIGHT:
             case BUTTON_RIGHT | BUTTON_REPEAT:
                 if (x < (int)strlen(line[y]) - 1)
+ {
                     x++;
+ spell_char[0] = line[y][x];
+ spell_char[1] = '\0'; /* mark end of char string */
+ talk_spell(spell_char, false);
+ }
                 else
                     x = 0;
                 break;
@@ -201,7 +209,12 @@
             case BUTTON_LEFT:
             case BUTTON_LEFT | BUTTON_REPEAT:
                 if (x)
+ {
                     x--;
+ spell_char[0] = line[y][x];
+ spell_char[1] = '\0'; /* mark end of char string */
+ talk_spell(spell_char, false);
+ }
                 else
                     x = strlen(line[y]) - 1;
                 break;
@@ -261,6 +274,7 @@
                     }
                     editpos++;
                 }
+ talk_spell(text, false); /* speak revised text */
                 break;

             case BUTTON_ON | BUTTON_RIGHT:
@@ -269,6 +283,11 @@
                 editpos++;
                 if (editpos > len)
                     editpos = len;
+ else
+ {
+ spell_char[0] = text[editpos-1];
+ talk_spell(spell_char, false);
+ }
                 break;

             case BUTTON_ON | BUTTON_LEFT:
@@ -277,6 +296,11 @@
                 editpos--;
                 if (editpos < 0)
                     editpos = 0;
+ else
+ {
+ spell_char[0] = text[editpos];
+ talk_spell(spell_char, false);
+ }
                 break;

             case SYS_USB_CONNECTED:
_______________________________________________
http://cool.haxx.se/mailman/listinfo/rockbox

_______________________________________________
http://cool.haxx.se/mailman/listinfo/rockbox

_______________________________________________
http://cool.haxx.se/mailman/listinfo/rockbox



Page was last modified "Jan 10 2012" The Rockbox Crew
aaa