From 9ce41dad10121e27f106513c711e0cde4539726b Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Wed, 6 Sep 2023 00:44:13 +0900 Subject: [PATCH 1/2] [Test] bugfix_config_window_compact_mode --- main.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index d7c5e93b..d9fa60b5 100644 --- a/main.py +++ b/main.py @@ -202,10 +202,20 @@ def callbackToggleForeground(is_turned_on): # Compact Mode Switch def callbackEnableConfigWindowCompactMode(): config.IS_CONFIG_WINDOW_COMPACT_MODE = True + model.stopCheckMicEnergy() + view.replaceConfigWindowMicThresholdCheckButtonToPassive() + model.stopCheckSpeakerEnergy() + view.replaceConfigWindowSpeakerThresholdCheckButtonToPassive() + view.reloadConfigWindowSettingBoxContainer() def callbackDisableConfigWindowCompactMode(): config.IS_CONFIG_WINDOW_COMPACT_MODE = False + model.stopCheckMicEnergy() + view.replaceConfigWindowMicThresholdCheckButtonToPassive() + model.stopCheckSpeakerEnergy() + view.replaceConfigWindowSpeakerThresholdCheckButtonToPassive() + view.reloadConfigWindowSettingBoxContainer() # Appearance Tab @@ -276,7 +286,7 @@ def setProgressBarMicEnergy(energy): def callbackCheckMicThreshold(is_turned_on): print("callbackCheckMicThreshold", is_turned_on) if is_turned_on is True: - view.setConfigWindowCompactModeSwitchStatusToDisabled() + # view.setConfigWindowCompactModeSwitchStatusToDisabled() view.setConfigWindowThresholdCheckWidgetsStatusToDisabled() model.startCheckMicEnergy(setProgressBarMicEnergy) @@ -288,7 +298,7 @@ def callbackCheckMicThreshold(is_turned_on): view.replaceConfigWindowMicThresholdCheckButtonToPassive() view.setConfigWindowThresholdCheckWidgetsStatusToNormal() - view.setConfigWindowCompactModeSwitchStatusToNormal() + # view.setConfigWindowCompactModeSwitchStatusToNormal() def callbackSetMicRecordTimeout(value): print("callbackSetMicRecordTimeout", int(value)) @@ -337,7 +347,7 @@ def setProgressBarSpeakerEnergy(energy): def callbackCheckSpeakerThreshold(is_turned_on): print("callbackCheckSpeakerThreshold", is_turned_on) if is_turned_on is True: - view.setConfigWindowCompactModeSwitchStatusToDisabled() + # view.setConfigWindowCompactModeSwitchStatusToDisabled() view.setConfigWindowThresholdCheckWidgetsStatusToDisabled() model.startCheckSpeakerEnergy(setProgressBarSpeakerEnergy) @@ -350,7 +360,7 @@ def callbackCheckSpeakerThreshold(is_turned_on): view.replaceConfigWindowSpeakerThresholdCheckButtonToPassive() view.setConfigWindowThresholdCheckWidgetsStatusToNormal() - view.setConfigWindowCompactModeSwitchStatusToNormal() + # view.setConfigWindowCompactModeSwitchStatusToNormal() def callbackSetSpeakerRecordTimeout(value): print("callbackSetSpeakerRecordTimeout", int(value)) From 5db665ecf13d01b11372685d7337f3c650eb4410 Mon Sep 17 00:00:00 2001 From: misyaguziya Date: Wed, 6 Sep 2023 00:55:28 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=90=9B[bugfix]=20model.py=20=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=AB=E3=83=90=E3=83=83=E3=82=AF=E3=81=AE=E9=96=A2?= =?UTF-8?q?=E6=95=B0(fnc)=E3=81=8C=E5=91=BC=E3=81=B9=E3=81=AA=E3=81=84?= =?UTF-8?q?=E3=81=93=E3=81=A8=E3=82=92=E8=80=83=E6=85=AE=E3=81=97=E3=81=A6?= =?UTF-8?q?try=20except=E3=81=A7=E5=9B=B2=E3=81=86=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/model.py b/model.py index 81d9a9d7..99923c2c 100644 --- a/model.py +++ b/model.py @@ -231,7 +231,10 @@ class Model: def sendMicTranscript(): mic_transcriber.transcribeAudioQueue(mic_audio_queue, config.SOURCE_LANGUAGE, config.SOURCE_COUNTRY) message = mic_transcriber.getTranscript() - fnc(message) + try: + fnc(message) + except: + pass self.mic_print_transcript = threadFnc(sendMicTranscript) self.mic_print_transcript.daemon = True @@ -248,7 +251,10 @@ class Model: def sendMicEnergy(): if mic_energy_queue.empty() is False: energy = mic_energy_queue.get() - fnc(energy) + try: + fnc(energy) + except: + pass sleep(0.01) mic_energy_queue = Queue() @@ -284,7 +290,10 @@ class Model: def sendSpkTranscript(): spk_transcriber.transcribeAudioQueue(spk_audio_queue, config.TARGET_LANGUAGE, config.TARGET_COUNTRY) message = spk_transcriber.getTranscript() - fnc(message) + try: + fnc(message) + except: + pass self.spk_print_transcript = threadFnc(sendSpkTranscript) self.spk_print_transcript.daemon = True @@ -301,7 +310,10 @@ class Model: def sendSpeakerEnergy(): if speaker_energy_queue.empty() is False: energy = speaker_energy_queue.get() - fnc(energy) + try: + fnc(energy) + except: + pass sleep(0.01) speaker_device = [device for device in getOutputDevices() if device["name"] == config.CHOICE_SPEAKER_DEVICE][0]