Skip to content

Commit 343ad3c

Browse files
make it compatible with NVDA 2021.1beta3
1 parent a813744 commit 343ad3c

File tree

12 files changed

+518
-117
lines changed

12 files changed

+518
-117
lines changed

addon/doc/en/readme.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Note 1: You can now use a custom dialog box entitled "Dual voice" in the NVDA me
1010

1111
Note 2: A complimentary free software namely SAPI_Unifier is designed to add support for Windows 10 oneCore voices and Microsoft speech platform (speech server) voices to the Dual Voice for NVDA. So, I suggest using [SAPI_Unifier](https://mahmood-taghavi.github.io/SAPI_Unifier/) to extend the capabilities of the Dual Voice.
1212

13-
Note 3: The latest version of NVDA which supports Windows XP and Windows Vista is NVDA 2017.3 and the latest Dual Voice which is compatible with NVDA 2017.3 is version 3.1.
13+
Note 3: The latest version of NVDA which supports Windows XP and Windows Vista is NVDA 2017.3 and the latest Dual Voice which is compatible with that NVDA is version 3.1.
1414

1515
This package is distributed under the terms of the GNU General Public License, version 2. Please see the file "COPYING.txt" for further details.
1616

17-
Copyright © 2015-2020 Seyed Mahmood Taghavi-Shahri.
17+
Copyright © 2015-2021 Seyed Mahmood Taghavi-Shahri.

addon/globalPlugins/dual_voice_globalPlugin/__init__.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# -*- coding: UTF-8 -*-
2-
#A part of Dual Voice for NVDA
3-
#Copyright (C) 2015-2020 Seyed Mahmood Taghavi Shahri
4-
#https://mahmood-taghavi.github.io/dual_voice/
5-
#This file is covered by the GNU General Public License version 3.
6-
#See the file COPYING for more details.
2+
# A part of Dual Voice for NVDA
3+
# Copyright (C) 2015-2021 Seyed Mahmood Taghavi Shahri
4+
# https://mahmood-taghavi.github.io/dual_voice/
5+
# This file is covered by the GNU General Public License version 3.
6+
# See the file COPYING for more details.
77

88
import globalPluginHandler, wx, gui
99
from .dialogs import *
@@ -21,18 +21,18 @@ def __init__(self):
2121

2222
def createMenu(self):
2323
self.submenu_dualvoice = wx.Menu()
24-
item = self.submenu_dualvoice.Append(wx.ID_ANY, _('&Settings of the Dual Voice...'))
24+
item = self.submenu_dualvoice.Append(wx.ID_ANY, _('&Settings of the Dual voice...'))
2525
gui.mainFrame.sysTrayIcon.Bind(wx.EVT_MENU , lambda e : gui.mainFrame._popupSettingsDialog(DualVoiceLanguageSettingsDialog), item)
2626
item = self.submenu_dualvoice.Append(wx.ID_ANY, _('Visit the SAPI &Unifier website!'))
2727
gui.mainFrame.sysTrayIcon.Bind(wx.EVT_MENU, self.onSAPI_Unifier, item)
2828
item = self.submenu_dualvoice.Append(wx.ID_ANY, _('Visit the &Dual Voice website!'))
2929
gui.mainFrame.sysTrayIcon.Bind(wx.EVT_MENU, self.onCheckUpdate, item)
30-
item = self.submenu_dualvoice.Append(wx.ID_ANY, _('&About the Dual Voice for NVDA'))
30+
item = self.submenu_dualvoice.Append(wx.ID_ANY, _('&About the Dual voice for NVDA'))
3131
gui.mainFrame.sysTrayIcon.Bind(wx.EVT_MENU, self.onAbout, item)
32-
self.submenu_item = gui.mainFrame.sysTrayIcon.menu.InsertMenu(2, wx.ID_ANY, _('Dual &Voice'), self.submenu_dualvoice)
32+
self.submenu_item = gui.mainFrame.sysTrayIcon.menu.InsertMenu(2, wx.ID_ANY, _('Dual &voice'), self.submenu_dualvoice)
3333

3434
def onAbout(self, event):
35-
gui.messageBox('Version 4.9 by Seyed Mahmood Taghavi-Shahri, Iran', _('About the Dual Voice add-on for NVDA'), wx.OK)
35+
gui.messageBox('Version 5.0 by Seyed Mahmood Taghavi-Shahri, Iran', _('About the Dual voice add-on for NVDA'), wx.OK)
3636

3737
def onCheckUpdate(self, event):
3838
webbrowser.open("https://mahmood-taghavi.github.io/dual_voice/")

addon/globalPlugins/dual_voice_globalPlugin/dialogs.py

+26-26
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# -*- coding: UTF-8 -*-
2-
#A part of Dual Voice for NVDA
3-
#Copyright (C) 2015-2020 Seyed Mahmood Taghavi Shahri
4-
#https://mahmood-taghavi.github.io/dual_voice/
5-
#This file is covered by the GNU General Public License version 3.
6-
#See the file COPYING for more details.
2+
# A part of Dual Voice for NVDA
3+
# Copyright (C) 2015-2021 Seyed Mahmood Taghavi Shahri
4+
# https://mahmood-taghavi.github.io/dual_voice/
5+
# This file is covered by the GNU General Public License version 3.
6+
# See the file COPYING for more details.
77

88
import wx
99
import gui
@@ -14,8 +14,8 @@
1414
#import languageHandler
1515
from logHandler import log
1616
import speech
17-
from synthDriverHandler import SynthDriver
1817
from synthDrivers import _realtime
18+
import synthDriverHandler
1919

2020
class DualVoiceLanguageSettingsDialog(gui.SettingsDialog):
2121
title = _('The Dual Voice settings')
@@ -24,9 +24,9 @@ def __init__(self, parent):
2424

2525
def makeSettings(self, sizer):
2626
synthInfo = _('Your current speech synthesizer is the %s. Please select the Dual Voice as the speech synthesizer in the NVDA speech settings.')
27-
synthName = speech.getSynth().description
27+
synthName = synthDriverHandler.getSynth().description
2828
synthInfo = synthInfo.replace('%s', synthName)
29-
if ('dual_sapi5' not in speech.getSynth().name):
29+
if ('dual_sapi5' not in synthDriverHandler.getSynth().name):
3030
infoLabel = wx.StaticText(self, label = synthInfo)
3131
else:
3232
## find the primary voice and show it in a label
@@ -41,11 +41,11 @@ def makeSettings(self, sizer):
4141
infoLabel.Wrap(self.GetSize()[0])
4242
sizer.Add(infoLabel)
4343
###
44-
if ('dual_sapi5' in speech.getSynth().name):
44+
if ('dual_sapi5' in synthDriverHandler.getSynth().name):
4545
sVoicesLabel = wx.StaticText(self, label=_('Secondary &voice:'))
4646
sizer.Add(sVoicesLabel)
4747
self._sVoicesChoice = wx.Choice(self, choices = _realtime.list_VoiceName)
48-
if ('dual_sapi5' in speech.getSynth().name):
48+
if ('dual_sapi5' in synthDriverHandler.getSynth().name):
4949
check = _realtime.sapi5SecondVoice in _realtime.list_VoiceAttribName
5050
if check:
5151
index = _realtime.list_VoiceAttribName.index(_realtime.sapi5SecondVoice)
@@ -62,7 +62,7 @@ def makeSettings(self, sizer):
6262
sizer.Add(self._sVoicesChoice)
6363
##
6464
self._secondIsLatinCheckBox = wx.CheckBox(self, label = _('&Use the secondary voice for reading Latin text instead of non-Latin.'))
65-
if ('dual_sapi5' in speech.getSynth().name):
65+
if ('dual_sapi5' in synthDriverHandler.getSynth().name):
6666
self._secondIsLatinCheckBox.SetValue(_realtime.sapi5SecondIsLatin)
6767
self._secondIsLatinCheckBox.Bind(wx.EVT_CHECKBOX, self.onSIsLatinCheck)
6868
sizer.Add(self._secondIsLatinCheckBox)
@@ -71,33 +71,33 @@ def makeSettings(self, sizer):
7171
sizer.Add(sRateLabel)
7272
self._sRateSlider = wx.Slider(self, value = 50, minValue = 0, maxValue = 100, style = wx.SL_HORIZONTAL)
7373
self._sRateSlider.Bind(wx.EVT_SLIDER, self.OnSRateSliderScroll)
74-
if ('dual_sapi5' in speech.getSynth().name):
74+
if ('dual_sapi5' in synthDriverHandler.getSynth().name):
7575
self._sRateSlider.SetValue(_realtime.sapi5SecondRate)
7676
sizer.Add(self._sRateSlider)
7777
##
7878
sPitchLabel = wx.StaticText(self, label=_('&Pitch:'))
7979
sizer.Add(sPitchLabel)
8080
self._sPitchSlider = wx.Slider(self, value = 50, minValue = 0, maxValue = 100, style = wx.SL_HORIZONTAL)
8181
self._sPitchSlider.Bind(wx.EVT_SLIDER, self.OnSPitchSliderScroll)
82-
if ('dual_sapi5' in speech.getSynth().name):
82+
if ('dual_sapi5' in synthDriverHandler.getSynth().name):
8383
self._sPitchSlider.SetValue(_realtime.sapi5SecondPitch)
8484
sizer.Add(self._sPitchSlider)
8585
##
8686
sVolumeLabel = wx.StaticText(self, label=_('V&olume:'))
8787
sizer.Add(sVolumeLabel)
8888
self._sVolumeSlider = wx.Slider(self, value = 100, minValue = 0, maxValue = 100, style = wx.SL_HORIZONTAL)
8989
self._sVolumeSlider.Bind(wx.EVT_SLIDER, self.OnSVolumeSliderScroll)
90-
if ('dual_sapi5' in speech.getSynth().name):
90+
if ('dual_sapi5' in synthDriverHandler.getSynth().name):
9191
self._sVolumeSlider.SetValue(_realtime.sapi5SecondVolume)
9292
sizer.Add(self._sVolumeSlider)
9393
##
9494
self._nonLatinPriorityCheckBox = wx.CheckBox(self, label = _('&Prioritize non-Latin text over Latin text.'))
95-
if ('dual_sapi5' in speech.getSynth().name):
95+
if ('dual_sapi5' in synthDriverHandler.getSynth().name):
9696
self._nonLatinPriorityCheckBox.SetValue(_realtime.sapi5NonLatinPriority)
9797
self._nonLatinPriorityCheckBox.Bind(wx.EVT_CHECKBOX, self.nonLatinPriorityCheck)
9898
sizer.Add(self._nonLatinPriorityCheckBox)
9999
self._considerContextCheckBox = wx.CheckBox(self, label = _('Read &numbers and punctuations based on surrounding text.'))
100-
if ('dual_sapi5' in speech.getSynth().name):
100+
if ('dual_sapi5' in synthDriverHandler.getSynth().name):
101101
self._considerContextCheckBox.SetValue(_realtime.sapi5ConsiderContext)
102102
self._considerContextCheckBox.Bind(wx.EVT_CHECKBOX, self.considerContextCheck)
103103
sizer.Add(self._considerContextCheckBox)
@@ -109,7 +109,7 @@ def makeSettings(self, sizer):
109109
#self._typingAreaTextCtrl.SetValue(_realtime.list_VoiceName[0])
110110
self._typingAreaTextCtrl.SetValue(_realtime.typingArea)
111111
sizer.Add(self._typingAreaTextCtrl)
112-
if ('dual_sapi5' not in speech.getSynth().name):
112+
if ('dual_sapi5' not in synthDriverHandler.getSynth().name):
113113
sVoicesLabel.Disable()
114114
self._sVoicesChoice.Disable()
115115
sRateLabel.Disable()
@@ -128,7 +128,7 @@ def makeSettings(self, sizer):
128128

129129
def onOk(self, event):
130130
# Update Configurations
131-
if ('dual_sapi5' in speech.getSynth().name):
131+
if ('dual_sapi5' in synthDriverHandler.getSynth().name):
132132
_realtime.typingArea = self._typingAreaTextCtrl.GetValue()
133133
config.conf["dual_voice"]["sapi5SecondVoice"] = _realtime.sapi5SecondVoice
134134
config.conf["dual_voice"]["sapi5SecondRate"] = _realtime.sapi5SecondRate
@@ -142,7 +142,7 @@ def onOk(self, event):
142142

143143
def onCancel(self, event):
144144
# Restore Configurations
145-
if ('dual_sapi5' in speech.getSynth().name):
145+
if ('dual_sapi5' in synthDriverHandler.getSynth().name):
146146
_realtime.sapi5SecondVoice = config.conf["dual_voice"]["sapi5SecondVoice"]
147147
_realtime.sapi5SecondRate = config.conf["dual_voice"]["sapi5SecondRate"]
148148
_realtime.sapi5SecondPitch = config.conf["dual_voice"]["sapi5SecondPitch"]
@@ -154,30 +154,30 @@ def onCancel(self, event):
154154

155155

156156
def onSVoiceChange(self, event):
157-
if ('dual_sapi5' in speech.getSynth().name):
157+
if ('dual_sapi5' in synthDriverHandler.getSynth().name):
158158
_realtime.sapi5SecondVoice = _realtime.list_VoiceAttribName[self._sVoicesChoice.GetSelection()]
159159
_realtime.problemisticSapi5SecondVoice = ''
160160

161161
def OnSRateSliderScroll(self, event):
162-
if ('dual_sapi5' in speech.getSynth().name):
162+
if ('dual_sapi5' in synthDriverHandler.getSynth().name):
163163
_realtime.sapi5SecondRate = self._sRateSlider.GetValue()
164164

165165
def OnSPitchSliderScroll(self, event):
166-
if ('dual_sapi5' in speech.getSynth().name):
166+
if ('dual_sapi5' in synthDriverHandler.getSynth().name):
167167
_realtime.sapi5SecondPitch = self._sPitchSlider.GetValue()
168168

169169
def OnSVolumeSliderScroll(self, event):
170-
if ('dual_sapi5' in speech.getSynth().name):
170+
if ('dual_sapi5' in synthDriverHandler.getSynth().name):
171171
_realtime.sapi5SecondVolume = self._sVolumeSlider.GetValue()
172172

173173
def onSIsLatinCheck(self, event):
174-
if ('dual_sapi5' in speech.getSynth().name):
174+
if ('dual_sapi5' in synthDriverHandler.getSynth().name):
175175
_realtime.sapi5SecondIsLatin = self._secondIsLatinCheckBox.GetValue()
176176

177177
def nonLatinPriorityCheck(self, event):
178-
if ('dual_sapi5' in speech.getSynth().name):
178+
if ('dual_sapi5' in synthDriverHandler.getSynth().name):
179179
_realtime.sapi5NonLatinPriority = self._nonLatinPriorityCheckBox.GetValue()
180180

181181
def considerContextCheck(self, event):
182-
if ('dual_sapi5' in speech.getSynth().name):
182+
if ('dual_sapi5' in synthDriverHandler.getSynth().name):
183183
_realtime.sapi5ConsiderContext = self._considerContextCheckBox.GetValue()

addon/locale/en/LC_MESSAGES/nvda.po

+12-13
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
# Translation of the Dual Voice for NVDA add-on.
2-
# Copyright (C) 2020 Seyed Mahmood Taghavi-Shahri.
3-
# https://mahmood-taghavi.github.io/dual_voice/
1+
# English translations for the Dual Voice for NVDA package.
2+
# Copyright (C) 2020 THE Dual Voice for NVDA'S COPYRIGHT HOLDER
43
# This file is distributed under the same license as the Dual Voice for NVDA package.
54
# <EMAIL@ADDRESS>, 2020.
65
#
76
msgid ""
87
msgstr ""
98
"Project-Id-Version: Dual Voice for NVDA\n"
109
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2020-04-04 00:01+0430\n"
12-
"PO-Revision-Date: 2020-04-04 11:34+0430\n"
10+
"POT-Creation-Date: 2020-03-30 20:03+0430\n"
11+
"PO-Revision-Date: 2020-03-30 20:08+0430\n"
1312
"Last-Translator: <EMAIL@ADDRESS>\n"
1413
"Language-Team: English\n"
1514
"Language: en\n"
@@ -23,8 +22,8 @@ msgid "You can type here to check the voices"
2322
msgstr "You can type here to check the voices"
2423

2524
#: D:\~Work\github\dual_voice\addon\globalPlugins\dual_voice_globalPlugin\__init__.py:24
26-
msgid "&Settings of the Dual Voice..."
27-
msgstr "&Settings of the Dual Voice..."
25+
msgid "&Settings of the Dual voice..."
26+
msgstr "&Settings of the Dual voice..."
2827

2928
#: D:\~Work\github\dual_voice\addon\globalPlugins\dual_voice_globalPlugin\__init__.py:26
3029
msgid "Visit the SAPI &Unifier website!"
@@ -35,16 +34,16 @@ msgid "Visit the &Dual Voice website!"
3534
msgstr "Visit the &Dual Voice website!"
3635

3736
#: D:\~Work\github\dual_voice\addon\globalPlugins\dual_voice_globalPlugin\__init__.py:30
38-
msgid "&About the Dual Voice for NVDA"
39-
msgstr "&About the Dual Voice for NVDA"
37+
msgid "&About the Dual voice for NVDA"
38+
msgstr "&About the Dual voice for NVDA"
4039

4140
#: D:\~Work\github\dual_voice\addon\globalPlugins\dual_voice_globalPlugin\__init__.py:32
42-
msgid "Dual &Voice"
43-
msgstr "Dual &Voice"
41+
msgid "Dual &voice"
42+
msgstr "Dual &voice"
4443

4544
#: D:\~Work\github\dual_voice\addon\globalPlugins\dual_voice_globalPlugin\__init__.py:35
46-
msgid "About the Dual Voice add-on for NVDA"
47-
msgstr "About the Dual Voice add-on for NVDA"
45+
msgid "About the Dual voice add-on for NVDA"
46+
msgstr "About the Dual voice add-on for NVDA"
4847

4948
#: D:\~Work\github\dual_voice\addon\globalPlugins\dual_voice_globalPlugin\dialogs.py:21
5049
msgid "The Dual Voice settings"

addon/locale/fa/LC_MESSAGES/nvda.po

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
# Translation of the Dual Voice for NVDA add-on.
2-
# Copyright (C) 2020 Seyed Mahmood Taghavi-Shahri.
3-
# https://mahmood-taghavi.github.io/dual_voice/
1+
# Persian translations for the Dual Voice for NVDA package.
2+
# Copyright (C) 2020 THE Dual Voice for NVDA'S COPYRIGHT HOLDER
43
# This file is distributed under the same license as the Dual Voice for NVDA package.
54
# <EMAIL@ADDRESS>, 2020.
65
#
@@ -23,7 +22,7 @@ msgid "You can type here to check the voices"
2322
msgstr "شما می‌توانید برای بررسی صداها در اینجا تایپ کنید"
2423

2524
#: D:\~Work\github\dual_voice\addon\globalPlugins\dual_voice_globalPlugin\__init__.py:24
26-
msgid "&Settings of the Dual Voice..."
25+
msgid "&Settings of the Dual voice..."
2726
msgstr "&تنظیمات صدای دوگانه..."
2827

2928
#: D:\~Work\github\dual_voice\addon\globalPlugins\dual_voice_globalPlugin\__init__.py:26
@@ -35,15 +34,15 @@ msgid "Visit the &Dual Voice website!"
3534
msgstr "بازدید از &وبسایت صدای دوگانه!"
3635

3736
#: D:\~Work\github\dual_voice\addon\globalPlugins\dual_voice_globalPlugin\__init__.py:30
38-
msgid "&About the Dual Voice for NVDA"
37+
msgid "&About the Dual voice for NVDA"
3938
msgstr "&درباره صدای دوگانه برای NVDA"
4039

4140
#: D:\~Work\github\dual_voice\addon\globalPlugins\dual_voice_globalPlugin\__init__.py:32
42-
msgid "Dual &Voice"
41+
msgid "Dual &voice"
4342
msgstr "&صدای دوگانه"
4443

4544
#: D:\~Work\github\dual_voice\addon\globalPlugins\dual_voice_globalPlugin\__init__.py:35
46-
msgid "About the Dual Voice add-on for NVDA"
45+
msgid "About the Dual voice add-on for NVDA"
4746
msgstr "درباره افزونه صدای دوگانه برای NVDA"
4847

4948
#: D:\~Work\github\dual_voice\addon\globalPlugins\dual_voice_globalPlugin\dialogs.py:21

addon/synthDrivers/_dual_sapi5.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# -*- coding: UTF-8 -*-
2-
#A part of Dual Voice for NVDA
3-
#Copyright (C) 2015-2020 Seyed Mahmood Taghavi Shahri
4-
#https://mahmood-taghavi.github.io/dual_voice/
5-
#This file is covered by the GNU General Public License version 3.
6-
#See the file COPYING for more details.
2+
# A part of Dual Voice for NVDA
3+
# Copyright (C) 2015-2021 Seyed Mahmood Taghavi Shahri
4+
# https://mahmood-taghavi.github.io/dual_voice/
5+
# This file is covered by the GNU General Public License version 3.
6+
# See the file COPYING for more details.
77

88
#import config
99
from synthDrivers import _realtime

addon/synthDrivers/_dualvoice.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# -*- coding: UTF-8 -*-
2-
#A part of Dual Voice for NVDA
3-
#Copyright (C) 2015-2020 Seyed Mahmood Taghavi Shahri
4-
#https://mahmood-taghavi.github.io/dual_voice/
5-
#This file is covered by the GNU General Public License version 3.
6-
#See the file COPYING for more details.
2+
# A part of Dual Voice for NVDA
3+
# Copyright (C) 2015-2021 Seyed Mahmood Taghavi Shahri
4+
# https://mahmood-taghavi.github.io/dual_voice/
5+
# This file is covered by the GNU General Public License version 3.
6+
# See the file COPYING for more details.
77

88
def charactertype(character):
99
character.encode('utf-8')

addon/synthDrivers/_realtime.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# -*- coding: UTF-8 -*-
2-
#A part of Dual Voice for NVDA
3-
#Copyright (C) 2015-2020 Seyed Mahmood Taghavi Shahri
4-
#https://mahmood-taghavi.github.io/dual_voice/
5-
#This file is covered by the GNU General Public License version 3.
6-
#See the file COPYING for more details.
2+
# A part of Dual Voice for NVDA
3+
# Copyright (C) 2015-2021 Seyed Mahmood Taghavi Shahri
4+
# https://mahmood-taghavi.github.io/dual_voice/
5+
# This file is covered by the GNU General Public License version 3.
6+
# See the file COPYING for more details.
77

88
typingArea = ''
99
list_VoiceAttribName = []

0 commit comments

Comments
 (0)