Merge branch 'ui_refactoring' into develop
This commit is contained in:
commit
d454c9b13a
110 files changed
+807
-948
No files matched your search
@@ -1,4 +1,4 @@
|
|||||||
export const generateTestData = (num) => {
|
export const generateTestConversationData = (num) => {
|
||||||
const testDataArray = [];
|
const testDataArray = [];
|
||||||
const messagesJa = [
|
const messagesJa = [
|
||||||
"今日はとてもいい天気ですね。",
|
"今日はとてもいい天気ですね。",
|
||||||
+13
-8
@@ -11,18 +11,23 @@ import {
|
|||||||
TransparencyController,
|
TransparencyController,
|
||||||
CornerRadiusController,
|
CornerRadiusController,
|
||||||
PluginsController,
|
PluginsController,
|
||||||
} from "./_app_controllers/index.js";
|
} from "./_app_controllers";
|
||||||
|
|
||||||
|
import styles from "./App.module.scss";
|
||||||
|
|
||||||
import { WindowTitleBar } from "./window_title_bar/WindowTitleBar";
|
|
||||||
import { MainPage } from "./main_page/MainPage";
|
import { MainPage } from "./main_page/MainPage";
|
||||||
import { ConfigPage } from "./config_page/ConfigPage";
|
import { ConfigPage } from "./config_page/ConfigPage";
|
||||||
import { SplashComponent } from "./splash_component/SplashComponent";
|
|
||||||
import { UpdatingComponent } from "./updating_component/UpdatingComponent";
|
import {
|
||||||
import { ModalController } from "./modal_controller/ModalController";
|
WindowTitleBar,
|
||||||
import { SnackbarController } from "./snackbar_controller/SnackbarController";
|
SplashComponent,
|
||||||
import styles from "./App.module.scss";
|
UpdatingComponent,
|
||||||
|
ModalController,
|
||||||
|
SnackbarController,
|
||||||
|
AppErrorBoundary,
|
||||||
|
} from "./others";
|
||||||
|
|
||||||
import { useIsBackendReady, useIsSoftwareUpdating, useIsVrctAvailable, useWindow } from "@logics_common";
|
import { useIsBackendReady, useIsSoftwareUpdating, useIsVrctAvailable, useWindow } from "@logics_common";
|
||||||
import { AppErrorBoundary } from "./error_boundary/AppErrorBoundary";
|
|
||||||
|
|
||||||
export const App = () => {
|
export const App = () => {
|
||||||
const { currentIsVrctAvailable } = useIsVrctAvailable();
|
const { currentIsVrctAvailable } = useIsVrctAvailable();
|
||||||
|
|||||||
@@ -1,11 +1,16 @@
|
|||||||
import { invoke } from "@tauri-apps/api/core";
|
import { invoke } from "@tauri-apps/api/core";
|
||||||
|
import { Command } from "@tauri-apps/plugin-shell";
|
||||||
import { useEffect, useRef } from "react";
|
import { useEffect, useRef } from "react";
|
||||||
import { useStartPython } from "@logics/useStartPython";
|
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
|
||||||
|
|
||||||
import { useStore_SelectableFontFamilyList } from "@store";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
import { useReceiveRoutes } from "@useReceiveRoutes";
|
||||||
|
import { store, useStore_SelectableFontFamilyList } from "@store";
|
||||||
import { arrayToObject } from "@utils";
|
import { arrayToObject } from "@utils";
|
||||||
|
|
||||||
|
import {
|
||||||
|
useNotificationStatus,
|
||||||
|
} from "@logics_common";
|
||||||
|
|
||||||
export const StartPythonController = () => {
|
export const StartPythonController = () => {
|
||||||
const { asyncStartPython } = useStartPython();
|
const { asyncStartPython } = useStartPython();
|
||||||
const hasRunRef = useRef(false);
|
const hasRunRef = useRef(false);
|
||||||
@@ -26,6 +31,34 @@ export const StartPythonController = () => {
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const useStartPython = () => {
|
||||||
|
const { receiveRoutes } = useReceiveRoutes();
|
||||||
|
const { showNotification_Success, showNotification_Error } = useNotificationStatus();
|
||||||
|
|
||||||
|
const asyncStartPython = async () => {
|
||||||
|
const command = Command.sidecar("bin/VRCT-sidecar");
|
||||||
|
command.on("error", error => console.error(`error: "${error}"`));
|
||||||
|
command.stdout.on("data", (line) => {
|
||||||
|
let parsed_data = "";
|
||||||
|
try {
|
||||||
|
parsed_data = JSON.parse(line);
|
||||||
|
receiveRoutes(parsed_data);
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error, line);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
command.stderr.on("data", line => {
|
||||||
|
showNotification_Error(
|
||||||
|
`An error occurred. Please restart VRCT or contact the developers. The last line:${JSON.stringify(line)}`, { hide_duration: null });
|
||||||
|
console.error("stderr", line);
|
||||||
|
});
|
||||||
|
const backend_subprocess = await command.spawn();
|
||||||
|
store.backend_subprocess = backend_subprocess;
|
||||||
|
};
|
||||||
|
|
||||||
|
return { asyncStartPython };
|
||||||
|
};
|
||||||
|
|
||||||
const useAsyncFetchFonts = () => {
|
const useAsyncFetchFonts = () => {
|
||||||
const { updateSelectableFontFamilyList } = useStore_SelectableFontFamilyList();
|
const { updateSelectableFontFamilyList } = useStore_SelectableFontFamilyList();
|
||||||
const asyncFetchFonts = async () => {
|
const asyncFetchFonts = async () => {
|
||||||
|
|||||||
@@ -13,4 +13,3 @@ export { SwitchBox } from "./switch_box/SwitchBox";
|
|||||||
export { ThresholdComponent } from "./threshold_component/ThresholdComponent";
|
export { ThresholdComponent } from "./threshold_component/ThresholdComponent";
|
||||||
export { WordFilter, WordFilterListToggleComponent } from "./word_filter/WordFilter";
|
export { WordFilter, WordFilterListToggleComponent } from "./word_filter/WordFilter";
|
||||||
export { DownloadModels } from "./download_models/DownloadModels";
|
export { DownloadModels } from "./download_models/DownloadModels";
|
||||||
export { PluginsControlComponent } from "./plugins_control_component/PluginsControlComponent";
|
|
||||||
+3
-4
@@ -7,8 +7,7 @@ import { useVolume } from "@logics_common";
|
|||||||
import MicSvg from "@images/mic.svg?react";
|
import MicSvg from "@images/mic.svg?react";
|
||||||
import HeadphonesSvg from "@images/headphones.svg?react";
|
import HeadphonesSvg from "@images/headphones.svg?react";
|
||||||
import {
|
import {
|
||||||
useMicThreshold,
|
useDevice,
|
||||||
useSpeakerThreshold,
|
|
||||||
} from "@logics_configs";
|
} from "@logics_configs";
|
||||||
|
|
||||||
export const ThresholdComponent = (props) => {
|
export const ThresholdComponent = (props) => {
|
||||||
@@ -27,7 +26,7 @@ const MicComponent = (props) => {
|
|||||||
currentMicThreshold,
|
currentMicThreshold,
|
||||||
setMicThreshold,
|
setMicThreshold,
|
||||||
currentEnableAutomaticMicThreshold,
|
currentEnableAutomaticMicThreshold,
|
||||||
} = useMicThreshold();
|
} = useDevice();
|
||||||
const [ui_threshold, setUiThreshold] = useState(currentMicThreshold.data);
|
const [ui_threshold, setUiThreshold] = useState(currentMicThreshold.data);
|
||||||
const {
|
const {
|
||||||
volumeCheckStart_Mic,
|
volumeCheckStart_Mic,
|
||||||
@@ -84,7 +83,7 @@ const SpeakerComponent = (props) => {
|
|||||||
currentSpeakerThreshold,
|
currentSpeakerThreshold,
|
||||||
setSpeakerThreshold,
|
setSpeakerThreshold,
|
||||||
currentEnableAutomaticSpeakerThreshold,
|
currentEnableAutomaticSpeakerThreshold,
|
||||||
} = useSpeakerThreshold();
|
} = useDevice();
|
||||||
const [ui_threshold, setUiThreshold] = useState(currentSpeakerThreshold.data);
|
const [ui_threshold, setUiThreshold] = useState(currentSpeakerThreshold.data);
|
||||||
const {
|
const {
|
||||||
volumeCheckStart_Speaker,
|
volumeCheckStart_Speaker,
|
||||||
|
|||||||
+3
-4
@@ -4,8 +4,7 @@ import {
|
|||||||
useStore_SpeakerVolume,
|
useStore_SpeakerVolume,
|
||||||
} from "@store";
|
} from "@store";
|
||||||
import {
|
import {
|
||||||
useMicThreshold,
|
useDevice,
|
||||||
useSpeakerThreshold,
|
|
||||||
} from "@logics_configs";
|
} from "@logics_configs";
|
||||||
|
|
||||||
export const SliderAndMeter = (props) => {
|
export const SliderAndMeter = (props) => {
|
||||||
@@ -24,7 +23,7 @@ export const SliderAndMeter = (props) => {
|
|||||||
const ThresholdVolumeMeter_Mic = (props) => {
|
const ThresholdVolumeMeter_Mic = (props) => {
|
||||||
const { currentMicVolume } = useStore_MicVolume();
|
const { currentMicVolume } = useStore_MicVolume();
|
||||||
|
|
||||||
const { currentEnableAutomaticMicThreshold } = useMicThreshold();
|
const { currentEnableAutomaticMicThreshold } = useDevice();
|
||||||
|
|
||||||
const currentVolumeVariable = Math.min(currentMicVolume.data, props.max);
|
const currentVolumeVariable = Math.min(currentMicVolume.data, props.max);
|
||||||
const volume_width_percentage = (currentVolumeVariable / props.max) * 100;
|
const volume_width_percentage = (currentVolumeVariable / props.max) * 100;
|
||||||
@@ -50,7 +49,7 @@ const ThresholdVolumeMeter_Mic = (props) => {
|
|||||||
const ThresholdVolumeMeter_Speaker = (props) => {
|
const ThresholdVolumeMeter_Speaker = (props) => {
|
||||||
const { currentSpeakerVolume } = useStore_SpeakerVolume();
|
const { currentSpeakerVolume } = useStore_SpeakerVolume();
|
||||||
|
|
||||||
const { currentEnableAutomaticSpeakerThreshold } = useSpeakerThreshold();
|
const { currentEnableAutomaticSpeakerThreshold } = useDevice();
|
||||||
|
|
||||||
const currentVolumeVariable = Math.min(currentSpeakerVolume.data, props.max);
|
const currentVolumeVariable = Math.min(currentSpeakerVolume.data, props.max);
|
||||||
const volume_width_percentage = (currentVolumeVariable / props.max) * 100;
|
const volume_width_percentage = (currentVolumeVariable / props.max) * 100;
|
||||||
|
|||||||
@@ -4,16 +4,7 @@ import clsx from "clsx";
|
|||||||
import { useStore_IsBreakPoint } from "@store";
|
import { useStore_IsBreakPoint } from "@store";
|
||||||
import { ui_configs } from "@ui_configs";
|
import { ui_configs } from "@ui_configs";
|
||||||
import {
|
import {
|
||||||
useEnableAutoMicSelect,
|
useDevice,
|
||||||
useMicHostList,
|
|
||||||
useSelectedMicHost,
|
|
||||||
useMicDeviceList,
|
|
||||||
useSelectedMicDevice,
|
|
||||||
useMicThreshold,
|
|
||||||
useEnableAutoSpeakerSelect,
|
|
||||||
useSpeakerDeviceList,
|
|
||||||
useSelectedSpeakerDevice,
|
|
||||||
useSpeakerThreshold,
|
|
||||||
} from "@logics_configs";
|
} from "@logics_configs";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -38,13 +29,21 @@ export const Device = () => {
|
|||||||
|
|
||||||
const Mic_Container = () => {
|
const Mic_Container = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { currentEnableAutoMicSelect, toggleEnableAutoMicSelect } = useEnableAutoMicSelect();
|
const {
|
||||||
const { currentSelectedMicHost, setSelectedMicHost } = useSelectedMicHost();
|
currentEnableAutoMicSelect,
|
||||||
const { currentMicHostList } = useMicHostList();
|
toggleEnableAutoMicSelect,
|
||||||
const { currentSelectedMicDevice, setSelectedMicDevice } = useSelectedMicDevice();
|
currentMicDeviceList,
|
||||||
const { currentMicDeviceList } = useMicDeviceList();
|
currentMicHostList,
|
||||||
|
|
||||||
|
currentSelectedMicHost,
|
||||||
|
setSelectedMicHost,
|
||||||
|
currentSelectedMicDevice,
|
||||||
|
setSelectedMicDevice,
|
||||||
|
|
||||||
|
currentEnableAutomaticMicThreshold,
|
||||||
|
toggleEnableAutomaticMicThreshold,
|
||||||
|
} = useDevice();
|
||||||
const { onMouseLeaveFunction } = useOnMouseLeaveDropdownMenu();
|
const { onMouseLeaveFunction } = useOnMouseLeaveDropdownMenu();
|
||||||
const { currentEnableAutomaticMicThreshold, toggleEnableAutomaticMicThreshold } = useMicThreshold();
|
|
||||||
|
|
||||||
const selectFunction_host = (selected_data) => {
|
const selectFunction_host = (selected_data) => {
|
||||||
setSelectedMicHost(selected_data.selected_id);
|
setSelectedMicHost(selected_data.selected_id);
|
||||||
@@ -139,11 +138,16 @@ const Mic_Container = () => {
|
|||||||
|
|
||||||
const Speaker_Container = () => {
|
const Speaker_Container = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { currentEnableAutoSpeakerSelect, toggleEnableAutoSpeakerSelect } = useEnableAutoSpeakerSelect();
|
const {
|
||||||
const { currentSelectedSpeakerDevice, setSelectedSpeakerDevice } = useSelectedSpeakerDevice();
|
currentEnableAutoSpeakerSelect,
|
||||||
const { currentSpeakerDeviceList } = useSpeakerDeviceList();
|
toggleEnableAutoSpeakerSelect,
|
||||||
|
currentSpeakerDeviceList,
|
||||||
|
currentSelectedSpeakerDevice,
|
||||||
|
setSelectedSpeakerDevice,
|
||||||
|
currentEnableAutomaticSpeakerThreshold,
|
||||||
|
toggleEnableAutomaticSpeakerThreshold,
|
||||||
|
} = useDevice();
|
||||||
const { onMouseLeaveFunction } = useOnMouseLeaveDropdownMenu();
|
const { onMouseLeaveFunction } = useOnMouseLeaveDropdownMenu();
|
||||||
const { currentEnableAutomaticSpeakerThreshold, toggleEnableAutomaticSpeakerThreshold } = useSpeakerThreshold();
|
|
||||||
|
|
||||||
const selectFunction = (selected_data) => {
|
const selectFunction = (selected_data) => {
|
||||||
setSelectedSpeakerDevice(selected_data.selected_id);
|
setSelectedSpeakerDevice(selected_data.selected_id);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useEffect, useRef, useState, useCallback } from "react";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { usePlugins } from "@logics_configs";
|
import { usePlugins } from "@logics_configs";
|
||||||
import styles from "./Plugins.module.scss";
|
import styles from "./Plugins.module.scss";
|
||||||
import { PluginsControlComponent } from "../_components/plugins_control_component/PluginsControlComponent";
|
import { PluginsControlComponent } from "./plugins_control_component/PluginsControlComponent";
|
||||||
import { useNotificationStatus } from "@logics_common";
|
import { useNotificationStatus } from "@logics_common";
|
||||||
import ExternalLink from "@images/external_link.svg?react";
|
import ExternalLink from "@images/external_link.svg?react";
|
||||||
|
|
||||||
|
|||||||
+2
-3
@@ -1,6 +1,5 @@
|
|||||||
import React from "react";
|
import { SwitchBox } from "../../_components";
|
||||||
import { SwitchBox } from "../index";
|
import { _DownloadButton } from "../../_components/_atoms/_download_button/_DownloadButton";
|
||||||
import { _DownloadButton } from "../_atoms/_download_button/_DownloadButton";
|
|
||||||
import styles from "./PluginsControlComponent.module.scss";
|
import styles from "./PluginsControlComponent.module.scss";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
File renamed without changes.
@@ -1,12 +1,12 @@
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
import { useSelectableLanguageList } from "@logics_main";
|
import { useLanguageSettings } from "@logics_main";
|
||||||
import styles from "./LanguageSelector.module.scss";
|
import styles from "./LanguageSelector.module.scss";
|
||||||
|
|
||||||
import { LanguageSelectorTopBar } from "./language_selector_top_bar/LanguageSelectorTopBar";
|
import { LanguageSelectorTopBar } from "./language_selector_top_bar/LanguageSelectorTopBar";
|
||||||
export const LanguageSelector = ({ title, onClickFunction }) => {
|
export const LanguageSelector = ({ title, onClickFunction }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { currentSelectableLanguageList } = useSelectableLanguageList();
|
const { currentSelectableLanguageList } = useLanguageSettings();
|
||||||
|
|
||||||
const groupLanguagesByFirstLetter = (languages) => {
|
const groupLanguagesByFirstLetter = (languages) => {
|
||||||
return languages.reduce((acc, { language, country }) => {
|
return languages.reduce((acc, { language, country }) => {
|
||||||
|
|||||||
+2
-2
@@ -10,7 +10,7 @@ import { useLanguageSettings } from "@logics_main";
|
|||||||
export const LanguageSwapButton = () => {
|
export const LanguageSwapButton = () => {
|
||||||
const [isHovered, setIsHovered] = useState(false);
|
const [isHovered, setIsHovered] = useState(false);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { runLanguageSwap } = useLanguageSettings();
|
const { swapSelectedLanguages } = useLanguageSettings();
|
||||||
|
|
||||||
const label = isHovered
|
const label = isHovered
|
||||||
? t("main_page.swap_button_label")
|
? t("main_page.swap_button_label")
|
||||||
@@ -29,7 +29,7 @@ export const LanguageSwapButton = () => {
|
|||||||
className={styles.swap_button_wrapper}
|
className={styles.swap_button_wrapper}
|
||||||
onMouseEnter={handleMouseEnter}
|
onMouseEnter={handleMouseEnter}
|
||||||
onMouseLeave={handleMouseLeave}
|
onMouseLeave={handleMouseLeave}
|
||||||
onClick={runLanguageSwap}
|
onClick={swapSelectedLanguages}
|
||||||
>
|
>
|
||||||
<NarrowArrowDownSvg className={clsx(styles.narrow_arrow_down_svg, styles.reverse)} />
|
<NarrowArrowDownSvg className={clsx(styles.narrow_arrow_down_svg, styles.reverse)} />
|
||||||
<p className={labelClassName}>{label}</p>
|
<p className={labelClassName}>{label}</p>
|
||||||
|
|||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,6 @@
|
|||||||
|
export { WindowTitleBar } from "./window_title_bar/WindowTitleBar.jsx";
|
||||||
|
export { SplashComponent } from "./splash_component/SplashComponent.jsx";
|
||||||
|
export { UpdatingComponent } from "./updating_component/UpdatingComponent.jsx";
|
||||||
|
export { ModalController } from "./modal_controller/ModalController.jsx";
|
||||||
|
export { SnackbarController } from "./snackbar_controller/SnackbarController.jsx";
|
||||||
|
export { AppErrorBoundary } from "./error_boundary/AppErrorBoundary.jsx";
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import styles from "./SplashComponent.module.scss";
|
import styles from "./SplashComponent.module.scss";
|
||||||
import { StartUpProgressContainer } from "./start_up_progress_container/StartUpProgressContainer/";
|
import { StartUpProgressContainer } from "./start_up_progress_container/StartUpProgressContainer";
|
||||||
import { DownloadModelsContainer } from "./download_models_container/DownloadModelsContainer/";
|
import { DownloadModelsContainer } from "./download_models_container/DownloadModelsContainer";
|
||||||
import MegaphoneSvg from "@images/megaphone.svg?react";
|
import MegaphoneSvg from "@images/megaphone.svg?react";
|
||||||
import XMarkSvg from "@images/cancel.svg?react";
|
import XMarkSvg from "@images/cancel.svg?react";
|
||||||
import { useWindow } from "@logics_common";
|
import { useWindow } from "@logics_common";
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -7,7 +7,10 @@ export const useHandleOscQuery = () => {
|
|||||||
const { showNotification_Warning } = useNotificationStatus();
|
const { showNotification_Warning } = useNotificationStatus();
|
||||||
const { updateEnableVrcMicMuteSync } = useEnableVrcMicMuteSync();
|
const { updateEnableVrcMicMuteSync } = useEnableVrcMicMuteSync();
|
||||||
|
|
||||||
const handleOscQuery = ({ is_osc_query_enabled, disabled_functions }) => {
|
const handleOscQuery = (payload) => {
|
||||||
|
const is_osc_query_enabled = payload.data;
|
||||||
|
const disabled_functions = payload.disabled_functions;
|
||||||
|
|
||||||
if (is_osc_query_enabled) {
|
if (is_osc_query_enabled) {
|
||||||
updateEnableVrcMicMuteSync(prev => ({
|
updateEnableVrcMicMuteSync(prev => ({
|
||||||
...prev.data,
|
...prev.data,
|
||||||
|
|||||||
@@ -1,10 +1,21 @@
|
|||||||
import { useStore_IsVrctAvailable } from "@store";
|
import { useStore_IsVrctAvailable } from "@store";
|
||||||
|
import { useNotificationStatus } from "@logics_common";
|
||||||
|
|
||||||
export const useIsVrctAvailable = () => {
|
export const useIsVrctAvailable = () => {
|
||||||
const { currentIsVrctAvailable, updateIsVrctAvailable } = useStore_IsVrctAvailable();
|
const { currentIsVrctAvailable, updateIsVrctAvailable } = useStore_IsVrctAvailable();
|
||||||
|
const { showNotification_Success, showNotification_Error } = useNotificationStatus();
|
||||||
|
|
||||||
|
const handleAiModelsAvailability = (is_ai_models_available) => {
|
||||||
|
if (is_ai_models_available === false) {
|
||||||
|
updateIsVrctAvailable(false);
|
||||||
|
showNotification_Error("AI models have not been detected. Check the network connection and restart VRCT (it will download automatically, normally).", { hide_duration: null });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
currentIsVrctAvailable,
|
currentIsVrctAvailable,
|
||||||
updateIsVrctAvailable,
|
updateIsVrctAvailable,
|
||||||
|
|
||||||
|
handleAiModelsAvailability,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
useStore_MessageInputValue,
|
useStore_MessageInputValue,
|
||||||
} from "@store";
|
} from "@store";
|
||||||
|
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useMessage = () => {
|
export const useMessage = () => {
|
||||||
const { currentMessageLogs, addMessageLogs, updateMessageLogs } = useStore_MessageLogs();
|
const { currentMessageLogs, addMessageLogs, updateMessageLogs } = useStore_MessageLogs();
|
||||||
@@ -42,6 +42,9 @@ export const useMessage = () => {
|
|||||||
messages: {message: message},
|
messages: {message: message},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
const addSystemMessageLog_FromBackend = (payload) => {
|
||||||
|
addSystemMessageLog(payload.message);
|
||||||
|
};
|
||||||
|
|
||||||
const updateSentMessageLogById = (payload) => {
|
const updateSentMessageLogById = (payload) => {
|
||||||
updateMessageLogs(updateItemById(payload.id, payload.translation));
|
updateMessageLogs(updateItemById(payload.id, payload.translation));
|
||||||
@@ -66,6 +69,7 @@ export const useMessage = () => {
|
|||||||
currentMessageLogs,
|
currentMessageLogs,
|
||||||
sendMessage,
|
sendMessage,
|
||||||
addSystemMessageLog,
|
addSystemMessageLog,
|
||||||
|
addSystemMessageLog_FromBackend,
|
||||||
updateSentMessageLogById,
|
updateSentMessageLogById,
|
||||||
addSentMessageLog,
|
addSentMessageLog,
|
||||||
addReceivedMessageLog,
|
addReceivedMessageLog,
|
||||||
|
|||||||
@@ -1,17 +1,27 @@
|
|||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useOpenFolder = () => {
|
export const useOpenFolder = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|
||||||
const openFolder_MessageLogs = () => {
|
const openFolder_MessageLogs = () => {
|
||||||
asyncStdoutToPython("/run/open_filepath_logs");
|
asyncStdoutToPython("/run/open_filepath_logs");
|
||||||
};
|
};
|
||||||
|
const openedFolder_MessageLogs = () => {
|
||||||
|
console.log("Opened Directory, Message Logs");
|
||||||
|
};
|
||||||
|
|
||||||
const openFolder_ConfigFile = () => {
|
const openFolder_ConfigFile = () => {
|
||||||
asyncStdoutToPython("/run/open_filepath_config_file");
|
asyncStdoutToPython("/run/open_filepath_config_file");
|
||||||
};
|
};
|
||||||
|
const openedFolder_ConfigFile = () => {
|
||||||
|
console.log("Opened Directory, Config File");
|
||||||
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
openFolder_MessageLogs,
|
openFolder_MessageLogs,
|
||||||
openFolder_ConfigFile,
|
openFolder_ConfigFile,
|
||||||
|
|
||||||
|
openedFolder_MessageLogs,
|
||||||
|
openedFolder_ConfigFile,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import semver from "semver";
|
import semver from "semver";
|
||||||
|
|
||||||
import { useStore_SoftwareVersion, useStore_LatestSoftwareVersionInfo } from "@store";
|
import { useStore_SoftwareVersion, useStore_LatestSoftwareVersionInfo } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useSoftwareVersion = () => {
|
export const useSoftwareVersion = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
@@ -13,6 +13,13 @@ export const useSoftwareVersion = () => {
|
|||||||
asyncStdoutToPython("/get/data/version");
|
asyncStdoutToPython("/get/data/version");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const updateSoftwareVersionInfo = (payload) => {
|
||||||
|
updateLatestSoftwareVersionInfo(prev => ({
|
||||||
|
is_update_available: payload.is_update_available,
|
||||||
|
new_version: payload.new_version || prev.data.new_version,
|
||||||
|
}));
|
||||||
|
};
|
||||||
|
|
||||||
const isPluginCompatible = (main_version, lower_version, upper_version) => {
|
const isPluginCompatible = (main_version, lower_version, upper_version) => {
|
||||||
// lower_version 以上かつ upper_version 以下なら互換性ありと判定
|
// lower_version 以上かつ upper_version 以下なら互換性ありと判定
|
||||||
return semver.gte(main_version, lower_version) && semver.lte(main_version, upper_version);
|
return semver.gte(main_version, lower_version) && semver.lte(main_version, upper_version);
|
||||||
@@ -32,6 +39,7 @@ export const useSoftwareVersion = () => {
|
|||||||
getSoftwareVersion,
|
getSoftwareVersion,
|
||||||
updateSoftwareVersion,
|
updateSoftwareVersion,
|
||||||
|
|
||||||
|
updateSoftwareVersionInfo,
|
||||||
currentLatestSoftwareVersionInfo,
|
currentLatestSoftwareVersionInfo,
|
||||||
updateLatestSoftwareVersionInfo,
|
updateLatestSoftwareVersionInfo,
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useUpdateSoftware = () => {
|
export const useUpdateSoftware = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
useStore_SpeakerThresholdCheckStatus,
|
useStore_SpeakerThresholdCheckStatus,
|
||||||
} from "@store";
|
} from "@store";
|
||||||
|
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useVolume = () => {
|
export const useVolume = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useEffect, useRef } from "react";
|
import { useEffect, useRef } from "react";
|
||||||
import { currentMonitor, availableMonitors, PhysicalPosition, PhysicalSize } from "@tauri-apps/api/window";
|
import { currentMonitor, availableMonitors, PhysicalPosition, PhysicalSize } from "@tauri-apps/api/window";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
import { useStore_IsBreakPoint } from "@store";
|
import { useStore_IsBreakPoint } from "@store";
|
||||||
import { useUiScaling } from "@logics_configs";
|
import { useUiScaling } from "@logics_configs";
|
||||||
import { store } from "@store";
|
import { store } from "@store";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_OscIpAddress } from "@store";
|
import { useStore_OscIpAddress } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useOscIpAddress = () => {
|
export const useOscIpAddress = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_OscPort } from "@store";
|
import { useStore_OscPort } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
import { useNotificationStatus } from "@logics_common";
|
import { useNotificationStatus } from "@logics_common";
|
||||||
|
|
||||||
export const useOscPort = () => {
|
export const useOscPort = () => {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
useStore_WebsocketHost,
|
useStore_WebsocketHost,
|
||||||
useStore_WebsocketPort,
|
useStore_WebsocketPort,
|
||||||
} from "@store";
|
} from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useWebsocket = () => {
|
export const useWebsocket = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_MessageLogUiScaling } from "@store";
|
import { useStore_MessageLogUiScaling } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useMessageLogUiScaling = () => {
|
export const useMessageLogUiScaling = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// import { useStore_RestoreWindowGeometry } from "@store";
|
// import { useStore_RestoreWindowGeometry } from "@store";
|
||||||
// import { useStdoutToPython } from "@logics/useStdoutToPython";
|
// import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
// export const useRestoreWindowGeometry = () => {
|
// export const useRestoreWindowGeometry = () => {
|
||||||
// const { asyncStdoutToPython } = useStdoutToPython();
|
// const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_SelectedFontFamily } from "@store";
|
import { useStore_SelectedFontFamily } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useSelectedFontFamily = () => {
|
export const useSelectedFontFamily = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_SendMessageButtonType } from "@store";
|
import { useStore_SendMessageButtonType } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useSendMessageButtonType = () => {
|
export const useSendMessageButtonType = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_Transparency } from "@store";
|
import { useStore_Transparency } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useTransparency = () => {
|
export const useTransparency = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_UiLanguage } from "@store";
|
import { useStore_UiLanguage } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useUiLanguage = () => {
|
export const useUiLanguage = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_UiScaling } from "@store";
|
import { useStore_UiScaling } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useUiScaling = () => {
|
export const useUiScaling = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -0,0 +1,257 @@
|
|||||||
|
import {
|
||||||
|
useStore_EnableAutoMicSelect,
|
||||||
|
useStore_EnableAutoSpeakerSelect,
|
||||||
|
|
||||||
|
useStore_MicDeviceList,
|
||||||
|
useStore_MicHostList,
|
||||||
|
useStore_SpeakerDeviceList,
|
||||||
|
|
||||||
|
useStore_SelectedMicHost,
|
||||||
|
useStore_SelectedMicDevice,
|
||||||
|
|
||||||
|
useStore_SelectedSpeakerDevice,
|
||||||
|
|
||||||
|
useStore_MicThreshold,
|
||||||
|
useStore_EnableAutomaticMicThreshold,
|
||||||
|
useStore_SpeakerThreshold,
|
||||||
|
useStore_EnableAutomaticSpeakerThreshold,
|
||||||
|
} from "@store";
|
||||||
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
import { arrayToObject } from "@utils";
|
||||||
|
|
||||||
|
export const useDevice = () => {
|
||||||
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|
||||||
|
const { currentEnableAutoMicSelect, updateEnableAutoMicSelect, pendingEnableAutoMicSelect } = useStore_EnableAutoMicSelect();
|
||||||
|
const { currentEnableAutoSpeakerSelect, updateEnableAutoSpeakerSelect, pendingEnableAutoSpeakerSelect } = useStore_EnableAutoSpeakerSelect();
|
||||||
|
|
||||||
|
const { currentMicDeviceList, updateMicDeviceList, pendingMicDeviceList } = useStore_MicDeviceList();
|
||||||
|
const { currentMicHostList, updateMicHostList, pendingMicHostList } = useStore_MicHostList();
|
||||||
|
const { currentSpeakerDeviceList, updateSpeakerDeviceList, pendingSpeakerDeviceList } = useStore_SpeakerDeviceList();
|
||||||
|
|
||||||
|
const { currentSelectedMicHost, updateSelectedMicHost, pendingSelectedMicHost } = useStore_SelectedMicHost();
|
||||||
|
const { currentSelectedMicDevice, updateSelectedMicDevice, pendingSelectedMicDevice } = useStore_SelectedMicDevice();
|
||||||
|
|
||||||
|
const { currentSelectedSpeakerDevice, updateSelectedSpeakerDevice, pendingSelectedSpeakerDevice } = useStore_SelectedSpeakerDevice();
|
||||||
|
|
||||||
|
const { updateMicThreshold, currentMicThreshold } = useStore_MicThreshold();
|
||||||
|
const { updateEnableAutomaticMicThreshold, currentEnableAutomaticMicThreshold, pendingEnableAutomaticMicThreshold } = useStore_EnableAutomaticMicThreshold();
|
||||||
|
|
||||||
|
const { updateSpeakerThreshold, currentSpeakerThreshold } = useStore_SpeakerThreshold();
|
||||||
|
const { updateEnableAutomaticSpeakerThreshold, currentEnableAutomaticSpeakerThreshold, pendingEnableAutomaticSpeakerThreshold } = useStore_EnableAutomaticSpeakerThreshold();
|
||||||
|
|
||||||
|
// Auto Select (Mic)
|
||||||
|
const getEnableAutoMicSelect = () => {
|
||||||
|
pendingEnableAutoMicSelect();
|
||||||
|
asyncStdoutToPython("/get/data/auto_mic_select");
|
||||||
|
};
|
||||||
|
|
||||||
|
const toggleEnableAutoMicSelect = () => {
|
||||||
|
pendingEnableAutoMicSelect();
|
||||||
|
if (currentEnableAutoMicSelect.data) {
|
||||||
|
asyncStdoutToPython("/set/disable/auto_mic_select");
|
||||||
|
} else {
|
||||||
|
asyncStdoutToPython("/set/enable/auto_mic_select");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// Auto Select (Speaker)
|
||||||
|
const getEnableAutoSpeakerSelect = () => {
|
||||||
|
pendingEnableAutoSpeakerSelect();
|
||||||
|
asyncStdoutToPython("/get/data/auto_speaker_select");
|
||||||
|
};
|
||||||
|
|
||||||
|
const toggleEnableAutoSpeakerSelect = () => {
|
||||||
|
pendingEnableAutoSpeakerSelect();
|
||||||
|
if (currentEnableAutoSpeakerSelect.data) {
|
||||||
|
asyncStdoutToPython("/set/disable/auto_speaker_select");
|
||||||
|
} else {
|
||||||
|
asyncStdoutToPython("/set/enable/auto_speaker_select");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// List (Mic device)
|
||||||
|
const getMicDeviceList = () => {
|
||||||
|
pendingMicDeviceList();
|
||||||
|
asyncStdoutToPython("/get/data/mic_device_list");
|
||||||
|
};
|
||||||
|
|
||||||
|
const updateMicDeviceList_FromBackend = (payload) => {
|
||||||
|
updateMicDeviceList(arrayToObject(payload));
|
||||||
|
};
|
||||||
|
// List (Mic host)
|
||||||
|
const getMicHostList = () => {
|
||||||
|
pendingMicHostList();
|
||||||
|
asyncStdoutToPython("/get/data/mic_host_list");
|
||||||
|
};
|
||||||
|
|
||||||
|
const updateMicHostList_FromBackend = (payload) => {
|
||||||
|
updateMicHostList(arrayToObject(payload));
|
||||||
|
};
|
||||||
|
// List (Speaker device)
|
||||||
|
const getSpeakerDeviceList = () => {
|
||||||
|
pendingSpeakerDeviceList();
|
||||||
|
asyncStdoutToPython("/get/data/speaker_device_list");
|
||||||
|
};
|
||||||
|
|
||||||
|
const updateSpeakerDeviceList_FromBackend = (payload) => {
|
||||||
|
updateSpeakerDeviceList(arrayToObject(payload));
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Selected (Mic host)
|
||||||
|
const getSelectedMicHost = () => {
|
||||||
|
pendingSelectedMicHost();
|
||||||
|
asyncStdoutToPython("/get/data/selected_mic_host");
|
||||||
|
};
|
||||||
|
|
||||||
|
const setSelectedMicHost = (selected_mic_host) => {
|
||||||
|
pendingSelectedMicHost();
|
||||||
|
asyncStdoutToPython("/set/data/selected_mic_host", selected_mic_host);
|
||||||
|
};
|
||||||
|
// Selected (Mic device)
|
||||||
|
const getSelectedMicDevice = () => {
|
||||||
|
pendingSelectedMicDevice();
|
||||||
|
asyncStdoutToPython("/get/data/selected_mic_device");
|
||||||
|
};
|
||||||
|
|
||||||
|
const setSelectedMicDevice = (selected_mic_device) => {
|
||||||
|
pendingSelectedMicDevice();
|
||||||
|
asyncStdoutToPython("/set/data/selected_mic_device", selected_mic_device);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Selected (Mic and Host)
|
||||||
|
const updateSelectedMicHostAndDevice = (payload) => {
|
||||||
|
updateSelectedMicHost(payload.host);
|
||||||
|
updateSelectedMicDevice(payload.device);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Selected (Speaker device)
|
||||||
|
const getSelectedSpeakerDevice = () => {
|
||||||
|
pendingSelectedSpeakerDevice();
|
||||||
|
asyncStdoutToPython("/get/data/selected_speaker_device");
|
||||||
|
};
|
||||||
|
|
||||||
|
const setSelectedSpeakerDevice = (selected_speaker_device) => {
|
||||||
|
pendingSelectedSpeakerDevice();
|
||||||
|
asyncStdoutToPython("/set/data/selected_speaker_device", selected_speaker_device);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Threshold (Mic)
|
||||||
|
const getMicThreshold = () => {
|
||||||
|
asyncStdoutToPython("/get/data/mic_threshold");
|
||||||
|
};
|
||||||
|
|
||||||
|
const setMicThreshold = (mic_threshold) => {
|
||||||
|
asyncStdoutToPython("/set/data/mic_threshold", mic_threshold);
|
||||||
|
};
|
||||||
|
|
||||||
|
const getEnableAutomaticMicThreshold = () => {
|
||||||
|
pendingEnableAutomaticMicThreshold();
|
||||||
|
asyncStdoutToPython("/get/data/mic_automatic_threshold");
|
||||||
|
};
|
||||||
|
|
||||||
|
const toggleEnableAutomaticMicThreshold = () => {
|
||||||
|
pendingEnableAutomaticMicThreshold();
|
||||||
|
if (currentEnableAutomaticMicThreshold.data) {
|
||||||
|
asyncStdoutToPython("/set/disable/mic_automatic_threshold");
|
||||||
|
} else {
|
||||||
|
asyncStdoutToPython("/set/enable/mic_automatic_threshold");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// Threshold (Speaker)
|
||||||
|
const getSpeakerThreshold = () => {
|
||||||
|
asyncStdoutToPython("/get/data/speaker_threshold");
|
||||||
|
};
|
||||||
|
|
||||||
|
const setSpeakerThreshold = (speaker_threshold) => {
|
||||||
|
asyncStdoutToPython("/set/data/speaker_threshold", speaker_threshold);
|
||||||
|
};
|
||||||
|
|
||||||
|
const getEnableAutomaticSpeakerThreshold = () => {
|
||||||
|
pendingEnableAutomaticSpeakerThreshold();
|
||||||
|
asyncStdoutToPython("/get/data/speaker_automatic_threshold");
|
||||||
|
};
|
||||||
|
|
||||||
|
const toggleEnableAutomaticSpeakerThreshold = () => {
|
||||||
|
pendingEnableAutomaticSpeakerThreshold();
|
||||||
|
if (currentEnableAutomaticSpeakerThreshold.data) {
|
||||||
|
asyncStdoutToPython("/set/disable/speaker_automatic_threshold");
|
||||||
|
} else {
|
||||||
|
asyncStdoutToPython("/set/enable/speaker_automatic_threshold");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
currentEnableAutoMicSelect,
|
||||||
|
getEnableAutoMicSelect,
|
||||||
|
updateEnableAutoMicSelect,
|
||||||
|
toggleEnableAutoMicSelect,
|
||||||
|
|
||||||
|
currentEnableAutoSpeakerSelect,
|
||||||
|
getEnableAutoSpeakerSelect,
|
||||||
|
updateEnableAutoSpeakerSelect,
|
||||||
|
toggleEnableAutoSpeakerSelect,
|
||||||
|
|
||||||
|
|
||||||
|
currentMicDeviceList,
|
||||||
|
getMicDeviceList,
|
||||||
|
updateMicDeviceList,
|
||||||
|
updateMicDeviceList_FromBackend,
|
||||||
|
|
||||||
|
currentMicHostList,
|
||||||
|
getMicHostList,
|
||||||
|
updateMicHostList,
|
||||||
|
updateMicHostList_FromBackend,
|
||||||
|
|
||||||
|
currentSpeakerDeviceList,
|
||||||
|
getSpeakerDeviceList,
|
||||||
|
updateSpeakerDeviceList,
|
||||||
|
updateSpeakerDeviceList_FromBackend,
|
||||||
|
|
||||||
|
|
||||||
|
currentSelectedMicHost,
|
||||||
|
getSelectedMicHost,
|
||||||
|
updateSelectedMicHost,
|
||||||
|
setSelectedMicHost,
|
||||||
|
|
||||||
|
currentSelectedMicDevice,
|
||||||
|
getSelectedMicDevice,
|
||||||
|
updateSelectedMicDevice,
|
||||||
|
setSelectedMicDevice,
|
||||||
|
|
||||||
|
updateSelectedMicHostAndDevice,
|
||||||
|
|
||||||
|
|
||||||
|
currentSelectedSpeakerDevice,
|
||||||
|
getSelectedSpeakerDevice,
|
||||||
|
updateSelectedSpeakerDevice,
|
||||||
|
setSelectedSpeakerDevice,
|
||||||
|
|
||||||
|
|
||||||
|
currentMicThreshold,
|
||||||
|
getMicThreshold,
|
||||||
|
setMicThreshold,
|
||||||
|
updateMicThreshold,
|
||||||
|
|
||||||
|
currentEnableAutomaticMicThreshold,
|
||||||
|
getEnableAutomaticMicThreshold,
|
||||||
|
toggleEnableAutomaticMicThreshold,
|
||||||
|
updateEnableAutomaticMicThreshold,
|
||||||
|
|
||||||
|
currentSpeakerThreshold,
|
||||||
|
getSpeakerThreshold,
|
||||||
|
setSpeakerThreshold,
|
||||||
|
updateSpeakerThreshold,
|
||||||
|
|
||||||
|
currentEnableAutomaticSpeakerThreshold,
|
||||||
|
getEnableAutomaticSpeakerThreshold,
|
||||||
|
toggleEnableAutomaticSpeakerThreshold,
|
||||||
|
updateEnableAutomaticSpeakerThreshold,
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
import { useStore_EnableAutoMicSelect } from "@store";
|
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
|
||||||
|
|
||||||
export const useEnableAutoMicSelect = () => {
|
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
|
||||||
const { currentEnableAutoMicSelect, updateEnableAutoMicSelect, pendingEnableAutoMicSelect } = useStore_EnableAutoMicSelect();
|
|
||||||
|
|
||||||
const getEnableAutoMicSelect = () => {
|
|
||||||
pendingEnableAutoMicSelect();
|
|
||||||
asyncStdoutToPython("/get/data/auto_mic_select");
|
|
||||||
};
|
|
||||||
|
|
||||||
const toggleEnableAutoMicSelect = () => {
|
|
||||||
pendingEnableAutoMicSelect();
|
|
||||||
if (currentEnableAutoMicSelect.data) {
|
|
||||||
asyncStdoutToPython("/set/disable/auto_mic_select");
|
|
||||||
} else {
|
|
||||||
asyncStdoutToPython("/set/enable/auto_mic_select");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
|
||||||
currentEnableAutoMicSelect,
|
|
||||||
getEnableAutoMicSelect,
|
|
||||||
updateEnableAutoMicSelect,
|
|
||||||
toggleEnableAutoMicSelect,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
import { useStore_EnableAutoSpeakerSelect } from "@store";
|
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
|
||||||
|
|
||||||
export const useEnableAutoSpeakerSelect = () => {
|
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
|
||||||
const { currentEnableAutoSpeakerSelect, updateEnableAutoSpeakerSelect, pendingEnableAutoSpeakerSelect } = useStore_EnableAutoSpeakerSelect();
|
|
||||||
|
|
||||||
const getEnableAutoSpeakerSelect = () => {
|
|
||||||
pendingEnableAutoSpeakerSelect();
|
|
||||||
asyncStdoutToPython("/get/data/auto_speaker_select");
|
|
||||||
};
|
|
||||||
|
|
||||||
const toggleEnableAutoSpeakerSelect = () => {
|
|
||||||
pendingEnableAutoSpeakerSelect();
|
|
||||||
if (currentEnableAutoSpeakerSelect.data) {
|
|
||||||
asyncStdoutToPython("/set/disable/auto_speaker_select");
|
|
||||||
} else {
|
|
||||||
asyncStdoutToPython("/set/enable/auto_speaker_select");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
|
||||||
currentEnableAutoSpeakerSelect,
|
|
||||||
getEnableAutoSpeakerSelect,
|
|
||||||
updateEnableAutoSpeakerSelect,
|
|
||||||
toggleEnableAutoSpeakerSelect,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
import { useStore_MicDeviceList } from "@store";
|
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
|
||||||
|
|
||||||
export const useMicDeviceList = () => {
|
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
|
||||||
const { currentMicDeviceList, updateMicDeviceList, pendingMicDeviceList } = useStore_MicDeviceList();
|
|
||||||
|
|
||||||
const getMicDeviceList = () => {
|
|
||||||
pendingMicDeviceList();
|
|
||||||
asyncStdoutToPython("/get/data/mic_device_list");
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
|
||||||
currentMicDeviceList,
|
|
||||||
getMicDeviceList,
|
|
||||||
updateMicDeviceList,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
import { useStore_MicHostList } from "@store";
|
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
|
||||||
|
|
||||||
export const useMicHostList = () => {
|
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
|
||||||
const { currentMicHostList, updateMicHostList, pendingMicHostList } = useStore_MicHostList();
|
|
||||||
|
|
||||||
const getMicHostList = () => {
|
|
||||||
pendingMicHostList();
|
|
||||||
asyncStdoutToPython("/get/data/mic_host_list");
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
|
||||||
currentMicHostList,
|
|
||||||
getMicHostList,
|
|
||||||
updateMicHostList,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
import { useStore_MicThreshold, useStore_EnableAutomaticMicThreshold } from "@store";
|
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
|
||||||
|
|
||||||
export const useMicThreshold = () => {
|
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
|
||||||
const { updateMicThreshold, currentMicThreshold } = useStore_MicThreshold();
|
|
||||||
const { updateEnableAutomaticMicThreshold, currentEnableAutomaticMicThreshold, pendingEnableAutomaticMicThreshold } = useStore_EnableAutomaticMicThreshold();
|
|
||||||
|
|
||||||
const getMicThreshold = () => {
|
|
||||||
asyncStdoutToPython("/get/data/mic_threshold");
|
|
||||||
};
|
|
||||||
|
|
||||||
const setMicThreshold = (mic_threshold) => {
|
|
||||||
asyncStdoutToPython("/set/data/mic_threshold", mic_threshold);
|
|
||||||
};
|
|
||||||
|
|
||||||
const getEnableAutomaticMicThreshold = () => {
|
|
||||||
pendingEnableAutomaticMicThreshold();
|
|
||||||
asyncStdoutToPython("/get/data/mic_automatic_threshold");
|
|
||||||
};
|
|
||||||
|
|
||||||
const toggleEnableAutomaticMicThreshold = () => {
|
|
||||||
pendingEnableAutomaticMicThreshold();
|
|
||||||
if (currentEnableAutomaticMicThreshold.data) {
|
|
||||||
asyncStdoutToPython("/set/disable/mic_automatic_threshold");
|
|
||||||
} else {
|
|
||||||
asyncStdoutToPython("/set/enable/mic_automatic_threshold");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
|
||||||
currentMicThreshold,
|
|
||||||
getMicThreshold,
|
|
||||||
setMicThreshold,
|
|
||||||
updateMicThreshold,
|
|
||||||
|
|
||||||
currentEnableAutomaticMicThreshold,
|
|
||||||
getEnableAutomaticMicThreshold,
|
|
||||||
toggleEnableAutomaticMicThreshold,
|
|
||||||
updateEnableAutomaticMicThreshold,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
import { useStore_SelectedMicDevice } from "@store";
|
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
|
||||||
|
|
||||||
export const useSelectedMicDevice = () => {
|
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
|
||||||
const { currentSelectedMicDevice, updateSelectedMicDevice, pendingSelectedMicDevice } = useStore_SelectedMicDevice();
|
|
||||||
|
|
||||||
const getSelectedMicDevice = () => {
|
|
||||||
pendingSelectedMicDevice();
|
|
||||||
asyncStdoutToPython("/get/data/selected_mic_device");
|
|
||||||
};
|
|
||||||
|
|
||||||
const setSelectedMicDevice = (selected_mic_device) => {
|
|
||||||
pendingSelectedMicDevice();
|
|
||||||
asyncStdoutToPython("/set/data/selected_mic_device", selected_mic_device);
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
|
||||||
currentSelectedMicDevice,
|
|
||||||
getSelectedMicDevice,
|
|
||||||
updateSelectedMicDevice,
|
|
||||||
setSelectedMicDevice,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
import { useStore_SelectedMicHost } from "@store";
|
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
|
||||||
|
|
||||||
export const useSelectedMicHost = () => {
|
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
|
||||||
const { currentSelectedMicHost, updateSelectedMicHost, pendingSelectedMicHost } = useStore_SelectedMicHost();
|
|
||||||
|
|
||||||
const getSelectedMicHost = () => {
|
|
||||||
pendingSelectedMicHost();
|
|
||||||
asyncStdoutToPython("/get/data/selected_mic_host");
|
|
||||||
};
|
|
||||||
|
|
||||||
const setSelectedMicHost = (selected_mic_host) => {
|
|
||||||
pendingSelectedMicHost();
|
|
||||||
asyncStdoutToPython("/set/data/selected_mic_host", selected_mic_host);
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
|
||||||
currentSelectedMicHost,
|
|
||||||
getSelectedMicHost,
|
|
||||||
updateSelectedMicHost,
|
|
||||||
setSelectedMicHost,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
import { useStore_SelectedSpeakerDevice } from "@store";
|
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
|
||||||
|
|
||||||
export const useSelectedSpeakerDevice = () => {
|
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
|
||||||
const { currentSelectedSpeakerDevice, updateSelectedSpeakerDevice, pendingSelectedSpeakerDevice } = useStore_SelectedSpeakerDevice();
|
|
||||||
|
|
||||||
const getSelectedSpeakerDevice = () => {
|
|
||||||
pendingSelectedSpeakerDevice();
|
|
||||||
asyncStdoutToPython("/get/data/selected_speaker_device");
|
|
||||||
};
|
|
||||||
|
|
||||||
const setSelectedSpeakerDevice = (selected_speaker_device) => {
|
|
||||||
pendingSelectedSpeakerDevice();
|
|
||||||
asyncStdoutToPython("/set/data/selected_speaker_device", selected_speaker_device);
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
|
||||||
currentSelectedSpeakerDevice,
|
|
||||||
getSelectedSpeakerDevice,
|
|
||||||
updateSelectedSpeakerDevice,
|
|
||||||
setSelectedSpeakerDevice,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
import { useStore_SpeakerDeviceList } from "@store";
|
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
|
||||||
|
|
||||||
export const useSpeakerDeviceList = () => {
|
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
|
||||||
const { currentSpeakerDeviceList, updateSpeakerDeviceList, pendingSpeakerDeviceList } = useStore_SpeakerDeviceList();
|
|
||||||
|
|
||||||
const getSpeakerDeviceList = () => {
|
|
||||||
pendingSpeakerDeviceList();
|
|
||||||
asyncStdoutToPython("/get/data/speaker_device_list");
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
|
||||||
currentSpeakerDeviceList,
|
|
||||||
getSpeakerDeviceList,
|
|
||||||
updateSpeakerDeviceList,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
import { useStore_SpeakerThreshold, useStore_EnableAutomaticSpeakerThreshold } from "@store";
|
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
|
||||||
|
|
||||||
export const useSpeakerThreshold = () => {
|
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
|
||||||
const { updateSpeakerThreshold, currentSpeakerThreshold } = useStore_SpeakerThreshold();
|
|
||||||
const { updateEnableAutomaticSpeakerThreshold, currentEnableAutomaticSpeakerThreshold, pendingEnableAutomaticSpeakerThreshold } = useStore_EnableAutomaticSpeakerThreshold();
|
|
||||||
|
|
||||||
const getSpeakerThreshold = () => {
|
|
||||||
asyncStdoutToPython("/get/data/speaker_threshold");
|
|
||||||
};
|
|
||||||
|
|
||||||
const setSpeakerThreshold = (speaker_threshold) => {
|
|
||||||
asyncStdoutToPython("/set/data/speaker_threshold", speaker_threshold);
|
|
||||||
};
|
|
||||||
|
|
||||||
const getEnableAutomaticSpeakerThreshold = () => {
|
|
||||||
pendingEnableAutomaticSpeakerThreshold();
|
|
||||||
asyncStdoutToPython("/get/data/speaker_automatic_threshold");
|
|
||||||
};
|
|
||||||
|
|
||||||
const toggleEnableAutomaticSpeakerThreshold = () => {
|
|
||||||
pendingEnableAutomaticSpeakerThreshold();
|
|
||||||
if (currentEnableAutomaticSpeakerThreshold.data) {
|
|
||||||
asyncStdoutToPython("/set/disable/speaker_automatic_threshold");
|
|
||||||
} else {
|
|
||||||
asyncStdoutToPython("/set/enable/speaker_automatic_threshold");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
|
||||||
currentSpeakerThreshold,
|
|
||||||
getSpeakerThreshold,
|
|
||||||
setSpeakerThreshold,
|
|
||||||
updateSpeakerThreshold,
|
|
||||||
|
|
||||||
currentEnableAutomaticSpeakerThreshold,
|
|
||||||
getEnableAutomaticSpeakerThreshold,
|
|
||||||
toggleEnableAutomaticSpeakerThreshold,
|
|
||||||
updateEnableAutomaticSpeakerThreshold,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { store, useStore_Hotkeys } from "@store";
|
import { store, useStore_Hotkeys } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
import { useNotificationStatus } from "@logics_common";
|
import { useNotificationStatus } from "@logics_common";
|
||||||
import { useMainFunction } from "@logics_main";
|
import { useMainFunction } from "@logics_main";
|
||||||
import { register, unregisterAll, isRegistered } from "@tauri-apps/plugin-global-shortcut";
|
import { register, unregisterAll, isRegistered } from "@tauri-apps/plugin-global-shortcut";
|
||||||
|
|||||||
@@ -1,13 +1,4 @@
|
|||||||
export { useEnableAutoMicSelect } from "./device/useEnableAutoMicSelect";
|
export { useDevice } from "./device/useDevice";
|
||||||
export { useEnableAutoSpeakerSelect } from "./device/useEnableAutoSpeakerSelect";
|
|
||||||
export { useMicDeviceList } from "./device/useMicDeviceList";
|
|
||||||
export { useMicHostList } from "./device/useMicHostList";
|
|
||||||
export { useMicThreshold } from "./device/useMicThreshold";
|
|
||||||
export { useSelectedMicDevice } from "./device/useSelectedMicDevice";
|
|
||||||
export { useSelectedMicHost } from "./device/useSelectedMicHost";
|
|
||||||
export { useSelectedSpeakerDevice } from "./device/useSelectedSpeakerDevice";
|
|
||||||
export { useSpeakerDeviceList } from "./device/useSpeakerDeviceList";
|
|
||||||
export { useSpeakerThreshold } from "./device/useSpeakerThreshold";
|
|
||||||
|
|
||||||
export { useMessageLogUiScaling } from "./appearance/useMessageLogUiScaling";
|
export { useMessageLogUiScaling } from "./appearance/useMessageLogUiScaling";
|
||||||
export { useSelectedFontFamily } from "./appearance/useSelectedFontFamily";
|
export { useSelectedFontFamily } from "./appearance/useSelectedFontFamily";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_EnableAutoClearMessageInputBox } from "@store";
|
import { useStore_EnableAutoClearMessageInputBox } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useEnableAutoClearMessageInputBox = () => {
|
export const useEnableAutoClearMessageInputBox = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_EnableAutoExportMessageLogs } from "@store";
|
import { useStore_EnableAutoExportMessageLogs } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useEnableAutoExportMessageLogs = () => {
|
export const useEnableAutoExportMessageLogs = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_EnableNotificationVrcSfx } from "@store";
|
import { useStore_EnableNotificationVrcSfx } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useEnableNotificationVrcSfx = () => {
|
export const useEnableNotificationVrcSfx = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_EnableSendMessageToVrc } from "@store";
|
import { useStore_EnableSendMessageToVrc } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useEnableSendMessageToVrc = () => {
|
export const useEnableSendMessageToVrc = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_EnableSendOnlyTranslatedMessages } from "@store";
|
import { useStore_EnableSendOnlyTranslatedMessages } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useEnableSendOnlyTranslatedMessages = () => {
|
export const useEnableSendOnlyTranslatedMessages = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_EnableSendReceivedMessageToVrc } from "@store";
|
import { useStore_EnableSendReceivedMessageToVrc } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useEnableSendReceivedMessageToVrc = () => {
|
export const useEnableSendReceivedMessageToVrc = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_EnableVrcMicMuteSync } from "@store";
|
import { useStore_EnableVrcMicMuteSync } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useEnableVrcMicMuteSync = () => {
|
export const useEnableVrcMicMuteSync = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
@@ -19,10 +19,18 @@ export const useEnableVrcMicMuteSync = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const updateEnableVrcMicMuteSync_FromBackend = (payload) => {
|
||||||
|
updateEnableVrcMicMuteSync((old_value) => {
|
||||||
|
return {...old_value.data, is_enabled: payload};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
currentEnableVrcMicMuteSync,
|
currentEnableVrcMicMuteSync,
|
||||||
getEnableVrcMicMuteSync,
|
getEnableVrcMicMuteSync,
|
||||||
toggleEnableVrcMicMuteSync,
|
toggleEnableVrcMicMuteSync,
|
||||||
updateEnableVrcMicMuteSync,
|
updateEnableVrcMicMuteSync,
|
||||||
|
|
||||||
|
updateEnableVrcMicMuteSync_FromBackend,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_SendMessageButtonType } from "@store";
|
import { useStore_SendMessageButtonType } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useSendMessageButtonType = () => {
|
export const useSendMessageButtonType = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import {
|
|||||||
useStore_FetchedPluginsInfo,
|
useStore_FetchedPluginsInfo,
|
||||||
useStore_LoadedPlugins,
|
useStore_LoadedPlugins,
|
||||||
} from "@store";
|
} from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
import { transform } from "@babel/standalone";
|
import { transform } from "@babel/standalone";
|
||||||
import { writeFile, mkdir, exists, remove, readDir, BaseDirectory, readTextFile } from "@tauri-apps/plugin-fs";
|
import { writeFile, mkdir, exists, remove, readDir, BaseDirectory, readTextFile } from "@tauri-apps/plugin-fs";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_MicMaxWords } from "@store";
|
import { useStore_MicMaxWords } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useMicMaxWords = () => {
|
export const useMicMaxWords = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_MicPhraseTimeout } from "@store";
|
import { useStore_MicPhraseTimeout } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useMicPhraseTimeout = () => {
|
export const useMicPhraseTimeout = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_MicRecordTimeout } from "@store";
|
import { useStore_MicRecordTimeout } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useMicRecordTimeout = () => {
|
export const useMicRecordTimeout = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_MicWordFilterList } from "@store";
|
import { useStore_MicWordFilterList } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useMicWordFilterList = () => {
|
export const useMicWordFilterList = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
@@ -15,10 +15,27 @@ export const useMicWordFilterList = () => {
|
|||||||
asyncStdoutToPython("/set/data/mic_word_filter", selected_mic_word_filter);
|
asyncStdoutToPython("/set/data/mic_word_filter", selected_mic_word_filter);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const updateMicWordFilterList_FromBackend = (payload) => {
|
||||||
|
updateMicWordFilterList((prev_list) => {
|
||||||
|
const updated_list = [...prev_list.data];
|
||||||
|
for (const value of payload) {
|
||||||
|
const existing_item = updated_list.find(item => item.value === value);
|
||||||
|
if (existing_item) {
|
||||||
|
existing_item.is_redoable = false;
|
||||||
|
} else {
|
||||||
|
updated_list.push({ value, is_redoable: false });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return updated_list;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
currentMicWordFilterList,
|
currentMicWordFilterList,
|
||||||
getMicWordFilterList,
|
getMicWordFilterList,
|
||||||
updateMicWordFilterList,
|
updateMicWordFilterList,
|
||||||
setMicWordFilterList,
|
setMicWordFilterList,
|
||||||
|
|
||||||
|
updateMicWordFilterList_FromBackend,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import { useStore_SelectableWhisperComputeDeviceList } from "@store";
|
import { useStore_SelectableWhisperComputeDeviceList } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
import { transformToIndexedArray } from "@utils";
|
||||||
|
|
||||||
export const useSelectableWhisperComputeDeviceList = () => {
|
export const useSelectableWhisperComputeDeviceList = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
@@ -10,9 +11,15 @@ export const useSelectableWhisperComputeDeviceList = () => {
|
|||||||
asyncStdoutToPython("/get/data/transcription_compute_device_list");
|
asyncStdoutToPython("/get/data/transcription_compute_device_list");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const updateSelectableWhisperComputeDeviceList_FromBackend = (payload) => {
|
||||||
|
updateSelectableWhisperComputeDeviceList(transformToIndexedArray(payload));
|
||||||
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
currentSelectableWhisperComputeDeviceList,
|
currentSelectableWhisperComputeDeviceList,
|
||||||
getSelectableWhisperComputeDeviceList,
|
getSelectableWhisperComputeDeviceList,
|
||||||
updateSelectableWhisperComputeDeviceList,
|
updateSelectableWhisperComputeDeviceList,
|
||||||
|
|
||||||
|
updateSelectableWhisperComputeDeviceList_FromBackend,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_SelectedTranscriptionEngine } from "@store";
|
import { useStore_SelectedTranscriptionEngine } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useSelectedTranscriptionEngine = () => {
|
export const useSelectedTranscriptionEngine = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_SelectedWhisperComputeDevice } from "@store";
|
import { useStore_SelectedWhisperComputeDevice } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useSelectedWhisperComputeDevice = () => {
|
export const useSelectedWhisperComputeDevice = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_SelectedWhisperWeightType } from "@store";
|
import { useStore_SelectedWhisperWeightType } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useSelectedWhisperWeightType = () => {
|
export const useSelectedWhisperWeightType = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_SpeakerMaxWords } from "@store";
|
import { useStore_SpeakerMaxWords } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useSpeakerMaxWords = () => {
|
export const useSpeakerMaxWords = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_SpeakerPhraseTimeout } from "@store";
|
import { useStore_SpeakerPhraseTimeout } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useSpeakerPhraseTimeout = () => {
|
export const useSpeakerPhraseTimeout = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_SpeakerRecordTimeout } from "@store";
|
import { useStore_SpeakerRecordTimeout } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useSpeakerRecordTimeout = () => {
|
export const useSpeakerRecordTimeout = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_WhisperWeightTypeStatus } from "@store";
|
import { useStore_WhisperWeightTypeStatus } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useWhisperWeightTypeStatus = () => {
|
export const useWhisperWeightTypeStatus = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_CTranslate2WeightTypeStatus } from "@store";
|
import { useStore_CTranslate2WeightTypeStatus } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useCTranslate2WeightTypeStatus = () => {
|
export const useCTranslate2WeightTypeStatus = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_DeepLAuthKey } from "@store";
|
import { useStore_DeepLAuthKey } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useNotificationStatus } from "@logics_common";
|
import { useNotificationStatus } from "@logics_common";
|
||||||
|
|
||||||
@@ -23,6 +23,9 @@ export const useDeepLAuthKey = () => {
|
|||||||
pendingDeepLAuthKey();
|
pendingDeepLAuthKey();
|
||||||
asyncStdoutToPython("/delete/data/deepl_auth_key");
|
asyncStdoutToPython("/delete/data/deepl_auth_key");
|
||||||
};
|
};
|
||||||
|
const deletedDeepLAuthKey = () => {
|
||||||
|
updateDeepLAuthKey("");
|
||||||
|
};
|
||||||
|
|
||||||
const savedDeepLAuthKey = (data) => {
|
const savedDeepLAuthKey = (data) => {
|
||||||
updateDeepLAuthKey(data);
|
updateDeepLAuthKey(data);
|
||||||
@@ -36,6 +39,7 @@ export const useDeepLAuthKey = () => {
|
|||||||
setDeepLAuthKey,
|
setDeepLAuthKey,
|
||||||
deleteDeepLAuthKey,
|
deleteDeepLAuthKey,
|
||||||
|
|
||||||
|
deletedDeepLAuthKey,
|
||||||
savedDeepLAuthKey,
|
savedDeepLAuthKey,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import { useStore_SelectableCTranslate2ComputeDeviceList } from "@store";
|
import { useStore_SelectableCTranslate2ComputeDeviceList } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
import { transformToIndexedArray } from "@utils";
|
||||||
|
|
||||||
export const useSelectableCTranslate2ComputeDeviceList = () => {
|
export const useSelectableCTranslate2ComputeDeviceList = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
@@ -10,9 +11,15 @@ export const useSelectableCTranslate2ComputeDeviceList = () => {
|
|||||||
asyncStdoutToPython("/get/data/translation_compute_device_list");
|
asyncStdoutToPython("/get/data/translation_compute_device_list");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const updateSelectableCTranslate2ComputeDeviceList_FromBackend = (payload) => {
|
||||||
|
updateSelectableCTranslate2ComputeDeviceList(transformToIndexedArray(payload));
|
||||||
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
currentSelectableCTranslate2ComputeDeviceList,
|
currentSelectableCTranslate2ComputeDeviceList,
|
||||||
getSelectableCTranslate2ComputeDeviceList,
|
getSelectableCTranslate2ComputeDeviceList,
|
||||||
updateSelectableCTranslate2ComputeDeviceList,
|
updateSelectableCTranslate2ComputeDeviceList,
|
||||||
|
|
||||||
|
updateSelectableCTranslate2ComputeDeviceList_FromBackend,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_SelectedCTranslate2ComputeDevice } from "@store";
|
import { useStore_SelectedCTranslate2ComputeDevice } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useSelectedCTranslate2ComputeDevice = () => {
|
export const useSelectedCTranslate2ComputeDevice = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_SelectedCTranslate2WeightType } from "@store";
|
import { useStore_SelectedCTranslate2WeightType } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useSelectedCTranslate2WeightType = () => {
|
export const useSelectedCTranslate2WeightType = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_IsEnabledOverlayLargeLog } from "@store";
|
import { useStore_IsEnabledOverlayLargeLog } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useIsEnabledOverlayLargeLog = () => {
|
export const useIsEnabledOverlayLargeLog = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_IsEnabledOverlaySmallLog } from "@store";
|
import { useStore_IsEnabledOverlaySmallLog } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useIsEnabledOverlaySmallLog = () => {
|
export const useIsEnabledOverlaySmallLog = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_OverlayLargeLogSettings } from "@store";
|
import { useStore_OverlayLargeLogSettings } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useOverlayLargeLogSettings = () => {
|
export const useOverlayLargeLogSettings = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_OverlayShowOnlyTranslatedMessages } from "@store";
|
import { useStore_OverlayShowOnlyTranslatedMessages } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useOverlayShowOnlyTranslatedMessages = () => {
|
export const useOverlayShowOnlyTranslatedMessages = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useStore_OverlaySmallLogSettings } from "@store";
|
import { useStore_OverlaySmallLogSettings } from "@store";
|
||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useOverlaySmallLogSettings = () => {
|
export const useOverlaySmallLogSettings = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
import { useStdoutToPython } from "@useStdoutToPython";
|
||||||
|
|
||||||
export const useSendTextToOverlay = () => {
|
export const useSendTextToOverlay = () => {
|
||||||
const { asyncStdoutToPython } = useStdoutToPython();
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
|||||||
@@ -4,4 +4,3 @@ export { useLanguageSettings } from "./useLanguageSettings";
|
|||||||
export { useMainFunction } from "./useMainFunction";
|
export { useMainFunction } from "./useMainFunction";
|
||||||
export { useMessageLogScroll } from "./useMessageLogScroll";
|
export { useMessageLogScroll } from "./useMessageLogScroll";
|
||||||
export { useMessageInputBoxRatio } from "./useMessageInputBoxRatio";
|
export { useMessageInputBoxRatio } from "./useMessageInputBoxRatio";
|
||||||
export { useSelectableLanguageList } from "./useSelectableLanguageList";
|
|
||||||
Loaded 100 of 110 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user