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



Rockbox mail archive

Subject: Re: voice in keyboard.c

Re: voice in keyboard.c

From: Rocker <rocker_at_shaw.ca>
Date: Sat, 29 May 2004 10:38:10 -0600

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
_at__at_ -26,6 +26,7 _at__at_
 #include "font.h"
 #include "screens.h"
 #include "status.h"
+#include "talk.h"

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

     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);
_at__at_ -89,6 +91,7 _at__at_
     max_chars = LCD_WIDTH / font_w;
     kbd_setupkeys(line, page);

+ talk_spell(text, true); /* spell initial test */
     while(!done)
     {
         len = strlen(text);
_at__at_ -193,7 +196,12 _at__at_
             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;
_at__at_ -201,7 +209,12 _at__at_
             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;
_at__at_ -261,6 +274,7 _at__at_
                     }
                     editpos++;
                 }
+ talk_spell(text, false); /* speak revised text */
                 break;

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

             case BUTTON_ON | BUTTON_LEFT:
_at__at_ -277,6 +296,11 _at__at_
                 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
Received on 2004-05-29

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy