Append: Improve Volume Handling

This commit is contained in:
Neshura 2024-04-22 20:08:30 +02:00
parent a99e12c6e6
commit 652e8afc37
Signed by: Neshura
GPG key ID: B6983AAA6B9A7A6C

View file

@ -6,11 +6,12 @@
import QueueFrame from "$lib/components/custom/QueueFrame.svelte"; import QueueFrame from "$lib/components/custom/QueueFrame.svelte";
//import PlayerFrame from "$lib/components/custom/PlayerFrame.svelte"; //import PlayerFrame from "$lib/components/custom/PlayerFrame.svelte";
import {Button} from "$lib/components/ui/button"; import {Button} from "$lib/components/ui/button";
import {browser} from "$app/environment";
//let audioSource: HTMLAudioElement = $state(new Audio()); function toFixedNumber(num, digits, base){
//let paused: boolean = $derived(audioSource.paused); const pow = Math.pow(base ?? 10, digits);
//let volume: number = $derived(audioSource.volume); return Math.round(num*pow) / pow;
}
enum PlaybackMode { enum PlaybackMode {
Linear, Linear,
LoopOne, LoopOne,
@ -80,7 +81,6 @@
if (data && data.nowPlaying.entry) { if (data && data.nowPlaying.entry) {
data.nowPlaying.entry.forEach((entry) => { data.nowPlaying.entry.forEach((entry) => {
if (entry.username == OpenSubsonic.username) { if (entry.username == OpenSubsonic.username) {
title = entry.title;
newSong(entry); newSong(entry);
foundInNowPlaying = true; foundInNowPlaying = true;
} }
@ -234,8 +234,6 @@
</div> </div>
<div class="border border-2 col-span-3"> <div class="border border-2 col-span-3">
<h1>Center</h1> <h1>Center</h1>
<button onclick={() => volume += 0.1}>Louder</button>
<button onclick={() => volume -= 0.1}>Quieter</button>
</div> </div>
<QueueFrame {queue} {fetchQueue} {saveQueue} {removeSongFromQueue} {playSong} currentIndex={currentSong.queueIndex} /> <QueueFrame {queue} {fetchQueue} {saveQueue} {removeSongFromQueue} {playSong} currentIndex={currentSong.queueIndex} />
</div> </div>