mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-21 17:41:28 -08:00
Play end of full reset sound effect when changing feedback sound volume
Closes #1916.
This commit is contained in:
2 files changed
+14
-1
No files matched your search
@@ -19,6 +19,8 @@ import { Dropdown } from '@/components/commons/Dropdown';
|
||||
import { ArrowRightLeftIcon } from '@/components/commons/icon/ArrowIcons';
|
||||
import { SystemFileInput } from '@/components/commons/SystemFileInput';
|
||||
import { useElectron } from '@/hooks/electron';
|
||||
import { handleResetSounds } from '@/sounds/sounds';
|
||||
import { ResetStatus, ResetType } from 'solarxr-protocol';
|
||||
|
||||
interface InterfaceSettingsForm {
|
||||
appearance: {
|
||||
@@ -120,6 +122,17 @@ export function InterfaceSettings() {
|
||||
];
|
||||
|
||||
const onSubmit = (values: InterfaceSettingsForm) => {
|
||||
if (
|
||||
config?.feedbackSoundVolume != values.notifications.feedbackSoundVolume
|
||||
) {
|
||||
handleResetSounds(values.notifications.feedbackSoundVolume, {
|
||||
resetType: ResetType.FULL,
|
||||
status: ResetStatus.FINISHED,
|
||||
bodyParts: [],
|
||||
progress: 0,
|
||||
duration: 0,
|
||||
});
|
||||
}
|
||||
setConfig({
|
||||
watchNewDevices: values.notifications.watchNewDevices,
|
||||
feedbackSound: values.notifications.feedbackSound,
|
||||
|
||||
@@ -112,7 +112,7 @@ export function restartAndPlay(audio: HTMLAudioElement | null, volume: number) {
|
||||
|
||||
export function handleResetSounds(
|
||||
volume: number,
|
||||
{ progress, status, resetType }: ResetResponseT
|
||||
{ progress, status, resetType }: Omit<ResetResponseT, 'pack'>
|
||||
) {
|
||||
if (!resetSounds) throw 'sounds not loaded';
|
||||
const sounds = resetSounds[resetType];
|
||||
|
||||
Reference in new issue
Block a user