[Update/WIP] Config Page: Device Tab. 音量チェックができるように(Dev)
This commit is contained in:
@@ -28,7 +28,7 @@ export const useReceiveRoutes = () => {
|
||||
updateSelectedSpeakerDevice,
|
||||
} = useConfig();
|
||||
|
||||
const { updateVolumeVariable_Mic } = useVolume();
|
||||
const { updateVolumeVariable_Mic, updateVolumeVariable_Speaker } = useVolume();
|
||||
|
||||
const routes = {
|
||||
"/controller/callback_enable_translation": updateTranslationStatus,
|
||||
@@ -54,6 +54,7 @@ export const useReceiveRoutes = () => {
|
||||
"/controller/callback_set_speaker_device": updateSelectedSpeakerDevice,
|
||||
|
||||
"/action/check_mic_threshold_energy": updateVolumeVariable_Mic,
|
||||
"/action/check_speaker_threshold_energy": updateVolumeVariable_Speaker,
|
||||
|
||||
|
||||
"/controller/callback_messagebox_send": updateSentMessageLog,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import {
|
||||
useMicVolume,
|
||||
useSpeakerVolume,
|
||||
} from "@store";
|
||||
|
||||
import { useStdoutToPython } from "./useStdoutToPython";
|
||||
@@ -8,6 +9,7 @@ import { useStdoutToPython } from "./useStdoutToPython";
|
||||
export const useVolume = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
const { updateMicVolume } = useMicVolume();
|
||||
const { updateSpeakerVolume } = useSpeakerVolume();
|
||||
|
||||
// const asyncPending = () => new Promise(() => {});
|
||||
return {
|
||||
@@ -15,6 +17,12 @@ export const useVolume = () => {
|
||||
volumeCheckStop_Mic: () => asyncStdoutToPython("/controller/callback_disable_check_mic_threshold"),
|
||||
updateVolumeVariable_Mic: (payload) => {
|
||||
updateMicVolume(payload.data);
|
||||
},
|
||||
|
||||
volumeCheckStart_Speaker: () => asyncStdoutToPython("/controller/callback_enable_check_speaker_threshold"),
|
||||
volumeCheckStop_Speaker: () => asyncStdoutToPython("/controller/callback_disable_check_speaker_threshold"),
|
||||
updateVolumeVariable_Speaker: (payload) => {
|
||||
updateSpeakerVolume(payload.data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user