🚧[WIP/TEST] Model : VRChatでMUTEにした場合にマイク文字起こしをしない機能を実装(途中)
This commit is contained in:
@@ -910,6 +910,24 @@ def callbackSetEnableSendReceivedMessageToVrc(value):
|
|||||||
# ---------------------Speaker2Chatbox---------------------
|
# ---------------------Speaker2Chatbox---------------------
|
||||||
|
|
||||||
|
|
||||||
|
def createDictOSCReceiveParameters():
|
||||||
|
osc_parameter_prefix = "/avatar/parameters/"
|
||||||
|
param_MuteSelf = "MuteSelf"
|
||||||
|
param_Voice = "Voice"
|
||||||
|
|
||||||
|
def change_handler_muteself(address, osc_arguments):
|
||||||
|
config.VRCHAT_MUTESELF = osc_arguments
|
||||||
|
|
||||||
|
def change_handler_voice(address, osc_arguments):
|
||||||
|
config.VRCHAT_MUTESELF = False
|
||||||
|
|
||||||
|
dict_filter_and_target = {
|
||||||
|
osc_parameter_prefix + param_MuteSelf: change_handler_muteself,
|
||||||
|
osc_parameter_prefix + param_Voice: change_handler_voice,
|
||||||
|
}
|
||||||
|
return dict_filter_and_target
|
||||||
|
|
||||||
|
|
||||||
# Advanced Settings Tab
|
# Advanced Settings Tab
|
||||||
def callbackSetOscIpAddress(value):
|
def callbackSetOscIpAddress(value):
|
||||||
if value == "":
|
if value == "":
|
||||||
@@ -975,6 +993,9 @@ def createMainWindow(splash):
|
|||||||
if config.ENABLE_LOGGER is True:
|
if config.ENABLE_LOGGER is True:
|
||||||
model.startLogger()
|
model.startLogger()
|
||||||
|
|
||||||
|
# init OSC
|
||||||
|
model.startReceiveOSC(createDictOSCReceiveParameters())
|
||||||
|
|
||||||
splash.toProgress(3) # Last one.
|
splash.toProgress(3) # Last one.
|
||||||
|
|
||||||
# set UI and callback
|
# set UI and callback
|
||||||
|
|||||||
57
model.py
57
model.py
@@ -209,39 +209,42 @@ class Model:
|
|||||||
def oscSendMessage(message):
|
def oscSendMessage(message):
|
||||||
sendMessage(message, config.OSC_IP_ADDRESS, config.OSC_PORT)
|
sendMessage(message, config.OSC_IP_ADDRESS, config.OSC_PORT)
|
||||||
|
|
||||||
def checkOSCStarted(self, fnc):
|
# def checkOSCStarted(self, fnc):
|
||||||
self.is_valid_osc = False
|
# self.is_valid_osc = False
|
||||||
def checkOscReceive(address, osc_arguments):
|
# def checkOscReceive(address, osc_arguments):
|
||||||
if self.is_valid_osc is False:
|
# if self.is_valid_osc is False:
|
||||||
self.is_valid_osc = True
|
# self.is_valid_osc = True
|
||||||
|
|
||||||
self.listening_server = receiveOscParameters(checkOscReceive)
|
# self.listening_server = receiveOscParameters(checkOscReceive)
|
||||||
def oscListener():
|
# def oscListener():
|
||||||
self.listening_server.serve_forever()
|
# self.listening_server.serve_forever()
|
||||||
|
|
||||||
def sendTestActionLoop():
|
# def sendTestActionLoop():
|
||||||
for _ in range(10):
|
# for _ in range(10):
|
||||||
sendTestAction()
|
# sendTestAction()
|
||||||
if self.is_valid_osc is True:
|
# if self.is_valid_osc is True:
|
||||||
break
|
# break
|
||||||
sleep(0.1)
|
# sleep(0.1)
|
||||||
self.listening_server.shutdown()
|
# self.listening_server.shutdown()
|
||||||
|
|
||||||
# start receive osc
|
# # start receive osc
|
||||||
th_receive_osc_parameters = Thread(target=oscListener)
|
# th_receive_osc_parameters = Thread(target=oscListener)
|
||||||
th_receive_osc_parameters.daemon = True
|
# th_receive_osc_parameters.daemon = True
|
||||||
th_receive_osc_parameters.start()
|
# th_receive_osc_parameters.start()
|
||||||
|
|
||||||
# check osc started
|
# # check osc started
|
||||||
th_send_osc_test_action = Thread(target=sendTestActionLoop)
|
# th_send_osc_test_action = Thread(target=sendTestActionLoop)
|
||||||
th_send_osc_test_action.daemon = True
|
# th_send_osc_test_action.daemon = True
|
||||||
th_send_osc_test_action.start()
|
# th_send_osc_test_action.start()
|
||||||
|
|
||||||
th_receive_osc_parameters.join()
|
# th_receive_osc_parameters.join()
|
||||||
th_send_osc_test_action.join()
|
# th_send_osc_test_action.join()
|
||||||
|
|
||||||
if self.is_valid_osc is False:
|
# if self.is_valid_osc is False:
|
||||||
fnc()
|
# fnc()
|
||||||
|
|
||||||
|
def startReceiveOSC(self, fnc):
|
||||||
|
self.listening_server = receiveOscParameters(fnc)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def checkSoftwareUpdated():
|
def checkSoftwareUpdated():
|
||||||
|
|||||||
Reference in New Issue
Block a user