added dme volume

This commit is contained in:
PxlLoewe
2025-06-02 12:11:14 -07:00
parent 937ab7d5c4
commit 181930f13e
2 changed files with 19 additions and 6 deletions

View File

@@ -30,13 +30,17 @@ export const SettingsBtn = () => {
); );
const [showIndication, setShowInducation] = useState<boolean>(false); const [showIndication, setShowInducation] = useState<boolean>(false);
const [micVol, setMicVol] = useState<number>(1); const [micVol, setMicVol] = useState<number>(1);
const [dmeVolume, setDmeVol] = useState<number>(1);
const setMic = useAudioStore((state) => state.setMic); const setMic = useAudioStore((state) => state.setMic);
console.log("user", user);
useEffect(() => { useEffect(() => {
if (user?.settingsMicDevice) { if (user) {
setSelectedDevice(user.settingsMicDevice); setSelectedDevice(user.settingsMicDevice);
setMic(user.settingsMicDevice, user.settingsMicVolume || 1); setMic(user.settingsMicDevice, user.settingsMicVolume || 1);
setMicVol(user.settingsMicVolume || 1);
} }
}, [user, setMic]); }, [user, setMic]);
@@ -128,16 +132,23 @@ export const SettingsBtn = () => {
<input <input
type="range" type="range"
min={0} min={0}
max={100} max={3}
defaultValue={40} step={0.01}
onChange={(e) => {
const value = parseFloat(e.target.value);
setDmeVol(value);
// Hier kannst du den Lautstärkewert verwenden
setShowInducation(true);
console.log("Lautstärke:", value);
}}
value={dmeVolume}
className="range range-xs range-accent w-full" className="range range-xs range-accent w-full"
/> />
<div className="flex justify-between px-2.5 mt-2 text-xs"> <div className="flex justify-between px-2.5 mt-2 text-xs">
<span>0</span> <span>0</span>
<span>25</span>
<span>50</span>
<span>75</span>
<span>100</span> <span>100</span>
<span>200</span>
<span>300</span>
</div> </div>
</div> </div>
@@ -161,6 +172,7 @@ export const SettingsBtn = () => {
user: { user: {
settingsMicDevice: selectedDevice, settingsMicDevice: selectedDevice,
settingsMicVolume: micVol, settingsMicVolume: micVol,
settingsDmeVolume: dmeVolume,
}, },
}); });
setMic(selectedDevice, micVol); setMic(selectedDevice, micVol);

View File

@@ -33,6 +33,7 @@ model User {
settingsNtfyRoom String? @map(name: "settings_ntfy_room") settingsNtfyRoom String? @map(name: "settings_ntfy_room")
settingsMicDevice String? @map(name: "settings_mic_device") settingsMicDevice String? @map(name: "settings_mic_device")
settingsMicVolume Int? @map(name: "settings_mic_volume") settingsMicVolume Int? @map(name: "settings_mic_volume")
settingsDmeVolume Int? @map(name: "settings_dme_volume")
settingsHideLastname Boolean @default(false) @map(name: "settings_hide_lastname") settingsHideLastname Boolean @default(false) @map(name: "settings_hide_lastname")
// email Verification: // email Verification: