From dfbc1f92e7084a5f9f2497e0f09d7ce6bc40c84f Mon Sep 17 00:00:00 2001 From: misyaguziya Date: Sun, 1 Sep 2024 23:14:20 +0900 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=97=91=EF=B8=8F[Remove]=20Model=20:?= =?UTF-8?q?=20remove=20xsoverlay=20module?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-python/config.py | 12 ------------ src-python/model.py | 3 --- src-python/webui_controller.py | 14 -------------- src-python/webui_mainloop.py | 1 - 4 files changed, 30 deletions(-) diff --git a/src-python/config.py b/src-python/config.py index 64ba9166..ada54333 100644 --- a/src-python/config.py +++ b/src-python/config.py @@ -769,17 +769,6 @@ class Config: self._SEND_MESSAGE_BUTTON_TYPE = value saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value) - @property - @json_serializable('ENABLE_NOTICE_XSOVERLAY') - def ENABLE_NOTICE_XSOVERLAY(self): - return self._ENABLE_NOTICE_XSOVERLAY - - @ENABLE_NOTICE_XSOVERLAY.setter - def ENABLE_NOTICE_XSOVERLAY(self, value): - if isinstance(value, bool): - self._ENABLE_NOTICE_XSOVERLAY = value - saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value) - @property @json_serializable('OVERLAY_SETTINGS') def OVERLAY_SETTINGS(self): @@ -1116,7 +1105,6 @@ class Config: self._ENABLE_AUTO_CLEAR_MESSAGE_BOX = True self._ENABLE_SEND_ONLY_TRANSLATED_MESSAGES = False self._SEND_MESSAGE_BUTTON_TYPE = "show" - self._ENABLE_NOTICE_XSOVERLAY = False self._OVERLAY_SETTINGS = { "opacity": 1.0, "ui_scaling": 1.0, diff --git a/src-python/model.py b/src-python/model.py index d446b2c1..4f36f95a 100644 --- a/src-python/model.py +++ b/src-python/model.py @@ -672,9 +672,6 @@ class Model: self.speaker_energy_recorder.stop() self.speaker_energy_recorder = None - def notificationXSOverlay(self, message): - xsoverlayForVRCT(content=f"{message}") - def createOverlayImageShort(self, message, translation): your_language = config.TARGET_LANGUAGE target_language = config.SOURCE_LANGUAGE diff --git a/src-python/webui_controller.py b/src-python/webui_controller.py index a162ad97..3296be35 100644 --- a/src-python/webui_controller.py +++ b/src-python/webui_controller.py @@ -224,10 +224,6 @@ class SpeakerMessage: }) if config.ENABLE_TRANSCRIPTION_RECEIVE is True: - if config.ENABLE_NOTICE_XSOVERLAY is True: - xsoverlay_message = messageFormatter("RECEIVED", translation, message) - model.notificationXSOverlay(xsoverlay_message) - if config.ENABLE_OVERLAY_SMALL_LOG is True: if model.overlay.initialized is True: overlay_image = model.createOverlayImageShort(message, translation) @@ -1173,16 +1169,6 @@ def callbackSetSendMessageButtonType(data, *args, **kwargs) -> dict: config.SEND_MESSAGE_BUTTON_TYPE = data return {"status":200, "result":config.SEND_MESSAGE_BUTTON_TYPE} -def callbackEnableNoticeXsoverlay(*args, **kwargs) -> dict: - printLog("Enable Notice Xsoverlay") - config.ENABLE_NOTICE_XSOVERLAY = True - return {"status":200, "result":config.ENABLE_NOTICE_XSOVERLAY} - -def callbackDisableNoticeXsoverlay(*args, **kwargs) -> dict: - printLog("Disable Notice Xsoverlay") - config.ENABLE_NOTICE_XSOVERLAY = False - return {"status":200, "result":config.ENABLE_NOTICE_XSOVERLAY} - def callbackEnableAutoExportMessageLogs(*args, **kwargs) -> dict: printLog("Enable Auto Export Message Logs") config.ENABLE_LOGGER = True diff --git a/src-python/webui_mainloop.py b/src-python/webui_mainloop.py index 5d429f19..fabf397a 100644 --- a/src-python/webui_mainloop.py +++ b/src-python/webui_mainloop.py @@ -73,7 +73,6 @@ config_mapping = { "/config/enable_auto_clear_message_box": "ENABLE_AUTO_CLEAR_MESSAGE_BOX", "/config/enable_send_only_translated_messages": "ENABLE_SEND_ONLY_TRANSLATED_MESSAGES", "/config/send_message_button_type": "SEND_MESSAGE_BUTTON_TYPE", - "/config/enable_notice_xsoverlay": "ENABLE_NOTICE_XSOVERLAY", "/config/overlay_settings": "OVERLAY_SETTINGS", "/config/enable_overlay_small_log": "ENABLE_OVERLAY_SMALL_LOG", "/config/overlay_small_log_settings": "OVERLAY_SMALL_LOG_SETTINGS", From 0528bfe1813eb2b812ec7cd25e7b0660f03b44fe Mon Sep 17 00:00:00 2001 From: misyaguziya Date: Sun, 1 Sep 2024 23:22:20 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=97=91=EF=B8=8F[Remove]=20Model=20:?= =?UTF-8?q?=20remove=20xsoverlay=20module(=E4=B8=8D=E8=B6=B3=E5=88=86?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-python/webui_mainloop.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src-python/webui_mainloop.py b/src-python/webui_mainloop.py index fabf397a..f8373752 100644 --- a/src-python/webui_mainloop.py +++ b/src-python/webui_mainloop.py @@ -174,8 +174,6 @@ controller_mapping = { "/controller/callback_enable_send_only_translated_messages": controller.callbackEnableSendOnlyTranslatedMessages, "/controller/callback_disable_send_only_translated_messages": controller.callbackDisableSendOnlyTranslatedMessages, "/controller/callback_set_send_message_button_type": controller.callbackSetSendMessageButtonType, - "/controller/callback_enable_notice_xsoverlay": controller.callbackEnableNoticeXsoverlay, - "/controller/callback_disable_notice_xsoverlay": controller.callbackDisableNoticeXsoverlay, "/controller/callback_enable_auto_export_message_logs": controller.callbackEnableAutoExportMessageLogs, "/controller/callback_disable_auto_export_message_logs": controller.callbackDisableAutoExportMessageLogs, "/controller/callback_enable_vrc_mic_mute_sync": controller.callbackEnableVrcMicMuteSync, From 1f5a27343d398ff9cfdda557aff992da17852cc9 Mon Sep 17 00:00:00 2001 From: misyaguziya Date: Mon, 2 Sep 2024 10:33:08 +0900 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=91=8D=EF=B8=8F[Update]=20Model=20:?= =?UTF-8?q?=20messegae=E9=80=81=E4=BF=A1=E3=81=AE=E3=83=86=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=82=B3=E3=83=BC=E3=83=89=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_mainloop.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src-python/webui_mainloop.py b/src-python/webui_mainloop.py index f8373752..4859cabf 100644 --- a/src-python/webui_mainloop.py +++ b/src-python/webui_mainloop.py @@ -3,7 +3,7 @@ import json import time from config import config import webui_controller as controller -from utils import printLog +from utils import printLog, encodeUtf8 config_mapping = { "/config/version": "VERSION", @@ -371,7 +371,7 @@ if __name__ == "__main__": match endpoint: case "/controller/callback_messagebox_press_key_enter": - data = "テスト" + data = {"id":"123456", "message":encodeUtf8("テスト")} case "/controller/set_your_language_and_country": data = {"language": "English", "country": "Hong Kong"} case "/controller/set_target_language_and_country": From 5697f3273fa72463b5a048b606545d1d950fd738 Mon Sep 17 00:00:00 2001 From: misyaguziya Date: Mon, 2 Sep 2024 12:05:27 +0900 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=91=8D=EF=B8=8F[Update]=20Model=20:?= =?UTF-8?q?=20messagebox=20send/typing/typing=5Fstop=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-python/webui_controller.py | 10 +++++++--- src-python/webui_mainloop.py | 8 +++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src-python/webui_controller.py b/src-python/webui_controller.py index 3296be35..e1fc88e2 100644 --- a/src-python/webui_controller.py +++ b/src-python/webui_controller.py @@ -349,16 +349,20 @@ class ChatMessage: }, } -def callbackMessageBoxPressKeyEnter(data, action, *args, **kwargs) -> dict: +def callbackMessageBoxSend(data, action, *args, **kwargs) -> dict: chat = ChatMessage(action) response = chat.send(data) return response -def messageBoxPressKeyAny(e): +def callbackMessageBoxTyping(*args, **kwargs) -> dict: if config.ENABLE_SEND_MESSAGE_TO_VRC is True: model.oscStartSendTyping() - else: + return {"status":200} + +def callbackMessageBoxTypingStop(*args, **kwargs) -> dict: + if config.ENABLE_SEND_MESSAGE_TO_VRC is True: model.oscStopSendTyping() + return {"status":200} def messageBoxFocusIn(e): # view.foregroundOffIfForegroundEnabled() diff --git a/src-python/webui_mainloop.py b/src-python/webui_mainloop.py index 4859cabf..06ad066d 100644 --- a/src-python/webui_mainloop.py +++ b/src-python/webui_mainloop.py @@ -109,7 +109,9 @@ controller_mapping = { "/controller/callback_disable_transcription_send": controller.callbackDisableTranscriptionSend, "/controller/callback_enable_transcription_receive": controller.callbackEnableTranscriptionReceive, "/controller/callback_disable_transcription_receive": controller.callbackDisableTranscriptionReceive, - "/controller/callback_messagebox_press_key_enter": controller.callbackMessageBoxPressKeyEnter, + "/controller/callback_messagebox_send": controller.callbackMessageBoxSend, + "/controller/callback_messagebox_typing": controller.callbackMessageBoxTyping, + "/controller/callback_messagebox_typing_stop": controller.callbackMessageBoxTypingStop, "/controller/callback_enable_foreground": controller.callbackEnableForeground, "/controller/callback_disable_foreground": controller.callbackDisableForeground, "/controller/set_your_language_and_country": controller.setYourLanguageAndCountry, @@ -231,7 +233,7 @@ action_mapping = { "stopped":"/action/check_speaker_threshold_energy_stopped", "error_device":"/action/error_device", }, - "/controller/callback_messagebox_press_key_enter": { + "/controller/callback_messagebox_send": { "error_translation_engine":"/action/error_translation_engine" }, "/controller/callback_download_ctranslate2_weight": { @@ -370,7 +372,7 @@ if __name__ == "__main__": printLog("endpoint", endpoint) match endpoint: - case "/controller/callback_messagebox_press_key_enter": + case "/controller/callback_messagebox_send": data = {"id":"123456", "message":encodeUtf8("テスト")} case "/controller/set_your_language_and_country": data = {"language": "English", "country": "Hong Kong"} From b5f8a0d560b3df693ecc0b171395bebab393dd72 Mon Sep 17 00:00:00 2001 From: misyaguziya Date: Mon, 2 Sep 2024 12:07:13 +0900 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=97=91=EF=B8=8F[Remove]=20Model=20:?= =?UTF-8?q?=20SENT=5FMESSAGES=5FLOG/CURRENT=5FSENT=5FMESSAGES=5FLOG=5FINDE?= =?UTF-8?q?X=E3=82=92=E5=89=8A=E9=99=A4=EF=BC=88=E3=82=B3=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=82=A2=E3=82=A6=E3=83=88=E3=81=AE=E3=81=BF?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-python/config.py | 32 ++++++++++++++++---------------- src-python/webui_controller.py | 10 +++++----- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src-python/config.py b/src-python/config.py index ada54333..23091218 100644 --- a/src-python/config.py +++ b/src-python/config.py @@ -211,23 +211,23 @@ class Config: if value in list(translation_lang.keys()): self._CHOICE_OUTPUT_TRANSLATOR = value - @property - def SENT_MESSAGES_LOG(self): - return self._SENT_MESSAGES_LOG + # @property + # def SENT_MESSAGES_LOG(self): + # return self._SENT_MESSAGES_LOG - @SENT_MESSAGES_LOG.setter - def SENT_MESSAGES_LOG(self, value): - if isinstance(value, list): - self._SENT_MESSAGES_LOG = value + # @SENT_MESSAGES_LOG.setter + # def SENT_MESSAGES_LOG(self, value): + # if isinstance(value, list): + # self._SENT_MESSAGES_LOG = value - @property - def CURRENT_SENT_MESSAGES_LOG_INDEX(self): - return self._CURRENT_SENT_MESSAGES_LOG_INDEX + # @property + # def CURRENT_SENT_MESSAGES_LOG_INDEX(self): + # return self._CURRENT_SENT_MESSAGES_LOG_INDEX - @CURRENT_SENT_MESSAGES_LOG_INDEX.setter - def CURRENT_SENT_MESSAGES_LOG_INDEX(self, value): - if isinstance(value, int): - self._CURRENT_SENT_MESSAGES_LOG_INDEX = value + # @CURRENT_SENT_MESSAGES_LOG_INDEX.setter + # def CURRENT_SENT_MESSAGES_LOG_INDEX(self, value): + # if isinstance(value, int): + # self._CURRENT_SENT_MESSAGES_LOG_INDEX = value @property def IS_RESET_BUTTON_DISPLAYED_FOR_TRANSLATION(self): @@ -1006,8 +1006,8 @@ class Config: self._SOURCE_COUNTRY = "Japan" self._TARGET_LANGUAGE = "English" self._TARGET_COUNTRY = "United States" - self._SENT_MESSAGES_LOG = [] - self._CURRENT_SENT_MESSAGES_LOG_INDEX = 0 + # self._SENT_MESSAGES_LOG = [] + # self._CURRENT_SENT_MESSAGES_LOG_INDEX = 0 self._IS_RESET_BUTTON_DISPLAYED_FOR_TRANSLATION = False self._IS_RESET_BUTTON_DISPLAYED_FOR_WHISPER = False self._IS_EASTER_EGG_ENABLED = False diff --git a/src-python/webui_controller.py b/src-python/webui_controller.py index e1fc88e2..78915e37 100644 --- a/src-python/webui_controller.py +++ b/src-python/webui_controller.py @@ -99,7 +99,7 @@ class MicMessage: } }) elif isinstance(message, str) and len(message) > 0: - addSentMessageLog(message) + # addSentMessageLog(message) translation = "" if model.checkKeywords(message): self.action("word_filter", { @@ -301,7 +301,7 @@ class ChatMessage: id = data["id"] message = decodeUtf8(data["message"]) if len(message) > 0: - addSentMessageLog(message) + # addSentMessageLog(message) translation = "" if config.ENABLE_TRANSLATION is False: pass @@ -373,9 +373,9 @@ def messageBoxFocusOut(e): 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) +# def addSentMessageLog(sent_message): +# config.SENT_MESSAGES_LOG.append(sent_message) +# config.CURRENT_SENT_MESSAGES_LOG_INDEX = len(config.SENT_MESSAGES_LOG) # def updateMessageBox(index_offset): # if len(config.SENT_MESSAGES_LOG) == 0: