From 2fd40aeb23e0ebe1222d22182c594bb31f494694 Mon Sep 17 00:00:00 2001 From: misyaguziya Date: Mon, 2 Sep 2024 14:04:51 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=91=8D=EF=B8=8F[Update]=20Model=20:?= =?UTF-8?q?=20messagebox=20send/typing/typing=5Fstop=E3=81=A7=E4=B8=8D?= =?UTF-8?q?=E8=A6=81=E3=81=AA=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-python/webui_controller.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src-python/webui_controller.py b/src-python/webui_controller.py index 78915e37..f6b6b285 100644 --- a/src-python/webui_controller.py +++ b/src-python/webui_controller.py @@ -364,15 +364,6 @@ def callbackMessageBoxTypingStop(*args, **kwargs) -> dict: model.oscStopSendTyping() return {"status":200} -def messageBoxFocusIn(e): - # view.foregroundOffIfForegroundEnabled() - pass - -def messageBoxFocusOut(e): - # view.foregroundOnIfForegroundEnabled() - if config.ENABLE_SEND_MESSAGE_TO_VRC is True: - model.oscStopSendTyping() - # def addSentMessageLog(sent_message): # config.SENT_MESSAGES_LOG.append(sent_message) # config.CURRENT_SENT_MESSAGES_LOG_INDEX = len(config.SENT_MESSAGES_LOG) From e45fc340e8af4786499ea37e2006631e31d8ed83 Mon Sep 17 00:00:00 2001 From: misyaguziya Date: Mon, 2 Sep 2024 16:01:31 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=91=8D=EF=B8=8F[Update]=20Model=20:?= =?UTF-8?q?=20transcription=E3=81=AE=E7=B5=82=E4=BA=86=E5=87=A6=E7=90=86?= =?UTF-8?q?=E3=81=AEaction=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-python/webui_controller.py | 34 ++++++++++++---------------------- src-python/webui_mainloop.py | 6 ------ 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/src-python/webui_controller.py b/src-python/webui_controller.py index f6b6b285..9d9eb932 100644 --- a/src-python/webui_controller.py +++ b/src-python/webui_controller.py @@ -157,24 +157,19 @@ def startTranscriptionSendMessage(action:Callable[[dict], None]) -> None: mic_message = MicMessage(action) model.startMicTranscript(mic_message.send) -def stopTranscriptionSendMessage(action:Callable[[dict], None]) -> None: +def stopTranscriptionSendMessage() -> None: model.stopMicTranscript() - action("mic", { - "status":200, - "result":{ - "message":"Stopped sending messages" - } - }) def startThreadingTranscriptionSendMessage(action:Callable[[dict], None]) -> None: th_startTranscriptionSendMessage = Thread(target=startTranscriptionSendMessage, args=(action,)) th_startTranscriptionSendMessage.daemon = True th_startTranscriptionSendMessage.start() -def stopThreadingTranscriptionSendMessage(action:Callable[[dict], None]) -> None: - th_stopTranscriptionSendMessage = Thread(target=stopTranscriptionSendMessage, args=(action,)) +def stopThreadingTranscriptionSendMessage() -> None: + th_stopTranscriptionSendMessage = Thread(target=stopTranscriptionSendMessage) th_stopTranscriptionSendMessage.daemon = True th_stopTranscriptionSendMessage.start() + th_stopTranscriptionSendMessage.join() def startTranscriptionSendMessageOnCloseConfigWindow(action:Callable[[dict], None]) -> None: mic_message = MicMessage(action) @@ -256,24 +251,19 @@ def startTranscriptionReceiveMessage(action:Callable[[dict], None]) -> None: speaker_message = SpeakerMessage(action) model.startSpeakerTranscript(speaker_message.receive) -def stopTranscriptionReceiveMessage(action:Callable[[dict], None]) -> None: +def stopTranscriptionReceiveMessage() -> None: model.stopSpeakerTranscript() - action("speaker", { - "status":200, - "result": { - "message":"Stopped receiving messages" - } - }) def startThreadingTranscriptionReceiveMessage(action:Callable[[dict], None]) -> None: th_startTranscriptionReceiveMessage = Thread(target=startTranscriptionReceiveMessage, args=(action,)) th_startTranscriptionReceiveMessage.daemon = True th_startTranscriptionReceiveMessage.start() -def stopThreadingTranscriptionReceiveMessage(action:Callable[[dict], None]) -> None: - th_stopTranscriptionReceiveMessage = Thread(target=stopTranscriptionReceiveMessage, args=(action,)) +def stopThreadingTranscriptionReceiveMessage() -> None: + th_stopTranscriptionReceiveMessage = Thread(target=stopTranscriptionReceiveMessage) th_stopTranscriptionReceiveMessage.daemon = True th_stopTranscriptionReceiveMessage.start() + th_stopTranscriptionReceiveMessage.join() def startTranscriptionReceiveMessageOnCloseConfigWindow(action:Callable[[dict], None]) -> None: speaker_message = SpeakerMessage(action) @@ -522,10 +512,10 @@ def callbackEnableTranscriptionSend(data, action, *args, **kwargs) -> dict: startThreadingTranscriptionSendMessage(action) return {"status":200, "result":config.ENABLE_TRANSCRIPTION_SEND} -def callbackDisableTranscriptionSend(data, action, *args, **kwargs) -> dict: +def callbackDisableTranscriptionSend(*args, **kwargs) -> dict: printLog("Disable Transcription Send") config.ENABLE_TRANSCRIPTION_SEND = False - stopThreadingTranscriptionSendMessage(action) + stopThreadingTranscriptionSendMessage() return {"status":200, "result":config.ENABLE_TRANSCRIPTION_SEND} def callbackEnableTranscriptionReceive(data, action, *args, **kwargs) -> dict: @@ -538,10 +528,10 @@ def callbackEnableTranscriptionReceive(data, action, *args, **kwargs) -> dict: model.startOverlay() return {"status":200, "result":config.ENABLE_TRANSCRIPTION_RECEIVE} -def callbackDisableTranscriptionReceive(data, action, *args, **kwargs) -> dict: +def callbackDisableTranscriptionReceive(*args, **kwargs) -> dict: printLog("Disable Transcription Receive") config.ENABLE_TRANSCRIPTION_RECEIVE = False - stopThreadingTranscriptionReceiveMessage(action) + stopThreadingTranscriptionReceiveMessage() return {"status":200, "result":config.ENABLE_TRANSCRIPTION_RECEIVE} def callbackEnableForeground(*args, **kwargs) -> dict: diff --git a/src-python/webui_mainloop.py b/src-python/webui_mainloop.py index 06ad066d..c38453cc 100644 --- a/src-python/webui_mainloop.py +++ b/src-python/webui_mainloop.py @@ -212,17 +212,11 @@ action_mapping = { "error_translation_engine":"/action/error_translation_engine", "word_filter":"/action/word_filter", }, - "/controller/callback_disable_transcription_send": { - "mic":"/action/transcription_send_mic_message_stopped" - }, "/controller/callback_enable_transcription_receive": { "speaker":"/action/transcription_receive_speaker_message", "error_device":"/action/error_device", "error_translation_engine":"/action/error_translation_engine", }, - "/controller/callback_disable_transcription_receive": { - "speaker":"/action/transcription_receive_speaker_message_stopped" - }, "/controller/callback_enable_check_mic_threshold": { "mic":"/action/check_mic_threshold_energy", "stopped":"/action/check_mic_threshold_energy_stopped", From 9a829c162dc9bcc46ddaa1338a1064ce29ff6558 Mon Sep 17 00:00:00 2001 From: misyaguziya Date: Mon, 2 Sep 2024 22:01:12 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=90=9B[bugfix]=20Model=20:=20?= =?UTF-8?q?=E5=87=BA=E5=8A=9B=E3=81=99=E3=82=8B=E3=83=87=E3=83=BC=E3=82=BF?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-python/webui_controller.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src-python/webui_controller.py b/src-python/webui_controller.py index 9d9eb932..f10a63fb 100644 --- a/src-python/webui_controller.py +++ b/src-python/webui_controller.py @@ -751,11 +751,7 @@ def callbackSetMicDevice(data, *args, **kwargs) -> dict: printLog("Set Mic Device", data) config.CHOICE_MIC_DEVICE = data model.stopCheckMicEnergy() - return {"status":200, - "result":{ - "host":config.CHOICE_MIC_HOST, - }, - } + return {"status":200, "result":config.CHOICE_MIC_DEVICE} def callbackSetMicEnergyThreshold(data, *args, **kwargs) -> dict: printLog("Set Mic Energy Threshold", data)