Merge branch 'oscquery' into for_webui
This commit is contained in:
@@ -183,6 +183,15 @@ class Config:
|
||||
if isinstance(value, dict):
|
||||
self._SELECTABLE_WHISPER_WEIGHT_TYPE_DICT = value
|
||||
|
||||
@property
|
||||
def RECEIVE_OSC_RUNNING(self):
|
||||
return self._RECEIVE_OSC_RUNNING
|
||||
|
||||
@RECEIVE_OSC_RUNNING.setter
|
||||
def RECEIVE_OSC_RUNNING(self, value):
|
||||
if isinstance(value, bool):
|
||||
self._RECEIVE_OSC_RUNNING = value
|
||||
|
||||
# Save Json Data
|
||||
## Main Window
|
||||
@property
|
||||
@@ -925,21 +934,6 @@ class Config:
|
||||
self._UI_SCALING_RANGE = (40, 200)
|
||||
self._TEXTBOX_UI_SCALING_RANGE = (40, 200)
|
||||
self._MESSAGE_BOX_RATIO_RANGE = (1, 99)
|
||||
self._SELECTABLE_CTRANSLATE2_WEIGHT_TYPE_DICT = {
|
||||
"small": False,
|
||||
"large": False,
|
||||
}
|
||||
|
||||
self._SELECTABLE_WHISPER_WEIGHT_TYPE_DICT = {
|
||||
"tiny": False,
|
||||
"base": False,
|
||||
"small": False,
|
||||
"medium": False,
|
||||
"large-v1": False,
|
||||
"large-v2": False,
|
||||
"large-v3": False,
|
||||
}
|
||||
|
||||
self._MAX_MIC_THRESHOLD = 2000
|
||||
self._MAX_SPEAKER_THRESHOLD = 4000
|
||||
self._WATCHDOG_TIMEOUT = 60
|
||||
@@ -952,6 +946,20 @@ class Config:
|
||||
self._ENABLE_FOREGROUND = False
|
||||
self._ENABLE_CHECK_ENERGY_SEND = False
|
||||
self._ENABLE_CHECK_ENERGY_RECEIVE = False
|
||||
self._SELECTABLE_CTRANSLATE2_WEIGHT_TYPE_DICT = {
|
||||
"small": False,
|
||||
"large": False,
|
||||
}
|
||||
self._SELECTABLE_WHISPER_WEIGHT_TYPE_DICT = {
|
||||
"tiny": False,
|
||||
"base": False,
|
||||
"small": False,
|
||||
"medium": False,
|
||||
"large-v1": False,
|
||||
"large-v2": False,
|
||||
"large-v3": False,
|
||||
}
|
||||
self._RECEIVE_OSC_RUNNING = False
|
||||
|
||||
# Save Json Data
|
||||
## Main Window
|
||||
|
||||
@@ -70,15 +70,17 @@ class OSCHandler:
|
||||
self.osc_server = osc_server.ThreadingOSCUDPServer((self.osc_server_ip_address, self.osc_server_port), osc_dispatcher, asyncio.get_event_loop())
|
||||
Thread(target=self.oscServerServe, daemon=True).start()
|
||||
|
||||
query_service_success = False
|
||||
while not query_service_success:
|
||||
receive_osc_running = False
|
||||
for _ in range(10):
|
||||
try:
|
||||
self.osc_query_service = OSCQueryService(self.osc_query_service_name, self.http_port, self.osc_server_port)
|
||||
for filter, target in dict_filter_and_target.items():
|
||||
self.osc_query_service.advertise_endpoint(filter, access=OSCAccess.READWRITE_VALUE)
|
||||
query_service_success = True
|
||||
receive_osc_running = True
|
||||
break
|
||||
except Exception:
|
||||
pass
|
||||
sleep(1)
|
||||
return receive_osc_running
|
||||
|
||||
def oscServerServe(self) -> None:
|
||||
self.osc_server.serve_forever(2)
|
||||
|
||||
@@ -1310,8 +1310,11 @@ class Controller:
|
||||
|
||||
@staticmethod
|
||||
def setEnableVrcMicMuteSync(*args, **kwargs) -> dict:
|
||||
config.VRC_MIC_MUTE_SYNC = True
|
||||
model.setMuteSelfStatus()
|
||||
if config.RECEIVE_OSC_RUNNING is True:
|
||||
config.VRC_MIC_MUTE_SYNC = True
|
||||
model.setMuteSelfStatus()
|
||||
else:
|
||||
config.VRC_MIC_MUTE_SYNC = False
|
||||
model.changeMicTranscriptStatus()
|
||||
return {"status":200, "result":config.VRC_MIC_MUTE_SYNC}
|
||||
|
||||
@@ -1752,7 +1755,7 @@ class Controller:
|
||||
|
||||
# init OSC receive
|
||||
printLog("Init OSC Receive")
|
||||
model.startReceiveOSC()
|
||||
config.RECEIVE_OSC_RUNNING = model.startReceiveOSC()
|
||||
if config.VRC_MIC_MUTE_SYNC is True:
|
||||
self.setEnableVrcMicMuteSync()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user