From 2c539ba0f8429f58bc24e7d60770de8d48d18e4f Mon Sep 17 00:00:00 2001 From: chrys Date: Sat, 1 Oct 2016 15:22:34 +0200 Subject: [PATCH] announce capital letters in keyecho, deleteecho, char review next,prev/current and arrow left right --- TODO | 3 ++- config/settings/settings.conf | 2 ++ config/settings/settings.conf.orig | 2 ++ config/settings/settings.conf.storm | 2 ++ config/sound/default/caps.opus | Bin 266 -> 0 bytes config/sound/default/caps.wav | Bin 3920 -> 0 bytes config/sound/default/soundicons.conf | 2 ++ config/sound/template/soundicons.conf | 2 ++ .../commands/commands/review_curr_char.py | 2 +- .../commands/commands/review_next_char.py | 2 +- .../commands/commands/review_prev_char.py | 2 +- ...present_char_if_cursor_change_horizontal.py | 2 +- .../commands/onInput/50000-char_echo.py | 2 +- .../commands/onInput/65000-char_delete_echo.py | 3 ++- src/fenrir-package/core/outputManager.py | 17 +++++++++++++---- src/fenrir-package/core/settings.py | 1 + 16 files changed, 33 insertions(+), 11 deletions(-) delete mode 100644 config/sound/default/caps.opus delete mode 100644 config/sound/default/caps.wav diff --git a/TODO b/TODO index 903523fc..3bb0f11b 100644 --- a/TODO +++ b/TODO @@ -23,7 +23,7 @@ ToDos in Priority order: curr item first item last item -- beep on cursor to capital letters in cursor and review + - implement onScreenUpdate commands read highlighted text mode - add the debugging to core @@ -222,3 +222,4 @@ ps a -o tty,comm | grep -e Xorg | grep -v "grep -e Xorg" - dictonary for special chars and string replacements - punctuation +- beep on cursor to capital letters in cursor and review diff --git a/config/settings/settings.conf b/config/settings/settings.conf index dd1a81ae..1f43f313 100644 --- a/config/settings/settings.conf +++ b/config/settings/settings.conf @@ -41,6 +41,8 @@ rate=0.45 # Pitch controls the pitch of the voice, select from 0, lowest, to 1.0, highest. pitch=0.5 +# Pitch for capital letters +capitalPitch=0.9 # Volume controls the loudness of the voice, select from 0, quietest, to 1.0, loudest. volume=1.0 diff --git a/config/settings/settings.conf.orig b/config/settings/settings.conf.orig index 13711a11..a9e8acdb 100644 --- a/config/settings/settings.conf.orig +++ b/config/settings/settings.conf.orig @@ -39,6 +39,8 @@ rate=0.45 # Pitch controls the pitch of the voice, select from 0, lowest, to 1.0, highest. pitch=0.5 +# Pitch for capital letters +capitalPitch=0.9 # Volume controls the loudness of the voice, select from 0, quietest, to 1.0, loudest. volume=1.0 diff --git a/config/settings/settings.conf.storm b/config/settings/settings.conf.storm index d7ac3576..ce9c571f 100644 --- a/config/settings/settings.conf.storm +++ b/config/settings/settings.conf.storm @@ -12,6 +12,8 @@ enabled=True driver=speechd rate=0.85 pitch=0.5 +# Pitch for capital letters +capitalPitch=0.9 module=espeak voice= language=english-us diff --git a/config/sound/default/caps.opus b/config/sound/default/caps.opus deleted file mode 100644 index 2e5d92e69affd4f6464ba998778a840b87b216cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 266 zcmeZIPY-5bVt|5KQ#A@f%!SW+KQIdW7nBxzq$Z{?GFmV;>;^0G2PuaGka9*KZ|Bkn z&Wv^-Q*%8NLp?(S1CSC~AWqFo&QD1#vIR;egCs40l7D$#$!aF|&(HX!`g-EyWjFcTbN!UH(pvkL zu~@8SRy^kY;^U&H5V(wEetN*-hYrED+1Q|wJY+j)tCcD`u bLz}O%cs^h9hAn-T;(cWXZ&oF(vnc@pM*USa diff --git a/config/sound/default/caps.wav b/config/sound/default/caps.wav deleted file mode 100644 index f9120bcaacae66e226b31c4da8fc121a25258c75..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3920 zcmV-W53lf2Nk&FU4*&pHK~_a(ZFC?g0002~{{aAiy8r+H?g9V=03ZMs03ZMa00001 z0000001yCx00620IGb^1VPkXz0002M0{{SIVRT^t4*&olw7Drq+k-1lRT)Gz6%<90 zL!?KtAzleEz#1 zKfS*{2SU`x@zB$gz&66a*I3W_ci!&R5!ms>(eVp#Ts{mQePJe}E&(LjF!LRaU4ajc zEvWl^HAVkkL09j{%UbB?af$B%tX$SDR)jI#Ps`FrVPk^$3yVIR_u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 zck|nI2glo5k)Q3ijScQ4)6C|*sYdCZWAOeq;+rRAog_x^%=$;p9#clayxBs5q3$hb eptc({t-%OS$z1}oa-Q&?HY)XzDN+(_VU8gcK@-^k diff --git a/config/sound/default/soundicons.conf b/config/sound/default/soundicons.conf index f2ccf032..02782f10 100644 --- a/config/sound/default/soundicons.conf +++ b/config/sound/default/soundicons.conf @@ -46,3 +46,5 @@ HasAttributes='HasAttributes.opus' PromotedText='PromotedText.opus' # missspelled indicator mispell='mispell.opus' +# the for capital letter: +capital='Caps.opus' diff --git a/config/sound/template/soundicons.conf b/config/sound/template/soundicons.conf index f8ff12f9..fadbbb0b 100644 --- a/config/sound/template/soundicons.conf +++ b/config/sound/template/soundicons.conf @@ -46,3 +46,5 @@ HasAttributes='' PromotedText='' # misspelled indicator mispell='' +# the for capital letter: +capital='' diff --git a/src/fenrir-package/commands/commands/review_curr_char.py b/src/fenrir-package/commands/commands/review_curr_char.py index 9b9a1122..d57b792f 100644 --- a/src/fenrir-package/commands/commands/review_curr_char.py +++ b/src/fenrir-package/commands/commands/review_curr_char.py @@ -26,7 +26,7 @@ class command(): if currChar.strip(" \t\n") == '': self.env['runtime']['outputManager'].presentText("blank" ,interrupt=True) else: - self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, ignorePunctuation=True) + self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, ignorePunctuation=True, announceCapital=True) def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/review_next_char.py b/src/fenrir-package/commands/commands/review_next_char.py index 66a1aebb..a35c4008 100644 --- a/src/fenrir-package/commands/commands/review_next_char.py +++ b/src/fenrir-package/commands/commands/review_next_char.py @@ -28,7 +28,7 @@ class command(): if currChar.strip(" \t\n") == '': self.env['runtime']['outputManager'].presentText("blank", interrupt=True) else: - self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True) + self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True) def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/review_prev_char.py b/src/fenrir-package/commands/commands/review_prev_char.py index 61ea11dc..4f5c704b 100644 --- a/src/fenrir-package/commands/commands/review_prev_char.py +++ b/src/fenrir-package/commands/commands/review_prev_char.py @@ -28,7 +28,7 @@ class command(): if currChar.strip(" \t\n") == '': self.env['runtime']['outputManager'].presentText("blank", interrupt=True) else: - self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True) + self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True) def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/onInput/45000-present_char_if_cursor_change_horizontal.py b/src/fenrir-package/commands/onInput/45000-present_char_if_cursor_change_horizontal.py index 9c387055..a1920e8c 100644 --- a/src/fenrir-package/commands/onInput/45000-present_char_if_cursor_change_horizontal.py +++ b/src/fenrir-package/commands/onInput/45000-present_char_if_cursor_change_horizontal.py @@ -32,7 +32,7 @@ class command(): return currChar = self.env['screenData']['newContentText'].split('\n')[self.env['screenData']['newCursor']['y']][self.env['screenData']['newCursor']['x']] if not currChar.strip(" \t\n") == '': - self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True) + self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True) def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/onInput/50000-char_echo.py b/src/fenrir-package/commands/onInput/50000-char_echo.py index 82816112..528b6530 100644 --- a/src/fenrir-package/commands/onInput/50000-char_echo.py +++ b/src/fenrir-package/commands/onInput/50000-char_echo.py @@ -30,7 +30,7 @@ class command(): # big changes are no char (but the value is bigger than one maybe the differ needs longer than you can type, so a little strange random buffer for now) if len(self.env['screenData']['newDelta']) > 3: return - self.env['runtime']['outputManager'].presentText(self.env['screenData']['newDelta'], interrupt=True, ignorePunctuation=True) + self.env['runtime']['outputManager'].presentText(self.env['screenData']['newDelta'], interrupt=True, ignorePunctuation=True, announceCapital=True) def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/onInput/65000-char_delete_echo.py b/src/fenrir-package/commands/onInput/65000-char_delete_echo.py index bd7705a1..4b20a094 100644 --- a/src/fenrir-package/commands/onInput/65000-char_delete_echo.py +++ b/src/fenrir-package/commands/onInput/65000-char_delete_echo.py @@ -36,7 +36,8 @@ class command(): # too much for a single backspace... if len(self.env['screenData']['newNegativeDelta']) >= 5: return - self.env['runtime']['outputManager'].presentText(self.env['screenData']['newNegativeDelta'], interrupt=True, ignorePunctuation=True) + + self.env['runtime']['outputManager'].presentText(self.env['screenData']['newNegativeDelta'], interrupt=True, ignorePunctuation=True, announceCapital=True) def setCallback(self, callback): pass diff --git a/src/fenrir-package/core/outputManager.py b/src/fenrir-package/core/outputManager.py index 64ff9b6b..1a817acd 100644 --- a/src/fenrir-package/core/outputManager.py +++ b/src/fenrir-package/core/outputManager.py @@ -5,6 +5,7 @@ # By Chrys, Storm Dragon, and contributers. from core import debug +import string class outputManager(): def __init__(self): @@ -20,15 +21,20 @@ class outputManager(): self.env['runtime']['settingsManager'].shutdownDriver('soundDriver') self.env['runtime']['settingsManager'].shutdownDriver('speechDriver') - def presentText(self, text, interrupt=True, soundIcon = '', ignorePunctuation=False): + def presentText(self, text, interrupt=True, soundIcon = '', ignorePunctuation=False, announceCapital=False): self.env['runtime']['debug'].writeDebugOut("presentText:\nsoundIcon:'"+soundIcon+"'\nText:\n" + text ,debug.debugLevel.INFO) if self.playSoundIcon(soundIcon, interrupt): self.env['runtime']['debug'].writeDebugOut("soundIcon found" ,debug.debugLevel.INFO) return - self.speakText(text, interrupt, ignorePunctuation) + toAnnounceCapital = announceCapital and len(text.strip(' \n\t')) == 1 and text.strip(' \n\t').isupper() + if toAnnounceCapital: + if self.playSoundIcon('capital', False): + toAnnounceCapital = False + + self.speakText(text, interrupt, ignorePunctuation,toAnnounceCapital) self.brailleText(text, interrupt) - def speakText(self, text, interrupt=True, ignorePunctuation=False): + def speakText(self, text, interrupt=True, ignorePunctuation=False, announceCapital=False): if not self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'enabled'): self.env['runtime']['debug'].writeDebugOut("Speech disabled in outputManager.speakText",debug.debugLevel.INFO) return @@ -50,7 +56,10 @@ class outputManager(): self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR) try: - self.env['runtime']['speechDriver'].setPitch(self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'pitch')) + if announceCapital: + self.env['runtime']['speechDriver'].setPitch(self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'capitalPitch')) + else: + self.env['runtime']['speechDriver'].setPitch(self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'pitch')) except Exception as e: self.env['runtime']['debug'].writeDebugOut("setting speech pitch in outputManager.speakText",debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR) diff --git a/src/fenrir-package/core/settings.py b/src/fenrir-package/core/settings.py index 2940918c..7e97843f 100644 --- a/src/fenrir-package/core/settings.py +++ b/src/fenrir-package/core/settings.py @@ -20,6 +20,7 @@ settings = { 'driver': 'speechd', 'rate': 0.75, 'pitch': 0.5, + 'capitalPitch':0.8, 'volume': 1.0, 'module': '', 'voice': 'de',