[Update/WIP] Config Page: Device Tab. 音量チェックができるように(Dev)

This commit is contained in:
Sakamoto Shiina
2024-09-08 13:59:12 +09:00
parent ef5eb2fb40
commit e0d9c99075
4 changed files with 136 additions and 60 deletions

View File

@@ -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);
}