Merge branch 'vrc_sfx' into develop
This commit is contained in:
@@ -239,6 +239,7 @@ config_page:
|
|||||||
label: Show Only Translated Messages
|
label: Show Only Translated Messages
|
||||||
|
|
||||||
others:
|
others:
|
||||||
|
section_label_sounds: Sounds
|
||||||
auto_clear_the_message_box:
|
auto_clear_the_message_box:
|
||||||
label: Auto Clear The Message Box
|
label: Auto Clear The Message Box
|
||||||
send_only_translated_messages:
|
send_only_translated_messages:
|
||||||
@@ -254,6 +255,8 @@ config_page:
|
|||||||
send_message_to_vrc:
|
send_message_to_vrc:
|
||||||
label: Send Message To VRChat
|
label: Send Message To VRChat
|
||||||
desc: There is a way to use it without sending messages to VRChat, but it is not supported. Enable this feature when you intend to send a message to VRChat.
|
desc: There is a way to use it without sending messages to VRChat, but it is not supported. Enable this feature when you intend to send a message to VRChat.
|
||||||
|
notification_vrc_sfx:
|
||||||
|
label: Enable Notification Sound When Sending Chat
|
||||||
send_received_message_to_vrc:
|
send_received_message_to_vrc:
|
||||||
label: Send Received Message To VRChat
|
label: Send Received Message To VRChat
|
||||||
desc: Send the message you received from the speaker's sound to VRChat's chatbox.
|
desc: Send the message you received from the speaker's sound to VRChat's chatbox.
|
||||||
|
|||||||
@@ -237,6 +237,7 @@ config_page:
|
|||||||
label: 翻訳後のメッセージのみ表示する
|
label: 翻訳後のメッセージのみ表示する
|
||||||
|
|
||||||
others:
|
others:
|
||||||
|
section_label_sounds: サウンド
|
||||||
auto_clear_the_message_box:
|
auto_clear_the_message_box:
|
||||||
label: 送信後はチャットボックスを空にする
|
label: 送信後はチャットボックスを空にする
|
||||||
send_only_translated_messages:
|
send_only_translated_messages:
|
||||||
@@ -252,6 +253,8 @@ config_page:
|
|||||||
send_message_to_vrc:
|
send_message_to_vrc:
|
||||||
label: VRChatにメッセージを送信する
|
label: VRChatにメッセージを送信する
|
||||||
desc: サポート対象外ですが、VRChatにメッセージを送信せずに使う方法があります。送信したい場合、この機能を有効にする事を忘れないでください。
|
desc: サポート対象外ですが、VRChatにメッセージを送信せずに使う方法があります。送信したい場合、この機能を有効にする事を忘れないでください。
|
||||||
|
notification_vrc_sfx:
|
||||||
|
label: チャット送信時に音を鳴らさない
|
||||||
send_received_message_to_vrc:
|
send_received_message_to_vrc:
|
||||||
label: 受信したメッセージをVRChatに送信する
|
label: 受信したメッセージをVRChatに送信する
|
||||||
desc: スピーカーから聞き取り、文字起こしされたメッセージをVRChatに送信します。
|
desc: スピーカーから聞き取り、文字起こしされたメッセージをVRChatに送信します。
|
||||||
|
|||||||
@@ -931,6 +931,17 @@ class Config:
|
|||||||
self._VRC_MIC_MUTE_SYNC = value
|
self._VRC_MIC_MUTE_SYNC = value
|
||||||
self.saveConfig(inspect.currentframe().f_code.co_name, value)
|
self.saveConfig(inspect.currentframe().f_code.co_name, value)
|
||||||
|
|
||||||
|
@property
|
||||||
|
@json_serializable('NOTIFICATION_VRC_SFX')
|
||||||
|
def NOTIFICATION_VRC_SFX(self):
|
||||||
|
return self._NOTIFICATION_VRC_SFX
|
||||||
|
|
||||||
|
@NOTIFICATION_VRC_SFX.setter
|
||||||
|
def NOTIFICATION_VRC_SFX(self, value):
|
||||||
|
if isinstance(value, bool):
|
||||||
|
self._NOTIFICATION_VRC_SFX = value
|
||||||
|
self.saveConfig(inspect.currentframe().f_code.co_name, value)
|
||||||
|
|
||||||
def init_config(self):
|
def init_config(self):
|
||||||
# Read Only
|
# Read Only
|
||||||
self._VERSION = "3.0.2"
|
self._VERSION = "3.0.2"
|
||||||
@@ -1114,6 +1125,7 @@ class Config:
|
|||||||
self._SEND_RECEIVED_MESSAGE_TO_VRC = False
|
self._SEND_RECEIVED_MESSAGE_TO_VRC = False
|
||||||
self._LOGGER_FEATURE = False
|
self._LOGGER_FEATURE = False
|
||||||
self._VRC_MIC_MUTE_SYNC = False
|
self._VRC_MIC_MUTE_SYNC = False
|
||||||
|
self._NOTIFICATION_VRC_SFX = True
|
||||||
|
|
||||||
def load_config(self):
|
def load_config(self):
|
||||||
if os_path.isfile(self.PATH_CONFIG) is not False:
|
if os_path.isfile(self.PATH_CONFIG) is not False:
|
||||||
|
|||||||
@@ -1099,6 +1099,20 @@ class Controller:
|
|||||||
model.setOscPort(config.OSC_PORT)
|
model.setOscPort(config.OSC_PORT)
|
||||||
return {"status":200, "result":config.OSC_PORT}
|
return {"status":200, "result":config.OSC_PORT}
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def getNotificationVrcSfx(*args, **kwargs) -> dict:
|
||||||
|
return {"status":200, "result":config.NOTIFICATION_VRC_SFX}
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def setEnableNotificationVrcSfx(*args, **kwargs) -> dict:
|
||||||
|
config.NOTIFICATION_VRC_SFX = True
|
||||||
|
return {"status":200, "result":config.NOTIFICATION_VRC_SFX}
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def setDisableNotificationVrcSfx(*args, **kwargs) -> dict:
|
||||||
|
config.NOTIFICATION_VRC_SFX = False
|
||||||
|
return {"status":200, "result":config.NOTIFICATION_VRC_SFX}
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def getDeepLAuthKey(*args, **kwargs) -> dict:
|
def getDeepLAuthKey(*args, **kwargs) -> dict:
|
||||||
return {"status":200, "result":config.AUTH_KEYS["DeepL_API"]}
|
return {"status":200, "result":config.AUTH_KEYS["DeepL_API"]}
|
||||||
|
|||||||
@@ -295,6 +295,10 @@ mapping = {
|
|||||||
"/get/data/osc_port": {"status": True, "variable":controller.getOscPort},
|
"/get/data/osc_port": {"status": True, "variable":controller.getOscPort},
|
||||||
"/set/data/osc_port": {"status": True, "variable":controller.setOscPort},
|
"/set/data/osc_port": {"status": True, "variable":controller.setOscPort},
|
||||||
|
|
||||||
|
"/get/data/notification_vrc_sfx": {"status": True, "variable":controller.getNotificationVrcSfx},
|
||||||
|
"/set/enable/notification_vrc_sfx": {"status": True, "variable":controller.setEnableNotificationVrcSfx},
|
||||||
|
"/set/disable/notification_vrc_sfx": {"status": True, "variable":controller.setDisableNotificationVrcSfx},
|
||||||
|
|
||||||
"/run/open_filepath_config_file": {"status": True, "variable":controller.openFilepathConfigFile},
|
"/run/open_filepath_config_file": {"status": True, "variable":controller.openFilepathConfigFile},
|
||||||
|
|
||||||
# "/run/start_watchdog": {"status": True, "variable":controller.startWatchdog},
|
# "/run/start_watchdog": {"status": True, "variable":controller.startWatchdog},
|
||||||
|
|||||||
@@ -289,8 +289,8 @@ class Model:
|
|||||||
def oscStopSendTyping(self):
|
def oscStopSendTyping(self):
|
||||||
self.osc_handler.sendTyping(flag=False)
|
self.osc_handler.sendTyping(flag=False)
|
||||||
|
|
||||||
def oscSendMessage(self, message, notification=True):
|
def oscSendMessage(self, message:str):
|
||||||
self.osc_handler.sendMessage(message=message, notification=notification)
|
self.osc_handler.sendMessage(message=message, notification=config.NOTIFICATION_VRC_SFX)
|
||||||
|
|
||||||
def getMuteSelfStatus(self):
|
def getMuteSelfStatus(self):
|
||||||
return self.osc_handler.getOSCParameterMuteSelf()
|
return self.osc_handler.getOSCParameterMuteSelf()
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
useEnableVrcMicMuteSync,
|
useEnableVrcMicMuteSync,
|
||||||
useEnableSendMessageToVrc,
|
useEnableSendMessageToVrc,
|
||||||
useEnableSendReceivedMessageToVrc,
|
useEnableSendReceivedMessageToVrc,
|
||||||
|
useEnableNotificationVrcSfx,
|
||||||
} from "@logics_configs";
|
} from "@logics_configs";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -25,6 +26,8 @@ import { Checkbox } from "@common_components";
|
|||||||
import OpenFolderSvg from "@images/open_folder.svg?react";
|
import OpenFolderSvg from "@images/open_folder.svg?react";
|
||||||
|
|
||||||
export const Others = () => {
|
export const Others = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<div>
|
<div>
|
||||||
@@ -34,6 +37,10 @@ export const Others = () => {
|
|||||||
<VrcMicMuteSyncContainer />
|
<VrcMicMuteSyncContainer />
|
||||||
<SendMessageToVrcContainer />
|
<SendMessageToVrcContainer />
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<SectionLabelComponent label={t("config_page.others.section_label_sounds")} />
|
||||||
|
<EnableNotificationVrcSfxContainer />
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<SectionLabelComponent label="Speaker2Chatbox" />
|
<SectionLabelComponent label="Speaker2Chatbox" />
|
||||||
<SendReceivedMessageToVrcContainer />
|
<SendReceivedMessageToVrcContainer />
|
||||||
@@ -118,6 +125,19 @@ const SendMessageToVrcContainer = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const EnableNotificationVrcSfxContainer = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const { currentEnableNotificationVrcSfx, toggleEnableNotificationVrcSfx } = useEnableNotificationVrcSfx();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<CheckboxContainer
|
||||||
|
label={t("config_page.others.notification_vrc_sfx.label")}
|
||||||
|
variable={currentEnableNotificationVrcSfx}
|
||||||
|
toggleFunction={toggleEnableNotificationVrcSfx}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const SendReceivedMessageToVrcContainer = () => {
|
const SendReceivedMessageToVrcContainer = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { currentEnableSendReceivedMessageToVrc, toggleEnableSendReceivedMessageToVrc } = useEnableSendReceivedMessageToVrc();
|
const { currentEnableSendReceivedMessageToVrc, toggleEnableSendReceivedMessageToVrc } = useEnableSendReceivedMessageToVrc();
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ export { useEnableSendMessageToVrc } from "./others/useEnableSendMessageToVrc";
|
|||||||
export { useEnableSendReceivedMessageToVrc } from "./others/useEnableSendReceivedMessageToVrc";
|
export { useEnableSendReceivedMessageToVrc } from "./others/useEnableSendReceivedMessageToVrc";
|
||||||
export { useEnableSendOnlyTranslatedMessages } from "./others/useEnableSendOnlyTranslatedMessages";
|
export { useEnableSendOnlyTranslatedMessages } from "./others/useEnableSendOnlyTranslatedMessages";
|
||||||
export { useEnableVrcMicMuteSync } from "./others/useEnableVrcMicMuteSync";
|
export { useEnableVrcMicMuteSync } from "./others/useEnableVrcMicMuteSync";
|
||||||
|
export { useEnableNotificationVrcSfx } from "./others/useEnableNotificationVrcSfx";
|
||||||
|
|
||||||
export { useMicRecordTimeout } from "./transcription/useMicRecordTimeout";
|
export { useMicRecordTimeout } from "./transcription/useMicRecordTimeout";
|
||||||
export { useMicPhraseTimeout } from "./transcription/useMicPhraseTimeout";
|
export { useMicPhraseTimeout } from "./transcription/useMicPhraseTimeout";
|
||||||
|
|||||||
28
src-ui/logics/configs/others/useEnableNotificationVrcSfx.js
Normal file
28
src-ui/logics/configs/others/useEnableNotificationVrcSfx.js
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
import { useStore_EnableNotificationVrcSfx } from "@store";
|
||||||
|
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||||
|
|
||||||
|
export const useEnableNotificationVrcSfx = () => {
|
||||||
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
const { currentEnableNotificationVrcSfx, updateEnableNotificationVrcSfx, pendingEnableNotificationVrcSfx } = useStore_EnableNotificationVrcSfx();
|
||||||
|
|
||||||
|
const getEnableNotificationVrcSfx = () => {
|
||||||
|
pendingEnableNotificationVrcSfx();
|
||||||
|
asyncStdoutToPython("/get/data/notification_vrc_sfx");
|
||||||
|
};
|
||||||
|
|
||||||
|
const toggleEnableNotificationVrcSfx = () => {
|
||||||
|
pendingEnableNotificationVrcSfx();
|
||||||
|
if (currentEnableNotificationVrcSfx.data) {
|
||||||
|
asyncStdoutToPython("/set/disable/notification_vrc_sfx");
|
||||||
|
} else {
|
||||||
|
asyncStdoutToPython("/set/enable/notification_vrc_sfx");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
currentEnableNotificationVrcSfx,
|
||||||
|
getEnableNotificationVrcSfx,
|
||||||
|
toggleEnableNotificationVrcSfx,
|
||||||
|
updateEnableNotificationVrcSfx,
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -69,6 +69,7 @@ import {
|
|||||||
useIsEnabledOverlayLargeLog,
|
useIsEnabledOverlayLargeLog,
|
||||||
useOverlayLargeLogSettings,
|
useOverlayLargeLogSettings,
|
||||||
useOverlayShowOnlyTranslatedMessages,
|
useOverlayShowOnlyTranslatedMessages,
|
||||||
|
useEnableNotificationVrcSfx,
|
||||||
useHotkeys,
|
useHotkeys,
|
||||||
useOscIpAddress,
|
useOscIpAddress,
|
||||||
useOscPort,
|
useOscPort,
|
||||||
@@ -170,6 +171,7 @@ export const useReceiveRoutes = () => {
|
|||||||
const { updateOverlayLargeLogSettings } = useOverlayLargeLogSettings();
|
const { updateOverlayLargeLogSettings } = useOverlayLargeLogSettings();
|
||||||
const { updateIsEnabledOverlayLargeLog } = useIsEnabledOverlayLargeLog();
|
const { updateIsEnabledOverlayLargeLog } = useIsEnabledOverlayLargeLog();
|
||||||
const { updateOverlayShowOnlyTranslatedMessages } = useOverlayShowOnlyTranslatedMessages();
|
const { updateOverlayShowOnlyTranslatedMessages } = useOverlayShowOnlyTranslatedMessages();
|
||||||
|
const { updateEnableNotificationVrcSfx } = useEnableNotificationVrcSfx();
|
||||||
|
|
||||||
const { updateHotkeys } = useHotkeys();
|
const { updateHotkeys } = useHotkeys();
|
||||||
|
|
||||||
@@ -472,6 +474,10 @@ export const useReceiveRoutes = () => {
|
|||||||
"/set/enable/send_received_message_to_vrc": updateEnableSendReceivedMessageToVrc,
|
"/set/enable/send_received_message_to_vrc": updateEnableSendReceivedMessageToVrc,
|
||||||
"/set/disable/send_received_message_to_vrc": updateEnableSendReceivedMessageToVrc,
|
"/set/disable/send_received_message_to_vrc": updateEnableSendReceivedMessageToVrc,
|
||||||
|
|
||||||
|
"/get/data/notification_vrc_sfx": updateEnableNotificationVrcSfx,
|
||||||
|
"/set/enable/notification_vrc_sfx": updateEnableNotificationVrcSfx,
|
||||||
|
"/set/disable/notification_vrc_sfx": updateEnableNotificationVrcSfx,
|
||||||
|
|
||||||
// Hotkeys
|
// Hotkeys
|
||||||
"/get/data/hotkeys": updateHotkeys,
|
"/get/data/hotkeys": updateHotkeys,
|
||||||
"/set/data/hotkeys": updateHotkeys,
|
"/set/data/hotkeys": updateHotkeys,
|
||||||
|
|||||||
@@ -264,6 +264,7 @@ export const { atomInstance: Atom_EnableAutoExportMessageLogs, useHook: useStore
|
|||||||
export const { atomInstance: Atom_EnableVrcMicMuteSync, useHook: useStore_EnableVrcMicMuteSync } = createAtomWithHook(false, "EnableVrcMicMuteSync");
|
export const { atomInstance: Atom_EnableVrcMicMuteSync, useHook: useStore_EnableVrcMicMuteSync } = createAtomWithHook(false, "EnableVrcMicMuteSync");
|
||||||
export const { atomInstance: Atom_EnableSendMessageToVrc, useHook: useStore_EnableSendMessageToVrc } = createAtomWithHook(true, "EnableSendMessageToVrc");
|
export const { atomInstance: Atom_EnableSendMessageToVrc, useHook: useStore_EnableSendMessageToVrc } = createAtomWithHook(true, "EnableSendMessageToVrc");
|
||||||
export const { atomInstance: Atom_EnableSendReceivedMessageToVrc, useHook: useStore_EnableSendReceivedMessageToVrc } = createAtomWithHook(false, "EnableSendReceivedMessageToVrc");
|
export const { atomInstance: Atom_EnableSendReceivedMessageToVrc, useHook: useStore_EnableSendReceivedMessageToVrc } = createAtomWithHook(false, "EnableSendReceivedMessageToVrc");
|
||||||
|
export const { atomInstance: Atom_EnableNotificationVrcSfx, useHook: useStore_EnableNotificationVrcSfx } = createAtomWithHook(true, "EnableNotificationVrcSfx");
|
||||||
|
|
||||||
// Hotkeys
|
// Hotkeys
|
||||||
export const { atomInstance: Atom_Hotkeys, useHook: useStore_Hotkeys } = createAtomWithHook({
|
export const { atomInstance: Atom_Hotkeys, useHook: useStore_Hotkeys } = createAtomWithHook({
|
||||||
|
|||||||
Reference in New Issue
Block a user