Re: [orca-list] Accessible Chess - Orca and XBoard



can one pull from git and get the changes, or does one have to apply this patch?
Thanks/great job sticking with this till it's reeally right for everyone.


-- 
     B.H.
   Registerd Linux User 521886


  Nalin.x.Linux wrote:
Fri, Jul 31, 2015 at 11:46:59AM +0530

Dear friends,
      Our current accessible XBoard is passing the information to
screen reader via a status bar located at the bottom side of XBoard.
But this extra widget is bit annoying for sighted users. So I
discussed this issue with Joanmarie and finally we decided to make
this widget hidden and make orca read notification from invisible
status bar too. see following links

https://github.com/GNOME/orca/commit/52064c1e1903d28fdc482a9d9b76569524270413
https://bugzilla.gnome.org/show_bug.cgi?id=752211

So now the widget will be hidden and orca will announce the messages
from XBoard. Also one can make it show by checking "Show Status Bar"
menu item in Accessibility menu. The patch for XBoard is attached with
this mail.

The HG Muller one of the core developer of XBoard and mentor of mine,
said that there are some sighted users who use sensory physical board
with XBoard to play chess, and they too requested for the TTS feature.
So I have added a new check menu item named "Announce Move" in options
menu and one can simply enable it. Currently it uses direct espeak
command. Later we can make this through Speech Dispatcher(gnu/linux)
or SAPI(windows).


-- 
Free Software Free Society

diff --git a/accessibility.c b/accessibility.c
index ef26fbc..c84aea4 100644
--- a/accessibility.c
+++ b/accessibility.c
@@ -901,7 +901,8 @@ SayMachineMove(int evenIfDuplicate)
          } else {
              /* starts not with digit */
              if(StrCaseStr(lastMsg, "illegal")) PlayIcsUnfinishedSound();
-             set_accessible_description(lastMsg, TRUE);
+             SayMoveDetailed(currentMove-1);
+             //set_accessible_description(lastMsg, TRUE);
          }
 }
 
diff --git a/args.h b/args.h
index bd5b4e7..1aad301 100644
--- a/args.h
+++ b/args.h
@@ -314,6 +314,8 @@ ArgDescriptor argDescriptors[] = {
   { "xcoords", ArgFalse, (void *) &appData.showCoords, FALSE, INVALID },
   { "-coords", ArgFalse, (void *) &appData.showCoords, FALSE, INVALID },
   { "showThinking", ArgBoolean, (void *) &appData.showThinking, TRUE, (ArgIniType) FALSE },
+  { "showAccessibilityStatusbar", ArgBoolean, (void *) &appData.showAccessibilityStatusbar, TRUE, 
(ArgIniType) FALSE },
+  { "AnnounceMove", ArgBoolean, (void *) &appData.announceMove, TRUE, (ArgIniType) FALSE }, //text to 
speech
   { "thinking", ArgTrue, (void *) &appData.showThinking, FALSE, INVALID },
   { "xthinking", ArgFalse, (void *) &appData.showThinking, FALSE, INVALID },
   { "-thinking", ArgFalse, (void *) &appData.showThinking, FALSE, INVALID },
diff --git a/common.h b/common.h
index ff2b34c..1084ffa 100644
--- a/common.h
+++ b/common.h
@@ -552,6 +552,8 @@ typedef struct {
     Boolean oneClick;
     Boolean quietPlay;
     Boolean showThinking;
+    Boolean showAccessibilityStatusbar;
+    Boolean announceMove; //text to speech
     Boolean ponderNextMove;
     Boolean periodicUpdates;
     Boolean autoObserve;
diff --git a/dialogs.c b/dialogs.c
index d2e36ba..bdfd5bf 100644
--- a/dialogs.c
+++ b/dialogs.c
@@ -3085,5 +3085,24 @@ void set_accessible_description(char *mess, int flag)
      }
              
      notify_accessible_description(&mainOptions[W_ACC_TITLE],buf);
+     
+     
+     char tts_buf[8000];
+     if(appData.announceMove)
+     {
+             system("pkill paplay");
+             //sprintf(tts_buf,"pico2wave -l en-GB -w info.wav '%s' && paplay info.wav &",val);
+             sprintf(tts_buf,"espeak '%s' --stdout | paplay &",buf);
+             system(tts_buf);
+     }
+     
      buf[0] = NULLCHAR;      
 }
