Append: Improve Volume Handling
This commit is contained in:
parent
a99e12c6e6
commit
652e8afc37
1 changed files with 5 additions and 7 deletions
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue