🚧[WIP/TEST] Main: viewをコメントアウト
This commit is contained in:
@@ -4,7 +4,7 @@ from subprocess import Popen
|
||||
from threading import Thread
|
||||
from config import config
|
||||
from model import model
|
||||
from view import view
|
||||
# from view import view
|
||||
from utils import getKeyByValue, isUniqueStrings, strPctToInt
|
||||
import argparse
|
||||
|
||||
@@ -33,18 +33,19 @@ def callbackQuitVrct():
|
||||
def callbackEnableEasterEgg():
|
||||
config.IS_EASTER_EGG_ENABLED = True
|
||||
config.OVERLAY_UI_TYPE = "sakura"
|
||||
view.printToTextbox_enableEasterEgg()
|
||||
# view.printToTextbox_enableEasterEgg()
|
||||
|
||||
def setMainWindowGeometry():
|
||||
PRE_SCALING_INT = strPctToInt(view.getPreUiScaling())
|
||||
NEW_SCALING_INT = strPctToInt(config.UI_SCALING)
|
||||
MULTIPLY_FLOAT = (NEW_SCALING_INT / PRE_SCALING_INT)
|
||||
main_window_geometry = view.getMainWindowGeometry(return_int=True)
|
||||
main_window_geometry["width"] = str(int(main_window_geometry["width"] * MULTIPLY_FLOAT))
|
||||
main_window_geometry["height"] = str(int(main_window_geometry["height"] * MULTIPLY_FLOAT))
|
||||
main_window_geometry["x_pos"] = str(main_window_geometry["x_pos"])
|
||||
main_window_geometry["y_pos"] = str(main_window_geometry["y_pos"])
|
||||
config.MAIN_WINDOW_GEOMETRY = main_window_geometry
|
||||
# PRE_SCALING_INT = strPctToInt(view.getPreUiScaling())
|
||||
# NEW_SCALING_INT = strPctToInt(config.UI_SCALING)
|
||||
# MULTIPLY_FLOAT = (NEW_SCALING_INT / PRE_SCALING_INT)
|
||||
# main_window_geometry = view.getMainWindowGeometry(return_int=True)
|
||||
# main_window_geometry["width"] = str(int(main_window_geometry["width"] * MULTIPLY_FLOAT))
|
||||
# main_window_geometry["height"] = str(int(main_window_geometry["height"] * MULTIPLY_FLOAT))
|
||||
# main_window_geometry["x_pos"] = str(main_window_geometry["x_pos"])
|
||||
# main_window_geometry["y_pos"] = str(main_window_geometry["y_pos"])
|
||||
# config.MAIN_WINDOW_GEOMETRY = main_window_geometry
|
||||
pass
|
||||
|
||||
def messageFormatter(format_type:str, translation, message):
|
||||
if format_type == "RECEIVED":
|
||||
@@ -68,7 +69,7 @@ def changeToCTranslate2Process():
|
||||
config.CHOICE_INPUT_TRANSLATOR = "CTranslate2"
|
||||
config.CHOICE_OUTPUT_TRANSLATOR = "CTranslate2"
|
||||
updateTranslationEngineAndEngineList()
|
||||
view.printToTextbox_TranslationEngineLimitError()
|
||||
# view.printToTextbox_TranslationEngineLimitError()
|
||||
|
||||
# func transcription send message
|
||||
class MicMessage:
|
||||
@@ -134,8 +135,9 @@ def stopThreadingTranscriptionSendMessage(action:Callable[[dict], None]) -> None
|
||||
th_stopTranscriptionSendMessage.daemon = True
|
||||
th_stopTranscriptionSendMessage.start()
|
||||
|
||||
def startTranscriptionSendMessageOnCloseConfigWindow():
|
||||
model.startMicTranscript(sendMicMessage, view.printToTextbox_TranscriptionSendNoDeviceError)
|
||||
def startTranscriptionSendMessageOnCloseConfigWindow(action:Callable[[dict], None]) -> None:
|
||||
mic_message = MicMessage(action)
|
||||
model.startMicTranscript(mic_message.send)
|
||||
|
||||
def stopTranscriptionSendMessageOnOpenConfigWindow():
|
||||
model.stopMicTranscript()
|
||||
@@ -214,9 +216,9 @@ def stopThreadingTranscriptionReceiveMessage(action:Callable[[dict], None]) -> N
|
||||
th_stopTranscriptionReceiveMessage.daemon = True
|
||||
th_stopTranscriptionReceiveMessage.start()
|
||||
|
||||
def startTranscriptionReceiveMessageOnCloseConfigWindow():
|
||||
model.startSpeakerTranscript(receiveSpeakerMessage, view.printToTextbox_TranscriptionReceiveNoDeviceError)
|
||||
|
||||
def startTranscriptionReceiveMessageOnCloseConfigWindow(action:Callable[[dict], None]) -> None:
|
||||
speaker_message = SpeakerMessage(action)
|
||||
model.startSpeakerTranscript(speaker_message.receive)
|
||||
|
||||
def stopTranscriptionReceiveMessageOnOpenConfigWindow():
|
||||
model.stopSpeakerTranscript()
|
||||
@@ -261,7 +263,7 @@ def sendChatMessage(message):
|
||||
# model.updateOverlay(overlay_image)
|
||||
|
||||
# update textbox message log (Sent)
|
||||
view.printToTextbox_SentMessage(message, translation)
|
||||
# view.printToTextbox_SentMessage(message, translation)
|
||||
if config.ENABLE_LOGGER is True:
|
||||
if len(translation) > 0:
|
||||
translation = f" ({translation})"
|
||||
@@ -269,12 +271,14 @@ def sendChatMessage(message):
|
||||
|
||||
# delete message in entry message box
|
||||
if config.ENABLE_AUTO_CLEAR_MESSAGE_BOX is True:
|
||||
view.clearMessageBox()
|
||||
# view.clearMessageBox()
|
||||
pass
|
||||
|
||||
def messageBoxPressKeyEnter():
|
||||
model.oscStopSendTyping()
|
||||
message = view.getTextFromMessageBox()
|
||||
sendChatMessage(message)
|
||||
# model.oscStopSendTyping()
|
||||
# message = view.getTextFromMessageBox()
|
||||
# sendChatMessage(message)
|
||||
pass
|
||||
|
||||
def messageBoxPressKeyAny(e):
|
||||
if config.ENABLE_SEND_MESSAGE_TO_VRC is True:
|
||||
@@ -283,10 +287,11 @@ def messageBoxPressKeyAny(e):
|
||||
model.oscStopSendTyping()
|
||||
|
||||
def messageBoxFocusIn(e):
|
||||
view.foregroundOffIfForegroundEnabled()
|
||||
# view.foregroundOffIfForegroundEnabled()
|
||||
pass
|
||||
|
||||
def messageBoxFocusOut(e):
|
||||
view.foregroundOnIfForegroundEnabled()
|
||||
# view.foregroundOnIfForegroundEnabled()
|
||||
if config.ENABLE_SEND_MESSAGE_TO_VRC is True:
|
||||
model.oscStopSendTyping()
|
||||
|
||||
@@ -300,7 +305,7 @@ def updateMessageBox(index_offset):
|
||||
try:
|
||||
new_index = config.CURRENT_SENT_MESSAGES_LOG_INDEX + index_offset
|
||||
target_message_text = config.SENT_MESSAGES_LOG[new_index]
|
||||
view.replaceMessageBox(target_message_text)
|
||||
# view.replaceMessageBox(target_message_text)
|
||||
config.CURRENT_SENT_MESSAGES_LOG_INDEX = new_index
|
||||
except IndexError:
|
||||
pass
|
||||
@@ -726,9 +731,9 @@ def callbackSetSpeakerEnergyThreshold(value) -> dict:
|
||||
try:
|
||||
value = int(value)
|
||||
if 0 <= value and value <= config.MAX_SPEAKER_ENERGY_THRESHOLD:
|
||||
view.clearNotificationMessage()
|
||||
# view.clearNotificationMessage()
|
||||
config.INPUT_SPEAKER_ENERGY_THRESHOLD = value
|
||||
view.setGuiVariable_SpeakerEnergyThreshold(config.INPUT_SPEAKER_ENERGY_THRESHOLD)
|
||||
# view.setGuiVariable_SpeakerEnergyThreshold(config.INPUT_SPEAKER_ENERGY_THRESHOLD)
|
||||
else:
|
||||
raise ValueError()
|
||||
except Exception:
|
||||
@@ -739,29 +744,32 @@ def callbackSetSpeakerDynamicEnergyThreshold(value) -> dict:
|
||||
print("callbackSetSpeakerDynamicEnergyThreshold", value)
|
||||
config.INPUT_SPEAKER_DYNAMIC_ENERGY_THRESHOLD = value
|
||||
if config.INPUT_SPEAKER_DYNAMIC_ENERGY_THRESHOLD is True:
|
||||
view.closeSpeakerEnergyThresholdWidget()
|
||||
# view.closeSpeakerEnergyThresholdWidget()
|
||||
pass
|
||||
else:
|
||||
view.openSpeakerEnergyThresholdWidget()
|
||||
# view.openSpeakerEnergyThresholdWidget()
|
||||
pass
|
||||
return {"status":"success"}
|
||||
|
||||
def setProgressBarSpeakerEnergy(energy):
|
||||
view.updateSetProgressBar_SpeakerEnergy(energy)
|
||||
# view.updateSetProgressBar_SpeakerEnergy(energy)
|
||||
pass
|
||||
|
||||
def callbackCheckSpeakerThreshold(is_turned_on):
|
||||
print("callbackCheckSpeakerThreshold", is_turned_on)
|
||||
if is_turned_on is True:
|
||||
view.replaceSpeakerThresholdCheckButton_Disabled()
|
||||
# view.replaceSpeakerThresholdCheckButton_Disabled()
|
||||
model.startCheckSpeakerEnergy(
|
||||
setProgressBarSpeakerEnergy,
|
||||
view.initProgressBar_SpeakerEnergy,
|
||||
view.showErrorMessage_CheckSpeakerThreshold_NoDevice
|
||||
# view.initProgressBar_SpeakerEnergy,
|
||||
# view.showErrorMessage_CheckSpeakerThreshold_NoDevice
|
||||
)
|
||||
|
||||
view.replaceSpeakerThresholdCheckButton_Active()
|
||||
# view.replaceSpeakerThresholdCheckButton_Active()
|
||||
else:
|
||||
view.replaceSpeakerThresholdCheckButton_Disabled()
|
||||
# view.replaceSpeakerThresholdCheckButton_Disabled()
|
||||
model.stopCheckSpeakerEnergy()
|
||||
view.replaceSpeakerThresholdCheckButton_Passive()
|
||||
# view.replaceSpeakerThresholdCheckButton_Passive()
|
||||
|
||||
def callbackSetSpeakerRecordTimeout(value):
|
||||
print("callbackSetSpeakerRecordTimeout", value)
|
||||
@@ -770,13 +778,14 @@ def callbackSetSpeakerRecordTimeout(value):
|
||||
try:
|
||||
value = int(value)
|
||||
if 0 <= value and value <= config.INPUT_SPEAKER_PHRASE_TIMEOUT:
|
||||
view.clearNotificationMessage()
|
||||
# view.clearNotificationMessage()
|
||||
config.INPUT_SPEAKER_RECORD_TIMEOUT = value
|
||||
view.setGuiVariable_SpeakerRecordTimeout(config.INPUT_SPEAKER_RECORD_TIMEOUT)
|
||||
# view.setGuiVariable_SpeakerRecordTimeout(config.INPUT_SPEAKER_RECORD_TIMEOUT)
|
||||
else:
|
||||
raise ValueError()
|
||||
except Exception:
|
||||
view.showErrorMessage_SpeakerRecordTimeout()
|
||||
# view.showErrorMessage_SpeakerRecordTimeout()
|
||||
pass
|
||||
|
||||
def callbackSetSpeakerPhraseTimeout(value):
|
||||
print("callbackSetSpeakerPhraseTimeout", value)
|
||||
@@ -785,13 +794,14 @@ def callbackSetSpeakerPhraseTimeout(value):
|
||||
try:
|
||||
value = int(value)
|
||||
if 0 <= value and value >= config.INPUT_SPEAKER_RECORD_TIMEOUT:
|
||||
view.clearNotificationMessage()
|
||||
# view.clearNotificationMessage()
|
||||
config.INPUT_SPEAKER_PHRASE_TIMEOUT = value
|
||||
view.setGuiVariable_SpeakerPhraseTimeout(config.INPUT_SPEAKER_PHRASE_TIMEOUT)
|
||||
# view.setGuiVariable_SpeakerPhraseTimeout(config.INPUT_SPEAKER_PHRASE_TIMEOUT)
|
||||
else:
|
||||
raise ValueError()
|
||||
except Exception:
|
||||
view.showErrorMessage_SpeakerPhraseTimeout()
|
||||
# view.showErrorMessage_SpeakerPhraseTimeout()
|
||||
pass
|
||||
|
||||
def callbackSetSpeakerMaxPhrases(value):
|
||||
print("callbackSetSpeakerMaxPhrases", value)
|
||||
@@ -800,20 +810,21 @@ def callbackSetSpeakerMaxPhrases(value):
|
||||
try:
|
||||
value = int(value)
|
||||
if 0 <= value:
|
||||
view.clearNotificationMessage()
|
||||
# view.clearNotificationMessage()
|
||||
config.INPUT_SPEAKER_MAX_PHRASES = value
|
||||
view.setGuiVariable_SpeakerMaxPhrases(config.INPUT_SPEAKER_MAX_PHRASES)
|
||||
# view.setGuiVariable_SpeakerMaxPhrases(config.INPUT_SPEAKER_MAX_PHRASES)
|
||||
else:
|
||||
raise ValueError()
|
||||
except Exception:
|
||||
view.showErrorMessage_SpeakerMaxPhrases()
|
||||
# view.showErrorMessage_SpeakerMaxPhrases()
|
||||
pass
|
||||
|
||||
# Transcription (Internal AI Model)
|
||||
def callbackSetUserWhisperFeature(value):
|
||||
print("callbackSetUserWhisperFeature", value)
|
||||
config.USE_WHISPER_FEATURE = value
|
||||
if config.USE_WHISPER_FEATURE is True:
|
||||
view.openWhisperWeightTypeWidget()
|
||||
# view.openWhisperWeightTypeWidget()
|
||||
if model.checkTranscriptionWhisperModelWeight() is True:
|
||||
config.IS_RESET_BUTTON_DISPLAYED_FOR_WHISPER = False
|
||||
config.SELECTED_TRANSCRIPTION_ENGINE = "Whisper"
|
||||
@@ -821,22 +832,22 @@ def callbackSetUserWhisperFeature(value):
|
||||
config.IS_RESET_BUTTON_DISPLAYED_FOR_WHISPER = True
|
||||
config.SELECTED_TRANSCRIPTION_ENGINE = "Google"
|
||||
else:
|
||||
view.closeWhisperWeightTypeWidget()
|
||||
# view.closeWhisperWeightTypeWidget()
|
||||
config.IS_RESET_BUTTON_DISPLAYED_FOR_WHISPER = False
|
||||
config.SELECTED_TRANSCRIPTION_ENGINE = "Google"
|
||||
view.showRestartButtonIfRequired()
|
||||
# view.showRestartButtonIfRequired()
|
||||
|
||||
def callbackSetWhisperWeightType(value):
|
||||
print("callbackSetWhisperWeightType", value)
|
||||
config.WHISPER_WEIGHT_TYPE = str(value)
|
||||
view.updateSelectedWhisperWeightType(config.WHISPER_WEIGHT_TYPE)
|
||||
# view.updateSelectedWhisperWeightType(config.WHISPER_WEIGHT_TYPE)
|
||||
if model.checkTranscriptionWhisperModelWeight() is True:
|
||||
config.IS_RESET_BUTTON_DISPLAYED_FOR_WHISPER = False
|
||||
config.SELECTED_TRANSCRIPTION_ENGINE = "Whisper"
|
||||
else:
|
||||
config.IS_RESET_BUTTON_DISPLAYED_FOR_WHISPER = True
|
||||
config.SELECTED_TRANSCRIPTION_ENGINE = "Google"
|
||||
view.showRestartButtonIfRequired()
|
||||
# view.showRestartButtonIfRequired()
|
||||
|
||||
# VR Tab
|
||||
def callbackSetOverlaySettings(value, set_type:str):
|
||||
@@ -862,9 +873,11 @@ def callbackSetEnableOverlaySmallLog(value):
|
||||
model.shutdownOverlay()
|
||||
|
||||
if config.ENABLE_OVERLAY_SMALL_LOG is True:
|
||||
view.setStateOverlaySmallLog("enabled")
|
||||
# view.setStateOverlaySmallLog("enabled")
|
||||
pass
|
||||
elif config.ENABLE_OVERLAY_SMALL_LOG is False:
|
||||
view.setStateOverlaySmallLog("disabled")
|
||||
# view.setStateOverlaySmallLog("disabled")
|
||||
pass
|
||||
|
||||
def callbackSetOverlaySmallLogSettings(value, set_type:str):
|
||||
print("callbackSetOverlaySmallLogSettings", value, set_type)
|
||||
@@ -889,7 +902,7 @@ def callbackSetEnableSendOnlyTranslatedMessages(value):
|
||||
def callbackSetSendMessageButtonType(value):
|
||||
print("callbackSetSendMessageButtonType", value)
|
||||
config.SEND_MESSAGE_BUTTON_TYPE = value
|
||||
view.changeMainWindowSendMessageButton(config.SEND_MESSAGE_BUTTON_TYPE)
|
||||
# view.changeMainWindowSendMessageButton(config.SEND_MESSAGE_BUTTON_TYPE)
|
||||
|
||||
def callbackSetEnableNoticeXsoverlay(value):
|
||||
print("callbackSetEnableNoticeXsoverlay", value)
|
||||
@@ -909,10 +922,10 @@ def callbackSetEnableVrcMicMuteSync(value):
|
||||
config.ENABLE_VRC_MIC_MUTE_SYNC = value
|
||||
if config.ENABLE_VRC_MIC_MUTE_SYNC is True:
|
||||
model.startCheckMuteSelfStatus()
|
||||
view.setStateVrcMicMuteSync("enabled")
|
||||
# view.setStateVrcMicMuteSync("enabled")
|
||||
else:
|
||||
model.stopCheckMuteSelfStatus()
|
||||
view.setStateVrcMicMuteSync("disabled")
|
||||
# view.setStateVrcMicMuteSync("disabled")
|
||||
model.changeMicTranscriptStatus()
|
||||
|
||||
|
||||
@@ -925,44 +938,48 @@ def callbackSetSendMessageFormat(value):
|
||||
print("callbackSetSendMessageFormat", value)
|
||||
if isUniqueStrings(["[message]"], value) is True:
|
||||
config.SEND_MESSAGE_FORMAT = value
|
||||
view.clearNotificationMessage()
|
||||
view.setSendMessageFormat_EntryWidgets(config.SEND_MESSAGE_FORMAT)
|
||||
# view.clearNotificationMessage()
|
||||
# view.setSendMessageFormat_EntryWidgets(config.SEND_MESSAGE_FORMAT)
|
||||
else:
|
||||
view.showErrorMessage_SendMessageFormat()
|
||||
view.setSendMessageFormat_EntryWidgets(config.SEND_MESSAGE_FORMAT)
|
||||
# view.showErrorMessage_SendMessageFormat()
|
||||
# view.setSendMessageFormat_EntryWidgets(config.SEND_MESSAGE_FORMAT)
|
||||
pass
|
||||
|
||||
def callbackSetSendMessageFormatWithT(value):
|
||||
print("callbackSetSendMessageFormatWithT", value)
|
||||
if len(value) > 0:
|
||||
if isUniqueStrings(["[message]", "[translation]"], value) is True:
|
||||
config.SEND_MESSAGE_FORMAT_WITH_T = value
|
||||
view.clearNotificationMessage()
|
||||
view.setSendMessageFormatWithT_EntryWidgets(config.SEND_MESSAGE_FORMAT_WITH_T)
|
||||
# view.clearNotificationMessage()
|
||||
# view.setSendMessageFormatWithT_EntryWidgets(config.SEND_MESSAGE_FORMAT_WITH_T)
|
||||
else:
|
||||
view.showErrorMessage_SendMessageFormatWithT()
|
||||
view.setSendMessageFormatWithT_EntryWidgets(config.SEND_MESSAGE_FORMAT_WITH_T)
|
||||
# view.showErrorMessage_SendMessageFormatWithT()
|
||||
# view.setSendMessageFormatWithT_EntryWidgets(config.SEND_MESSAGE_FORMAT_WITH_T)
|
||||
pass
|
||||
|
||||
# Others (Message Formats(Received)
|
||||
def callbackSetReceivedMessageFormat(value):
|
||||
print("callbackSetReceivedMessageFormat", value)
|
||||
if isUniqueStrings(["[message]"], value) is True:
|
||||
config.RECEIVED_MESSAGE_FORMAT = value
|
||||
view.clearNotificationMessage()
|
||||
view.setReceivedMessageFormat_EntryWidgets(config.RECEIVED_MESSAGE_FORMAT)
|
||||
# view.clearNotificationMessage()
|
||||
# view.setReceivedMessageFormat_EntryWidgets(config.RECEIVED_MESSAGE_FORMAT)
|
||||
else:
|
||||
view.showErrorMessage_ReceivedMessageFormat()
|
||||
view.setReceivedMessageFormat_EntryWidgets(config.RECEIVED_MESSAGE_FORMAT)
|
||||
# view.showErrorMessage_ReceivedMessageFormat()
|
||||
# view.setReceivedMessageFormat_EntryWidgets(config.RECEIVED_MESSAGE_FORMAT)
|
||||
pass
|
||||
|
||||
def callbackSetReceivedMessageFormatWithT(value):
|
||||
print("callbackSetReceivedMessageFormatWithT", value)
|
||||
if len(value) > 0:
|
||||
if isUniqueStrings(["[message]", "[translation]"], value) is True:
|
||||
config.RECEIVED_MESSAGE_FORMAT_WITH_T = value
|
||||
view.clearNotificationMessage()
|
||||
view.setReceivedMessageFormatWithT_EntryWidgets(config.RECEIVED_MESSAGE_FORMAT_WITH_T)
|
||||
# view.clearNotificationMessage()
|
||||
# view.setReceivedMessageFormatWithT_EntryWidgets(config.RECEIVED_MESSAGE_FORMAT_WITH_T)
|
||||
else:
|
||||
view.showErrorMessage_ReceivedMessageFormatWithT()
|
||||
view.setReceivedMessageFormatWithT_EntryWidgets(config.RECEIVED_MESSAGE_FORMAT_WITH_T)
|
||||
# view.showErrorMessage_ReceivedMessageFormatWithT()
|
||||
# view.setReceivedMessageFormatWithT_EntryWidgets(config.RECEIVED_MESSAGE_FORMAT_WITH_T)
|
||||
pass
|
||||
|
||||
# ---------------------Speaker2Chatbox---------------------
|
||||
def callbackSetEnableSendReceivedMessageToVrc(value):
|
||||
@@ -1004,15 +1021,15 @@ def initSetConfigByExeArguments():
|
||||
args = parser.parse_args()
|
||||
if args.ip is not None:
|
||||
config.OSC_IP_ADDRESS = str(args.ip)
|
||||
view.setGuiVariable_OscIpAddress(config.OSC_IP_ADDRESS)
|
||||
# view.setGuiVariable_OscIpAddress(config.OSC_IP_ADDRESS)
|
||||
if args.port is not None:
|
||||
config.OSC_PORT = int(args.port)
|
||||
view.setGuiVariable_OscPort(config.OSC_PORT)
|
||||
# view.setGuiVariable_OscPort(config.OSC_PORT)
|
||||
|
||||
def createMainWindow(splash):
|
||||
splash.toProgress(1)
|
||||
# create GUI
|
||||
view.createGUI()
|
||||
# view.createGUI()
|
||||
splash.toProgress(2)
|
||||
|
||||
# init config
|
||||
@@ -1026,7 +1043,7 @@ def createMainWindow(splash):
|
||||
auth_keys = config.AUTH_KEYS
|
||||
auth_keys["DeepL_API"] = None
|
||||
config.AUTH_KEYS = auth_keys
|
||||
view.printToTextbox_AuthenticationError()
|
||||
# view.printToTextbox_AuthenticationError()
|
||||
|
||||
# set Translation Engine
|
||||
updateTranslationEngineAndEngineList()
|
||||
@@ -1042,7 +1059,8 @@ def createMainWindow(splash):
|
||||
|
||||
# check Software Updated
|
||||
if model.checkSoftwareUpdated() is True:
|
||||
view.showUpdateAvailableButton()
|
||||
# view.showUpdateAvailableButton()
|
||||
pass
|
||||
|
||||
# init logger
|
||||
if config.ENABLE_LOGGER is True:
|
||||
@@ -1056,125 +1074,125 @@ def createMainWindow(splash):
|
||||
splash.toProgress(3) # Last one.
|
||||
|
||||
# set UI and callback
|
||||
view.register(
|
||||
common_registers={
|
||||
"callback_enable_easter_egg": callbackEnableEasterEgg,
|
||||
# view.register(
|
||||
# common_registers={
|
||||
# "callback_enable_easter_egg": callbackEnableEasterEgg,
|
||||
|
||||
"callback_update_software": callbackUpdateSoftware,
|
||||
"callback_restart_software": callbackRestartSoftware,
|
||||
"callback_filepath_logs": callbackFilepathLogs,
|
||||
"callback_filepath_config_file": callbackFilepathConfigFile,
|
||||
"callback_quit_vrct": callbackQuitVrct,
|
||||
},
|
||||
# "callback_update_software": callbackUpdateSoftware,
|
||||
# "callback_restart_software": callbackRestartSoftware,
|
||||
# "callback_filepath_logs": callbackFilepathLogs,
|
||||
# "callback_filepath_config_file": callbackFilepathConfigFile,
|
||||
# "callback_quit_vrct": callbackQuitVrct,
|
||||
# },
|
||||
|
||||
window_action_registers={
|
||||
"callback_open_config_window": callbackOpenConfigWindow,
|
||||
"callback_close_config_window": callbackCloseConfigWindow,
|
||||
},
|
||||
# window_action_registers={
|
||||
# "callback_open_config_window": callbackOpenConfigWindow,
|
||||
# "callback_close_config_window": callbackCloseConfigWindow,
|
||||
# },
|
||||
|
||||
main_window_registers={
|
||||
"callback_enable_main_window_sidebar_compact_mode": callbackEnableMainWindowSidebarCompactMode,
|
||||
"callback_disable_main_window_sidebar_compact_mode": callbackDisableMainWindowSidebarCompactMode,
|
||||
# main_window_registers={
|
||||
# "callback_enable_main_window_sidebar_compact_mode": callbackEnableMainWindowSidebarCompactMode,
|
||||
# "callback_disable_main_window_sidebar_compact_mode": callbackDisableMainWindowSidebarCompactMode,
|
||||
|
||||
"callback_toggle_translation": callbackToggleTranslation,
|
||||
"callback_toggle_transcription_send": callbackToggleTranscriptionSend,
|
||||
"callback_toggle_transcription_receive": callbackToggleTranscriptionReceive,
|
||||
"callback_toggle_foreground": callbackToggleForeground,
|
||||
# "callback_toggle_translation": callbackToggleTranslation,
|
||||
# "callback_toggle_transcription_send": callbackToggleTranscriptionSend,
|
||||
# "callback_toggle_transcription_receive": callbackToggleTranscriptionReceive,
|
||||
# "callback_toggle_foreground": callbackToggleForeground,
|
||||
|
||||
"callback_your_language": setYourLanguageAndCountry,
|
||||
"callback_target_language": setTargetLanguageAndCountry,
|
||||
"values": model.getListLanguageAndCountry(),
|
||||
"callback_swap_languages": swapYourLanguageAndTargetLanguage,
|
||||
# "callback_your_language": setYourLanguageAndCountry,
|
||||
# "callback_target_language": setTargetLanguageAndCountry,
|
||||
# "values": model.getListLanguageAndCountry(),
|
||||
# "callback_swap_languages": swapYourLanguageAndTargetLanguage,
|
||||
|
||||
"callback_selected_language_preset_tab": callbackSelectedLanguagePresetTab,
|
||||
# "callback_selected_language_preset_tab": callbackSelectedLanguagePresetTab,
|
||||
|
||||
"callback_selected_translation_engine": callbackSelectedTranslationEngine,
|
||||
# "callback_selected_translation_engine": callbackSelectedTranslationEngine,
|
||||
|
||||
"message_box_bind_Return": messageBoxPressKeyEnter,
|
||||
"message_box_bind_Any_KeyPress": messageBoxPressKeyAny,
|
||||
"message_box_bind_FocusIn": messageBoxFocusIn,
|
||||
"message_box_bind_FocusOut": messageBoxFocusOut,
|
||||
"message_box_bind_Up_KeyPress": messageBoxUpKeyPress,
|
||||
"message_box_bind_Down_KeyPress": messageBoxDownKeyPress,
|
||||
},
|
||||
# "message_box_bind_Return": messageBoxPressKeyEnter,
|
||||
# "message_box_bind_Any_KeyPress": messageBoxPressKeyAny,
|
||||
# "message_box_bind_FocusIn": messageBoxFocusIn,
|
||||
# "message_box_bind_FocusOut": messageBoxFocusOut,
|
||||
# "message_box_bind_Up_KeyPress": messageBoxUpKeyPress,
|
||||
# "message_box_bind_Down_KeyPress": messageBoxDownKeyPress,
|
||||
# },
|
||||
|
||||
config_window_registers={
|
||||
# Compact Mode Switch
|
||||
"callback_disable_config_window_compact_mode": callbackEnableConfigWindowCompactMode,
|
||||
"callback_enable_config_window_compact_mode": callbackDisableConfigWindowCompactMode,
|
||||
# config_window_registers={
|
||||
# # Compact Mode Switch
|
||||
# "callback_disable_config_window_compact_mode": callbackEnableConfigWindowCompactMode,
|
||||
# "callback_enable_config_window_compact_mode": callbackDisableConfigWindowCompactMode,
|
||||
|
||||
# Appearance Tab
|
||||
"callback_set_transparency": callbackSetTransparency,
|
||||
"callback_set_appearance": callbackSetAppearance,
|
||||
"callback_set_ui_scaling": callbackSetUiScaling,
|
||||
"callback_set_textbox_ui_scaling": callbackSetTextboxUiScaling,
|
||||
"callback_set_message_box_ratio": callbackSetMessageBoxRatio,
|
||||
"callback_set_font_family": callbackSetFontFamily,
|
||||
"callback_set_ui_language": callbackSetUiLanguage,
|
||||
"callback_set_enable_restore_main_window_geometry": callbackSetEnableRestoreMainWindowGeometry,
|
||||
# # Appearance Tab
|
||||
# "callback_set_transparency": callbackSetTransparency,
|
||||
# "callback_set_appearance": callbackSetAppearance,
|
||||
# "callback_set_ui_scaling": callbackSetUiScaling,
|
||||
# "callback_set_textbox_ui_scaling": callbackSetTextboxUiScaling,
|
||||
# "callback_set_message_box_ratio": callbackSetMessageBoxRatio,
|
||||
# "callback_set_font_family": callbackSetFontFamily,
|
||||
# "callback_set_ui_language": callbackSetUiLanguage,
|
||||
# "callback_set_enable_restore_main_window_geometry": callbackSetEnableRestoreMainWindowGeometry,
|
||||
|
||||
# Translation Tab
|
||||
"callback_set_use_translation_feature": callbackSetUseTranslationFeature,
|
||||
"callback_set_ctranslate2_weight_type": callbackSetCtranslate2WeightType,
|
||||
"callback_set_deepl_auth_key": callbackSetDeeplAuthKey,
|
||||
# # Translation Tab
|
||||
# "callback_set_use_translation_feature": callbackSetUseTranslationFeature,
|
||||
# "callback_set_ctranslate2_weight_type": callbackSetCtranslate2WeightType,
|
||||
# "callback_set_deepl_auth_key": callbackSetDeeplAuthKey,
|
||||
|
||||
# Transcription Tab (Mic)
|
||||
"callback_set_mic_host": callbackSetMicHost,
|
||||
"list_mic_host": model.getListInputHost(),
|
||||
"callback_set_mic_device": callbackSetMicDevice,
|
||||
"list_mic_device": model.getListInputDevice(),
|
||||
"callback_set_mic_energy_threshold": callbackSetMicEnergyThreshold,
|
||||
"callback_set_mic_dynamic_energy_threshold": callbackSetMicDynamicEnergyThreshold,
|
||||
"callback_check_mic_threshold": callbackCheckMicThreshold,
|
||||
"callback_set_mic_record_timeout": callbackSetMicRecordTimeout,
|
||||
"callback_set_mic_phrase_timeout": callbackSetMicPhraseTimeout,
|
||||
"callback_set_mic_max_phrases": callbackSetMicMaxPhrases,
|
||||
"callback_set_mic_word_filter": callbackSetMicWordFilter,
|
||||
"callback_delete_mic_word_filter": callbackDeleteMicWordFilter,
|
||||
# # Transcription Tab (Mic)
|
||||
# "callback_set_mic_host": callbackSetMicHost,
|
||||
# "list_mic_host": model.getListInputHost(),
|
||||
# "callback_set_mic_device": callbackSetMicDevice,
|
||||
# "list_mic_device": model.getListInputDevice(),
|
||||
# "callback_set_mic_energy_threshold": callbackSetMicEnergyThreshold,
|
||||
# "callback_set_mic_dynamic_energy_threshold": callbackSetMicDynamicEnergyThreshold,
|
||||
# "callback_check_mic_threshold": callbackCheckMicThreshold,
|
||||
# "callback_set_mic_record_timeout": callbackSetMicRecordTimeout,
|
||||
# "callback_set_mic_phrase_timeout": callbackSetMicPhraseTimeout,
|
||||
# "callback_set_mic_max_phrases": callbackSetMicMaxPhrases,
|
||||
# "callback_set_mic_word_filter": callbackSetMicWordFilter,
|
||||
# "callback_delete_mic_word_filter": callbackDeleteMicWordFilter,
|
||||
|
||||
# Transcription Tab (Speaker)
|
||||
"callback_set_speaker_device": callbackSetSpeakerDevice,
|
||||
"list_speaker_device": model.getListOutputDevice(),
|
||||
"callback_set_speaker_energy_threshold": callbackSetSpeakerEnergyThreshold,
|
||||
"callback_set_speaker_dynamic_energy_threshold": callbackSetSpeakerDynamicEnergyThreshold,
|
||||
"callback_check_speaker_threshold": callbackCheckSpeakerThreshold,
|
||||
"callback_set_speaker_record_timeout": callbackSetSpeakerRecordTimeout,
|
||||
"callback_set_speaker_phrase_timeout": callbackSetSpeakerPhraseTimeout,
|
||||
"callback_set_speaker_max_phrases": callbackSetSpeakerMaxPhrases,
|
||||
# # Transcription Tab (Speaker)
|
||||
# "callback_set_speaker_device": callbackSetSpeakerDevice,
|
||||
# "list_speaker_device": model.getListOutputDevice(),
|
||||
# "callback_set_speaker_energy_threshold": callbackSetSpeakerEnergyThreshold,
|
||||
# "callback_set_speaker_dynamic_energy_threshold": callbackSetSpeakerDynamicEnergyThreshold,
|
||||
# "callback_check_speaker_threshold": callbackCheckSpeakerThreshold,
|
||||
# "callback_set_speaker_record_timeout": callbackSetSpeakerRecordTimeout,
|
||||
# "callback_set_speaker_phrase_timeout": callbackSetSpeakerPhraseTimeout,
|
||||
# "callback_set_speaker_max_phrases": callbackSetSpeakerMaxPhrases,
|
||||
|
||||
# Transcription Tab (Internal AI Model)
|
||||
"callback_set_use_whisper_feature": callbackSetUserWhisperFeature,
|
||||
"callback_set_whisper_weight_type": callbackSetWhisperWeightType,
|
||||
# # Transcription Tab (Internal AI Model)
|
||||
# "callback_set_use_whisper_feature": callbackSetUserWhisperFeature,
|
||||
# "callback_set_whisper_weight_type": callbackSetWhisperWeightType,
|
||||
|
||||
# VR Tab
|
||||
"callback_set_overlay_settings": callbackSetOverlaySettings,
|
||||
"callback_set_enable_overlay_small_log": callbackSetEnableOverlaySmallLog,
|
||||
"callback_set_overlay_small_log_settings": callbackSetOverlaySmallLogSettings,
|
||||
# # VR Tab
|
||||
# "callback_set_overlay_settings": callbackSetOverlaySettings,
|
||||
# "callback_set_enable_overlay_small_log": callbackSetEnableOverlaySmallLog,
|
||||
# "callback_set_overlay_small_log_settings": callbackSetOverlaySmallLogSettings,
|
||||
|
||||
# Others Tab
|
||||
"callback_set_enable_auto_clear_chatbox": callbackSetEnableAutoClearMessageBox,
|
||||
"callback_set_send_only_translated_messages": callbackSetEnableSendOnlyTranslatedMessages,
|
||||
"callback_set_send_message_button_type": callbackSetSendMessageButtonType,
|
||||
"callback_set_enable_notice_xsoverlay": callbackSetEnableNoticeXsoverlay,
|
||||
"callback_set_enable_auto_export_message_logs": callbackSetEnableAutoExportMessageLogs,
|
||||
"callback_set_enable_vrc_mic_mute_sync": callbackSetEnableVrcMicMuteSync,
|
||||
"callback_set_enable_send_message_to_vrc": callbackSetEnableSendMessageToVrc,
|
||||
# Others(Message Formats(Send)
|
||||
"callback_set_send_message_format": callbackSetSendMessageFormat,
|
||||
"callback_set_send_message_format_with_t": callbackSetSendMessageFormatWithT,
|
||||
# Others(Message Formats(Received)
|
||||
"callback_set_received_message_format": callbackSetReceivedMessageFormat,
|
||||
"callback_set_received_message_format_with_t": callbackSetReceivedMessageFormatWithT,
|
||||
# # Others Tab
|
||||
# "callback_set_enable_auto_clear_chatbox": callbackSetEnableAutoClearMessageBox,
|
||||
# "callback_set_send_only_translated_messages": callbackSetEnableSendOnlyTranslatedMessages,
|
||||
# "callback_set_send_message_button_type": callbackSetSendMessageButtonType,
|
||||
# "callback_set_enable_notice_xsoverlay": callbackSetEnableNoticeXsoverlay,
|
||||
# "callback_set_enable_auto_export_message_logs": callbackSetEnableAutoExportMessageLogs,
|
||||
# "callback_set_enable_vrc_mic_mute_sync": callbackSetEnableVrcMicMuteSync,
|
||||
# "callback_set_enable_send_message_to_vrc": callbackSetEnableSendMessageToVrc,
|
||||
# # Others(Message Formats(Send)
|
||||
# "callback_set_send_message_format": callbackSetSendMessageFormat,
|
||||
# "callback_set_send_message_format_with_t": callbackSetSendMessageFormatWithT,
|
||||
# # Others(Message Formats(Received)
|
||||
# "callback_set_received_message_format": callbackSetReceivedMessageFormat,
|
||||
# "callback_set_received_message_format_with_t": callbackSetReceivedMessageFormatWithT,
|
||||
|
||||
# Speaker2Chatbox----------------
|
||||
"callback_set_enable_send_received_message_to_vrc": callbackSetEnableSendReceivedMessageToVrc,
|
||||
# Speaker2Chatbox----------------
|
||||
# # Speaker2Chatbox----------------
|
||||
# "callback_set_enable_send_received_message_to_vrc": callbackSetEnableSendReceivedMessageToVrc,
|
||||
# # Speaker2Chatbox----------------
|
||||
|
||||
# Advanced Settings Tab
|
||||
"callback_set_osc_ip_address": callbackSetOscIpAddress,
|
||||
"callback_set_osc_port": callbackSetOscPort,
|
||||
},
|
||||
)
|
||||
# # Advanced Settings Tab
|
||||
# "callback_set_osc_ip_address": callbackSetOscIpAddress,
|
||||
# "callback_set_osc_port": callbackSetOscPort,
|
||||
# },
|
||||
# )
|
||||
|
||||
def showMainWindow():
|
||||
view.startMainLoop()
|
||||
# def showMainWindow():
|
||||
# view.startMainLoop()
|
||||
Reference in New Issue
Block a user