+
+
+void
+ShowAccessibilityStatusbarEvent ()
+{
+     printf("\nAccessibilityStatusbar = %d", appData.showAccessibilityStatusbar);
+     show_hide_accessibility_status_bar(&mainOptions[W_ACC_TITLE],appData.showAccessibilityStatusbar);
+}
diff --git a/gtk/xoptions.c b/gtk/xoptions.c
index 51b9781..f563ff4 100644
--- a/gtk/xoptions.c
+++ b/gtk/xoptions.c
@@ -982,6 +982,17 @@ void notify_accessible_description(Option *opt, char *val)
      //system(buf);
 }
 
+void 
+show_hide_accessibility_status_bar(Option *opt,int val)
+{    
+     if (val){
+             gtk_widget_show(GTK_WIDGET(opt->handle));
+     }
+     else{
+             gtk_widget_hide(GTK_WIDGET(opt->handle));
+     }
+}
+
 void GenericCallback(GtkWidget *widget, gpointer gdata)
 {
     const gchar *name;
diff --git a/menus.c b/menus.c
index 1439873..71df285 100644
--- a/menus.c
+++ b/menus.c
@@ -401,6 +401,22 @@ NothingProc ()
 #   define MARK_MENU_ITEM(X,Y) MarkMenuItem(X, Y)
 #endif
 
+
+void
+ShowAccessibilityStatusbarProc ()
+{
+  appData.showAccessibilityStatusbar = !appData.showAccessibilityStatusbar;
+  ShowAccessibilityStatusbarEvent();
+  MARK_MENU_ITEM("Accessibility.ShowAccessibilityStatusbar", appData.showAccessibilityStatusbar);
+}
+
+void
+AnnounceMoveProc ()
+{
+  appData.announceMove = !appData.announceMove;
+  MARK_MENU_ITEM("Options.AnnounceMove", appData.announceMove);
+}
+
 void
 PonderNextMoveProc ()
 {
@@ -752,12 +768,15 @@ MenuItem optionsMenu[] = {
   {N_("Test Legality"),          "<Ctrl><Shift>l",  "TestLegality",        TestLegalityProc},
   {"----",                        NULL,              NULL,                 NothingProc},
 #endif
+  {N_("Announce Move"),                NULL,             "AnnounceMove",        AnnounceMoveProc,        
CHECK },
   {N_("Save Settings Now"),       NULL,             "SaveSettingsNow",     SaveSettingsProc},
   {N_("Save Settings on Exit"),   NULL,             "SaveSettingsonExit",  SaveOnExitProc,         CHECK },
   {NULL,                          NULL,              NULL,                 NULL}
 };
 
 MenuItem accessibilityMenu[] = {
+  {N_("Show Status Bar"),     NULL,   "ShowAccessibilityStatusbar", ShowAccessibilityStatusbarProc,        
          CHECK},
+  {"----",                   NULL,       NULL,                    NothingProc},      
   {N_("SayClockTime"),                "<Alt>t",   "SayClockTime",          SayClockTime},
   {"----",                   NULL,       NULL,                    NothingProc},
   {N_("SayWhosTurn"),                 "<Alt><Shift>m",   "SayWhosTurn",    SayWhosTurn},
@@ -1341,6 +1360,15 @@ InitMenuMarkers()
     if (saveSettingsOnExit) {
      MarkMenuItem("Options.SaveSettingsonExit", True);
     }
+    
+    if (appData.announceMove) {
+     MarkMenuItem("Options.AnnounceMove", True);
+     }
+     
+    if (appData.showAccessibilityStatusbar) {
+     MarkMenuItem("Accessibility.ShowAccessibilityStatusbar", True);
+     }
+    ShowAccessibilityStatusbarEvent();
     EnableNamedMenuItem("File.SaveSelected", False);
 
     // all XBoard builds get here, but not WinBoard...

_______________________________________________
orca-list mailing list
orca-list gnome org
https://mail.gnome.org/mailman/listinfo/orca-list
Visit http://live.gnome.org/Orca for more information on Orca.
The manual is at http://library.gnome.org/users/gnome-access-guide/nightly/ats-2.html
The FAQ is at http://live.gnome.org/Orca/FrequentlyAskedQuestions
Log bugs and feature requests at http://bugzilla.gnome.org
Find out how to help at http://live.gnome.org/Orca/HowCanIHelp



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]