initial word echo

This commit is contained in:
chrys 2016-08-06 14:12:29 +02:00
parent cea7fe6c5b
commit e5ffd128b7
6 changed files with 24 additions and 62 deletions

View File

@ -5,13 +5,13 @@ theme=default
[speech]
enabled=True
driver=espeak
rate=800
driver=speechd
rate=50
volume=100
pitch=50
module=espeak
voice=en-us
language=en-us
volume=200
voice=de
language=de
[braille]
enabled=False
@ -22,8 +22,8 @@ driver=linux
[keyboard]
keyboardLayout=desktop
charEcho=False
wordEcho=False
charEcho=True
wordEcho=True
interruptOnKeyPress=False
[general]

View File

@ -6,6 +6,8 @@ class command():
def run(self, environment):
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'keyboard', 'interruptOnKeyPress'):
return environment
if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']:
return environment
# if environment['screenData']['newCursor'] == environment['screenData']['oldCursor'] and\
# environment['screenData']['newDelta'] == environment['screenData']['oldDelta']:
# return environment

View File

@ -1,23 +0,0 @@
#!/bin/python
import time
class command():
def __init__(self):
pass
def run(self, environment):
if environment['screenData']['newDelta'] != environment['screenData']['oldDelta']:
return environment
if environment['screenData']['newCursor']['y'] != environment['screenData']['oldCursor']['y'] or\
environment['screenData']['newCursor']['x'] == environment['screenData']['oldCursor']['x']:
return environment
if environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']][environment['screenData']['newCursor']['x']].strip(" \t\n") == '':
pass
#environment['runtime']['outputManager'].presentText(environment, "blank",True)
else:
environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']][environment['screenData']['newCursor']['x']],interrupt=True)
return environment
def setCallback(self, callback):
pass
def shutdown(self):
pass

View File

@ -1,20 +0,0 @@
#!/bin/python
class command():
def __init__(self):
pass
def run(self, environment):
if environment['screenData']['newDelta'] != environment['screenData']['oldDelta']:
return environment
if environment['screenData']['newCursor']['y'] == environment['screenData']['oldCursor']['y']:
return environment
if environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']].strip(" \t\n") == '':
environment['runtime']['outputManager'].presentText(environment, "blank", soundIconName='EmptyLine', interrupt=True)
else:
environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']], True)
return environment
def setCallback(self, callback):
pass
def shutdown(self):
pass

View File

@ -5,20 +5,23 @@ class command():
def __init__(self):
pass
def run(self, environment):
return environment
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'keyboard', 'wordEcho') and\
environment['screenData']['newCursor']['x'] <= environment['screenData']['oldCursor']['x']:
#return environment
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'keyboard', 'wordEcho'):
return environment
#if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']:
# return environment
#print('drin')
if environment['screenData']['newDelta'] == environment['screenData']['oldDelta']:
if environment['screenData']['newCursor']['x'] <= environment['screenData']['oldCursor']['x']:
return environment
if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']:
return environment
if environment['screenData']['newDelta'] == environment['screenData']['oldDelta'] and \
environment['screenData']['newNegativeDelta'] == '':
return environment
newContent = environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']]
x, y, currWord = word_utils.getCurrentWord(environment['screenData']['newCursor']['x'], 0, newContent)
print(len(currWord) + x + 2, environment['screenData']['newCursor']['x'],'|',newContent[environment['screenData']['newCursor']['x'] - 1],'|',x, y, currWord)
print('|',environment['screenData']['newNegativeDelta'] ,'|',len(currWord) + x + 2, environment['screenData']['newCursor']['x'],'|',newContent[environment['screenData']['newCursor']['x'] - 1],'|',x, y, currWord)
print(newContent )
#len(currWord) + x + 2 == environment['screenData']['newCursor']['x']:
if environment['screenData']['newCursor']['x'] > 0 and \

View File

@ -27,7 +27,7 @@ class sound:
self._player.set_state(Gst.State.NULL)
error, info = message.parse_error()
print(error, info)
print('drin')
print('_onPlayerMessage')
def _onPipelineMessage(self, bus, message):
if message.type == Gst.MessageType.EOS:
self._pipeline.set_state(Gst.State.NULL)
@ -35,7 +35,7 @@ class sound:
self._pipeline.set_state(Gst.State.NULL)
error, info = message.parse_error()
print(error, info)
print('drin')
print('_onPipelineMessage')
def _onTimeout(self, element):
element.set_state(Gst.State.NULL)
@ -46,7 +46,7 @@ class sound:
self.cancel()
self._player.set_property('uri', 'file://%s' % fileName)
self._player.set_state(Gst.State.PLAYING)
print('playSoundFile')
def playFrequence(self, frequence, duration, adjustVolume, interrupt=True):
if interrupt:
self.cancel()