mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 17:38:10 +00:00
play sound on enqueue
This commit is contained in:
1 parent
45685500b5
commit
c182dd3fc0
3 files changed
+10
-3
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { SoundRegistry, SoundEffect } from "@storyteller/soundboard";
|
||||
import { Button } from "@storyteller/ui-button";
|
||||
import { Input } from "@storyteller/ui-input";
|
||||
import { AppPreferencesPayload, CustomDirectory, GetAppPreferences, SystemDirectory } from "@storyteller/tauri-api";
|
||||
@@ -42,8 +43,6 @@ export const MiscSettingsPane = (args: MiscSettingsPaneProps) => {
|
||||
const failureSound = preferences?.generation_failure_sound;
|
||||
const enqueueSound = preferences?.generation_enqueue_sound;
|
||||
|
||||
console.log("VALUES", successSound, failureSound, enqueueSound);
|
||||
|
||||
const reloadPreferences = async () => {
|
||||
const prefs = await GetAppPreferences();
|
||||
console.log("prefs", prefs)
|
||||
@@ -88,11 +87,11 @@ export const MiscSettingsPane = (args: MiscSettingsPaneProps) => {
|
||||
}
|
||||
|
||||
const setSuccessSound = async (val: string) => {
|
||||
console.log("setting success", val)
|
||||
await UpdateAppPreferences({
|
||||
preference: PreferenceName.GenerationSuccessSound,
|
||||
value: val,
|
||||
});
|
||||
SoundRegistry.getInstance().playSound(val);
|
||||
await reloadPreferences();
|
||||
}
|
||||
|
||||
@@ -101,6 +100,7 @@ export const MiscSettingsPane = (args: MiscSettingsPaneProps) => {
|
||||
preference: PreferenceName.GenerationFailureSound,
|
||||
value: val,
|
||||
});
|
||||
SoundRegistry.getInstance().playSound(val);
|
||||
await reloadPreferences();
|
||||
}
|
||||
|
||||
@@ -109,6 +109,7 @@ export const MiscSettingsPane = (args: MiscSettingsPaneProps) => {
|
||||
preference: PreferenceName.GenerationEnqueueSound,
|
||||
value: val,
|
||||
});
|
||||
SoundRegistry.getInstance().playSound(val);
|
||||
await reloadPreferences();
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
{
|
||||
"path": "../../tauri-utils"
|
||||
},
|
||||
{
|
||||
"path": "../../soundboard"
|
||||
},
|
||||
{
|
||||
"path": "./tsconfig.lib.json"
|
||||
},
|
||||
|
||||
@@ -64,5 +64,8 @@
|
||||
{
|
||||
"path": "../../tauri-utils/tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "../../soundboard/tsconfig.lib.json"
|
||||
},
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user