Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
yncat committed Oct 19, 2022
2 parents ceebeb3 + 07b8171 commit 8b0ffc1
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 17 deletions.
6 changes: 6 additions & 0 deletions addon/doc/en/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,9 @@ It is possible to add supported languages in the future, but it only supports Ja
If you have a GitHub account, [Universal Multilingual's issues page](https://github.com/actlaboratory/UML/issues) is the fastest path to reach us.

For email support, please send an email to "[email protected]".

## Changelog

### 2022/10/20 Version 1.0.1

1. Fixed an issue where UML initialization was failing When UML was loaded on NVDA startup. This issue was causing side effects such as say all command failure or synth freezing followed by an infinite loop.
8 changes: 7 additions & 1 deletion addon/doc/ja/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

## お勧めの設定

NVDAの音声設定で、「記号と文字の説明に音声の言語を使用」のチェックボックスにチェックを入れておくことを推奨しています。言葉で説明するのがなかなか難しいのですが、チェックを付けないほうが意図した読み上げになります
NVDAの音声設定で、「記号と文字の説明に音声の言語を使用」のチェックボックスにチェックを入れておくことを推奨しています。言葉で説明するのがなかなか難しいのですが、チェックを付けるほうが意図した読み上げになります

## 既知の問題点と制限事項

Expand All @@ -57,3 +57,9 @@ NVDAの音声設定で、「記号と文字の説明に音声の言語を使用
GitHubのアカウントを持っている方は、 [Universal Multilingualのissuesページ](https://github.com/actlaboratory/UML/issues) でissueを投稿していただけると、最も早く対応できます。

メールでのお問い合わせの場合は、 [email protected] 宛てに送信してください。

## 更新履歴

### 2022/10/20 Version 1.0.1

1. NVDAの起動と同時にUMLが読み込まれた場合に、UMLの内部で初期化処理に失敗していた不具合を修正しました。この不具合により、連続読みが正しく動作しない、UMLを再読み込みした場合に無限ループになって音声が出なくなるといった副作用が発生していました。
41 changes: 28 additions & 13 deletions addon/synthDrivers/UML.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,22 @@ def _execWhenDone(func, *args, mustBeAsync=True, **kwargs):
func(*args, **kwargs)


class SayAllWatcher(threading.Thread):
"""On NVDA startup, sayAllHandler is not instantiated by NVDA. We want to hook into the object. So we use a dedicated background thread for watching sayAllHandler existence."""

def run(self):
while(True):
if speech.sayAll.SayAllHandler is None:
continue
# found sayAllHandler
global origSpeechWithoutPausesInstance
origSpeechWithoutPausesInstance = speech.sayAll.SayAllHandler.speechWithoutPausesInstance
speech.sayAll.SayAllHandler.speechWithoutPausesInstance = speech.speechWithoutPauses.SpeechWithoutPauses(
speakFunc=hookedSpeak)
break
# end loop until sayAllHandler is available


class SynthDriver(synthDriverHandler.SynthDriver):
name = 'UML'
description = 'Universal multilingual'
Expand Down Expand Up @@ -113,19 +129,18 @@ def __init__(self):
self.thread.daemon = True
self.thread.start()
# Hook into NVDA internal, an evil cat!
try:
global origSpeak, UMLInstance
origSpeak = speech.speech.speak
UMLInstance = self
speech.speech.speak = hookedSpeak
global origSpeechWithoutPausesInstance
origSpeechWithoutPausesInstance = speech.sayAll.SayAllHandler.speechWithoutPausesInstance
speech.sayAll.SayAllHandler.speechWithoutPausesInstance = speech.speechWithoutPauses.SpeechWithoutPauses(
speakFunc=hookedSpeak)
global isHooking
isHooking = True
except BaseException as E:
pass # Evil!
self.setHook()

def setHook(self):
global origSpeak, UMLInstance
origSpeak = speech.speech.speak
UMLInstance = self
speech.speech.speak = hookedSpeak
global isHooking
isHooking = True
w = SayAllWatcher()
w.setDaemon(True)
w.start()

def terminate(self):
global isHooking
Expand Down
4 changes: 2 additions & 2 deletions buildVars.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ def _(arg):
return arg


ADDON_VERSION = "1.0.0"
ADDON_RELEASE_DATE = "2022-08-11"
ADDON_VERSION = "1.0.1"
ADDON_RELEASE_DATE = "2022-10-20"
ADDON_NAME = "UniversalMultilingual"
ADDON_KEYWORD = "UML"

Expand Down
1 change: 0 additions & 1 deletion tools/bumpup.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ def bumpup(v, d):
with open(VERSION_FILE_NAME, "w") as f:
json.dump(v,f)
print("Saved %s." % VERSION_FILE_NAME)
patch(os.path.join("addon","doc","ja","readme.md"),r'# English Reading Enhancer Ver', r'\(更新: ', v)
patch("buildVars.py",r'ADDON_VERSION = "', r'ADDON_RELEASE_DATE = "', v)

def patch(filename, version_regexp, release_date_regexp, version_object):
Expand Down
1 change: 1 addition & 0 deletions version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version": "1.0.1", "release_date": "2022-10-20"}

0 comments on commit 8b0ffc1

Please sign in to comment.