From c49a1b318a0ece548eab212c69d2c856cf7817ad Mon Sep 17 00:00:00 2001 From: chrys Date: Tue, 4 Oct 2016 23:15:38 +0200 Subject: [PATCH] create wav sound theme, make more use of soundicons --- config/settings/settings.conf.chrys | 113 ++++++++++++++++++ .../sound/{default => default-wav}/Accept.wav | Bin .../{default => default-wav}/BrailleOff.wav | Bin .../{default => default-wav}/BrailleOn.wav | Bin .../sound/{default => default-wav}/Cancel.wav | Bin .../sound/{default => default-wav}/Caps.wav | Bin .../{default => default-wav}/ChangeTTY.wav | Bin .../ContentChanged.wav | Bin .../CopyToClipboard.wav | Bin .../{default => default-wav}/EmptyLine.wav | Bin .../{default => default-wav}/EndOfLine.wav | Bin .../{default => default-wav}/EndOfScreen.wav | Bin .../{default => default-wav}/ErrorBraille.wav | Bin .../{default => default-wav}/ErrorScreen.wav | Bin .../{default => default-wav}/ErrorSpeech.wav | Bin .../{default => default-wav}/HasAtributes.wav | Bin .../PasteClipboardOnScreen.wav | Bin .../PlaceEndMark.wav} | Bin .../PlaceStartMark.wav} | Bin .../ScreenReaderOff.wav | Bin .../ScreenReaderOn.wav | Bin .../{default => default-wav}/SoundOff.wav | Bin .../{default => default-wav}/SoundOn.wav | Bin .../{default => default-wav}/SpeechOff.wav | Bin .../{default => default-wav}/SpeechOn.wav | Bin .../{default => default-wav}/StartOfLine.wav | Bin .../StartOfScreen.wav | Bin .../{default => default-wav}/mispell.wav | Bin config/sound/default-wav/soundicons.conf | 50 ++++++++ config/sound/{default => default-wav}/tmp.wav | Bin ...laceEndCopyMark.opus => PlaceEndMark.opus} | Bin ...StartCopyMark.opus => PlaceStartMark.opus} | Bin config/sound/default/soundicons.conf | 4 +- .../commands/copy_marked_to_clipboard.py | 8 +- .../commands/linux_paste_clipboard.py | 1 + src/fenrir/commands/commands/set_mark.py | 8 +- src/fenrir/core/cursorManager.py | 3 + 37 files changed, 176 insertions(+), 11 deletions(-) create mode 100644 config/settings/settings.conf.chrys rename config/sound/{default => default-wav}/Accept.wav (100%) rename config/sound/{default => default-wav}/BrailleOff.wav (100%) rename config/sound/{default => default-wav}/BrailleOn.wav (100%) rename config/sound/{default => default-wav}/Cancel.wav (100%) rename config/sound/{default => default-wav}/Caps.wav (100%) rename config/sound/{default => default-wav}/ChangeTTY.wav (100%) rename config/sound/{default => default-wav}/ContentChanged.wav (100%) rename config/sound/{default => default-wav}/CopyToClipboard.wav (100%) rename config/sound/{default => default-wav}/EmptyLine.wav (100%) rename config/sound/{default => default-wav}/EndOfLine.wav (100%) rename config/sound/{default => default-wav}/EndOfScreen.wav (100%) rename config/sound/{default => default-wav}/ErrorBraille.wav (100%) rename config/sound/{default => default-wav}/ErrorScreen.wav (100%) rename config/sound/{default => default-wav}/ErrorSpeech.wav (100%) rename config/sound/{default => default-wav}/HasAtributes.wav (100%) rename config/sound/{default => default-wav}/PasteClipboardOnScreen.wav (100%) rename config/sound/{default/PlaceEndCopyMark.wav => default-wav/PlaceEndMark.wav} (100%) rename config/sound/{default/PlaceStartCopyMark.wav => default-wav/PlaceStartMark.wav} (100%) rename config/sound/{default => default-wav}/ScreenReaderOff.wav (100%) rename config/sound/{default => default-wav}/ScreenReaderOn.wav (100%) rename config/sound/{default => default-wav}/SoundOff.wav (100%) rename config/sound/{default => default-wav}/SoundOn.wav (100%) rename config/sound/{default => default-wav}/SpeechOff.wav (100%) rename config/sound/{default => default-wav}/SpeechOn.wav (100%) rename config/sound/{default => default-wav}/StartOfLine.wav (100%) rename config/sound/{default => default-wav}/StartOfScreen.wav (100%) rename config/sound/{default => default-wav}/mispell.wav (100%) create mode 100644 config/sound/default-wav/soundicons.conf rename config/sound/{default => default-wav}/tmp.wav (100%) rename config/sound/default/{PlaceEndCopyMark.opus => PlaceEndMark.opus} (100%) rename config/sound/default/{PlaceStartCopyMark.opus => PlaceStartMark.opus} (100%) diff --git a/config/settings/settings.conf.chrys b/config/settings/settings.conf.chrys new file mode 100644 index 00000000..68d7296e --- /dev/null +++ b/config/settings/settings.conf.chrys @@ -0,0 +1,113 @@ +[sound] +# Turn sound on or off: +enabled=True + +# Select the driver used to play sounds, choices are generic and gstreamer. +# Sox is the default. +driver=generic + +# Sound themes. This is the pack of sounds used for sound alerts. +# Sound packs may be located at /usr/share/sounds +# For system wide availability, or ~/.local/share/fenrir/sounds +# For the current user. +theme=default + +# Sound volume controls how loud the sounds for your chosen soundpack are. +# 0 is quietest, 1.0 is loudest. +volume=1.0 + +# shell commands for generic sound driver +# the folowing variable are substituded +# fenrirVolume = the current volume setting +# fenrirSoundFile = the soundfile for an soundicon +# fenrirFrequence = the frequence to play +# fenrirDuration = the duration of the frequence +# the following command is used for play a soundfile +genericPlayFileCommand=play -q -v fenrirVolume fenrirSoundFile +#the following command is used for generating a frequence beep +genericFrequencyCommand=play -q -v fenrirVolume -n -c1 synth fenrirDuration sine fenrirFrequence + +[speech] +# Turn speech on or off: +enabled=True + +# Select speech driver, options are speechd (default) or espeak: +driver=speechd +#driver=espeak + + +# The rate selects how fast fenrir will speak. Options range from 0, slowest, to 1.0, fastest. +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 + +# Module is used for speech-dispatcher, to select the speech module you want to use. +# Consult speech-dispatcher's configuration and help ti find out which modules are available. +# The default is espeak. +module=espeak + +# Voice selects the varient you want to use, for example, f5 will use the female voice #5 in espeak, +# or if using the espeak module in speech-dispatcher. To find out which voices are available, consult the documentation provided with your chosen synthesizer. +voice= + +# Select the language you want fenrir to use. +language=de + +# Read new text as it happens? +autoReadIncoming=True + +[braille] +#braille is not implemented yet +enabled=False +layout=en + +[screen] +driver=linux +encoding=cp850 +screenUpdateDelay=0.4 +suspendingScreen= +autodetectSuspendingScreen=True + +[keyboard] +driver=evdev +# filter input devices AUTO, ALL or a DEVICE NAME +device=AUTO +# gives fenrir exclusive access to the keyboard and let consume keystrokes. just disable on problems. +grabDevices=True +ignoreShortcuts=False +# the current shortcut layout located in /etc/fenrir/keyboard +keyboardLayout=test +# echo chars while typing. +charEcho=False +# echo deleted chars +charDeleteEcho=True +# echo word after pressing space +wordEcho=False +# interrupt speech on any keypress +interruptOnKeyPress=False +# timeout for double tap in sec +doubleTapDelay=0.2 + +[general] +debugLevel=1 +punctuationLevel=Some +numberOfClipboards=10 +# define the current fenrir key +fenrirKeys=KEY_KP0,KEY_META +timeFormat=%H:%M:%P +dateFormat=%A, %B %d, %Y +autoSpellCheck=True +spellCheckLanguage=en_US + +[promote] +enabled=True +inactiveTimeoutSec=120 +list= + + diff --git a/config/sound/default/Accept.wav b/config/sound/default-wav/Accept.wav similarity index 100% rename from config/sound/default/Accept.wav rename to config/sound/default-wav/Accept.wav diff --git a/config/sound/default/BrailleOff.wav b/config/sound/default-wav/BrailleOff.wav similarity index 100% rename from config/sound/default/BrailleOff.wav rename to config/sound/default-wav/BrailleOff.wav diff --git a/config/sound/default/BrailleOn.wav b/config/sound/default-wav/BrailleOn.wav similarity index 100% rename from config/sound/default/BrailleOn.wav rename to config/sound/default-wav/BrailleOn.wav diff --git a/config/sound/default/Cancel.wav b/config/sound/default-wav/Cancel.wav similarity index 100% rename from config/sound/default/Cancel.wav rename to config/sound/default-wav/Cancel.wav diff --git a/config/sound/default/Caps.wav b/config/sound/default-wav/Caps.wav similarity index 100% rename from config/sound/default/Caps.wav rename to config/sound/default-wav/Caps.wav diff --git a/config/sound/default/ChangeTTY.wav b/config/sound/default-wav/ChangeTTY.wav similarity index 100% rename from config/sound/default/ChangeTTY.wav rename to config/sound/default-wav/ChangeTTY.wav diff --git a/config/sound/default/ContentChanged.wav b/config/sound/default-wav/ContentChanged.wav similarity index 100% rename from config/sound/default/ContentChanged.wav rename to config/sound/default-wav/ContentChanged.wav diff --git a/config/sound/default/CopyToClipboard.wav b/config/sound/default-wav/CopyToClipboard.wav similarity index 100% rename from config/sound/default/CopyToClipboard.wav rename to config/sound/default-wav/CopyToClipboard.wav diff --git a/config/sound/default/EmptyLine.wav b/config/sound/default-wav/EmptyLine.wav similarity index 100% rename from config/sound/default/EmptyLine.wav rename to config/sound/default-wav/EmptyLine.wav diff --git a/config/sound/default/EndOfLine.wav b/config/sound/default-wav/EndOfLine.wav similarity index 100% rename from config/sound/default/EndOfLine.wav rename to config/sound/default-wav/EndOfLine.wav diff --git a/config/sound/default/EndOfScreen.wav b/config/sound/default-wav/EndOfScreen.wav similarity index 100% rename from config/sound/default/EndOfScreen.wav rename to config/sound/default-wav/EndOfScreen.wav diff --git a/config/sound/default/ErrorBraille.wav b/config/sound/default-wav/ErrorBraille.wav similarity index 100% rename from config/sound/default/ErrorBraille.wav rename to config/sound/default-wav/ErrorBraille.wav diff --git a/config/sound/default/ErrorScreen.wav b/config/sound/default-wav/ErrorScreen.wav similarity index 100% rename from config/sound/default/ErrorScreen.wav rename to config/sound/default-wav/ErrorScreen.wav diff --git a/config/sound/default/ErrorSpeech.wav b/config/sound/default-wav/ErrorSpeech.wav similarity index 100% rename from config/sound/default/ErrorSpeech.wav rename to config/sound/default-wav/ErrorSpeech.wav diff --git a/config/sound/default/HasAtributes.wav b/config/sound/default-wav/HasAtributes.wav similarity index 100% rename from config/sound/default/HasAtributes.wav rename to config/sound/default-wav/HasAtributes.wav diff --git a/config/sound/default/PasteClipboardOnScreen.wav b/config/sound/default-wav/PasteClipboardOnScreen.wav similarity index 100% rename from config/sound/default/PasteClipboardOnScreen.wav rename to config/sound/default-wav/PasteClipboardOnScreen.wav diff --git a/config/sound/default/PlaceEndCopyMark.wav b/config/sound/default-wav/PlaceEndMark.wav similarity index 100% rename from config/sound/default/PlaceEndCopyMark.wav rename to config/sound/default-wav/PlaceEndMark.wav diff --git a/config/sound/default/PlaceStartCopyMark.wav b/config/sound/default-wav/PlaceStartMark.wav similarity index 100% rename from config/sound/default/PlaceStartCopyMark.wav rename to config/sound/default-wav/PlaceStartMark.wav diff --git a/config/sound/default/ScreenReaderOff.wav b/config/sound/default-wav/ScreenReaderOff.wav similarity index 100% rename from config/sound/default/ScreenReaderOff.wav rename to config/sound/default-wav/ScreenReaderOff.wav diff --git a/config/sound/default/ScreenReaderOn.wav b/config/sound/default-wav/ScreenReaderOn.wav similarity index 100% rename from config/sound/default/ScreenReaderOn.wav rename to config/sound/default-wav/ScreenReaderOn.wav diff --git a/config/sound/default/SoundOff.wav b/config/sound/default-wav/SoundOff.wav similarity index 100% rename from config/sound/default/SoundOff.wav rename to config/sound/default-wav/SoundOff.wav diff --git a/config/sound/default/SoundOn.wav b/config/sound/default-wav/SoundOn.wav similarity index 100% rename from config/sound/default/SoundOn.wav rename to config/sound/default-wav/SoundOn.wav diff --git a/config/sound/default/SpeechOff.wav b/config/sound/default-wav/SpeechOff.wav similarity index 100% rename from config/sound/default/SpeechOff.wav rename to config/sound/default-wav/SpeechOff.wav diff --git a/config/sound/default/SpeechOn.wav b/config/sound/default-wav/SpeechOn.wav similarity index 100% rename from config/sound/default/SpeechOn.wav rename to config/sound/default-wav/SpeechOn.wav diff --git a/config/sound/default/StartOfLine.wav b/config/sound/default-wav/StartOfLine.wav similarity index 100% rename from config/sound/default/StartOfLine.wav rename to config/sound/default-wav/StartOfLine.wav diff --git a/config/sound/default/StartOfScreen.wav b/config/sound/default-wav/StartOfScreen.wav similarity index 100% rename from config/sound/default/StartOfScreen.wav rename to config/sound/default-wav/StartOfScreen.wav diff --git a/config/sound/default/mispell.wav b/config/sound/default-wav/mispell.wav similarity index 100% rename from config/sound/default/mispell.wav rename to config/sound/default-wav/mispell.wav diff --git a/config/sound/default-wav/soundicons.conf b/config/sound/default-wav/soundicons.conf new file mode 100644 index 00000000..3f0c4d55 --- /dev/null +++ b/config/sound/default-wav/soundicons.conf @@ -0,0 +1,50 @@ +# Screen Reader Turned On or Off +ScreenReaderOn='ScreenReaderOn.wav' +ScreenReaderOff='ScreenReaderOff.wav' +# Cancel the current command +Cancel='Cancel.wav' +# Accept command +Accept='Accept.wav' +# Bell a sound if the TTY is changed (ctrl + alt +FX) +ChangeTTY='ChangeTTY.wav' +# Is the first Position on the line +StartOfLine='StartOfLine.wav' +# Is the last position of the Line +EndOfLine='EndOfLine.wav' +# the Line is empty +EmptyLine='EmptyLine.wav' +# Is the first line on the screen. +StartOfScreen='StartOfScreen.wav' +# Is the last line on the screen +EndOfScreen='EndOfScreen.wav' +# The content has changed +ContentChanged='ContentChanged.wav' +# Speech has turned On or Off +SpeechOn='SpeechOn.wav' +SpeechOff='SpeechOff.wav' +# Braille has turned On or Off +BrailleOn='BrailleOn.wav' +BrailleOff='BrailleOff.wav' +# SoundIcons has turned On or Off +SoundOn='SoundOn.wav' +SoundOff='SoundOff.wav' +# Set beginnig mark +PlaceStartMark='PlaceStartMark.wav' +# Set end mark +PlaceEndMark='PlaceEndMark.wav' +# Copied to clipboard +CopyToClipboard='CopyToClipboard.wav' +# Pasted on the screen +PasedClipboardOnScreen='PasedClipboardOnScreen.wav' +# An error accoured while speech or braille output or reading the screen +ErrorSpeech='ErrorSpeech.wav' +ErrorBraille='ErrorBraille.wav' +ErrorScreen='ErrorScreen.wav' +# If you cursor over an text that has attributs (like color) +HasAttributes='HasAttributes.wav' +# fenrir can promote strings if they appear on the screen. +PromotedText='PromotedText.wav' +# missspelled indicator +mispell='mispell.wav' +# the for capital letter +capital='Caps.wav' diff --git a/config/sound/default/tmp.wav b/config/sound/default-wav/tmp.wav similarity index 100% rename from config/sound/default/tmp.wav rename to config/sound/default-wav/tmp.wav diff --git a/config/sound/default/PlaceEndCopyMark.opus b/config/sound/default/PlaceEndMark.opus similarity index 100% rename from config/sound/default/PlaceEndCopyMark.opus rename to config/sound/default/PlaceEndMark.opus diff --git a/config/sound/default/PlaceStartCopyMark.opus b/config/sound/default/PlaceStartMark.opus similarity index 100% rename from config/sound/default/PlaceStartCopyMark.opus rename to config/sound/default/PlaceStartMark.opus diff --git a/config/sound/default/soundicons.conf b/config/sound/default/soundicons.conf index b7912485..3b2fb522 100644 --- a/config/sound/default/soundicons.conf +++ b/config/sound/default/soundicons.conf @@ -29,9 +29,9 @@ BrailleOff='BrailleOff.opus' SoundOn='SoundOn.opus' SoundOff='SoundOff.opus' # Set beginnig mark for copy to clipboard -PlaceStartCopyMark='PlaceStartCopyMark.opus' +PlaceStartMark='PlaceStartMark.opus' # Set end mark for copy to clipboard -PlaceEndCopyMark='PlaceEndCopyMark.opus' +PlaceEndMark='PlaceEndMark.opus' # Copied to clipboard CopyToClipboard='CopyToClipboard.opus' # Pasted on the screen diff --git a/src/fenrir/commands/commands/copy_marked_to_clipboard.py b/src/fenrir/commands/commands/copy_marked_to_clipboard.py index 730082fc..1f6aee86 100644 --- a/src/fenrir/commands/commands/copy_marked_to_clipboard.py +++ b/src/fenrir/commands/commands/copy_marked_to_clipboard.py @@ -31,13 +31,9 @@ class command(): self.env['commandBuffer']['clipboard'] = [marked] + self.env['commandBuffer']['clipboard'][:self.env['runtime']['settingsManager'].getSettingAsInt('general', 'numberOfClipboards') -1] self.env['commandBuffer']['currClipboard'] = 0 # reset marks - self.env['commandBuffer']['Marks']['1'] = None - self.env['commandBuffer']['Marks']['2'] = None + self.env['runtime']['cursorManager'].clearMarks() - if marked.isspace(): - self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True) - else: - self.env['runtime']['outputManager'].presentText(marked, interrupt=True) + self.env['runtime']['outputManager'].presentText(marked, soundIcon='CopyToClipboard', interrupt=True) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/linux_paste_clipboard.py b/src/fenrir/commands/commands/linux_paste_clipboard.py index 88003398..d5777397 100644 --- a/src/fenrir/commands/commands/linux_paste_clipboard.py +++ b/src/fenrir/commands/commands/linux_paste_clipboard.py @@ -24,6 +24,7 @@ class command(): if currClipboard < 0: self.env['runtime']['outputManager'].presentText('clipboard empty', interrupt=True) return + self.env['runtime']['outputManager'].presentText('paste clipboard', soundIcon='PasedClipboardOnScreen', interrupt=True) with open("/dev/tty" + self.env['screenData']['newTTY'], 'w') as fd: for c in self.env['commandBuffer']['clipboard'][currClipboard]: fcntl.ioctl(fd, termios.TIOCSTI, c) diff --git a/src/fenrir/commands/commands/set_mark.py b/src/fenrir/commands/commands/set_mark.py index fd25ba99..2c2ddd6b 100644 --- a/src/fenrir/commands/commands/set_mark.py +++ b/src/fenrir/commands/commands/set_mark.py @@ -21,8 +21,10 @@ class command(): self.env['runtime']['outputManager'].presentText('no review cursor', interrupt=True) return - self.env['runtime']['cursorManager'].setMark() - self.env['runtime']['outputManager'].presentText('set mark', interrupt=True) - + currMark = self.env['runtime']['cursorManager'].setMark() + if currMark == 1: + self.env['runtime']['outputManager'].presentText('set mark',soundIcon='PlaceStartMark', interrupt=True) + elif currMark == 2: + self.env['runtime']['outputManager'].presentText('set mark',soundIcon='PlaceEndMark', interrupt=True) def setCallback(self, callback): pass diff --git a/src/fenrir/core/cursorManager.py b/src/fenrir/core/cursorManager.py index 30ccb21c..4d384ef4 100644 --- a/src/fenrir/core/cursorManager.py +++ b/src/fenrir/core/cursorManager.py @@ -27,8 +27,11 @@ class cursorManager(): def setMark(self): if not self.env['commandBuffer']['Marks']['1']: self.env['commandBuffer']['Marks']['1'] = self.env['screenData']['newCursorReview'].copy() + return 1 else: self.env['commandBuffer']['Marks']['2'] = self.env['screenData']['newCursorReview'].copy() + return 2 + return 0 def getReviewOrTextCursor(self): if self.env['screenData']['newCursorReview']: return self.env['screenData']['newCursorReview'].copy()