feat: implement volume boost functionality with signal-based multiplier and audio processing override

This commit is contained in:
mmacierzanka committed 2026-09-11 01:46:16 +02:00
1 parent 9143c6029a
commit 3dd30804dc
13 files changed
+294 -8

No files matched your search

+2
View File
@@ -55,6 +55,8 @@ export const api = {
skip: () => post('/api/skip'),
stop: () => post('/api/stop'),
setVolume: (volume: number) => post('/api/volume', { volume }),
setVolumeBoost: (enabled?: boolean) =>
post<{ status: string; volume_boost: boolean }>('/api/volume_boost', { enabled }),
cycleLoop: () => post<{ mode: 'off' | 'playlist' | 'single' }>('/api/loop_cycle'),
jump: (index: number) => post('/api/jump', { index }),
+94
View File
@@ -14,6 +14,7 @@ import {
Volume1,
Volume2,
VolumeX,
Zap,
} from 'lucide-vue-next'
import { api } from '@/api/client'
import { useToasts } from '@/composables/useToasts'
@@ -87,6 +88,19 @@ async function commitVolume() {
draggedVolume.value = null
}
const volumeBoost = computed(() => props.status?.volume_boost ?? false)
const volumeBoostMultiplier = computed(() => props.status?.volume_boost_multiplier ?? 10.0)
const volumeBoostPercent = computed(() => Math.round(volumeBoostMultiplier.value * 100))
async function toggleVolumeBoost() {
const next = !volumeBoost.value
await run(
() => api.setVolumeBoost(next),
next ? `Włączono tryb ${volumeBoostPercent.value}% głośności ⚡` : 'Wyłączono podbicie głośności',
'Błąd przełączania trybu podbicia głośności',
)
}
async function togglePlayback() {
if (!current.value) {
notify('Nic nie jest obecnie odtwarzane', 'info')
@@ -312,6 +326,22 @@ async function cycleLoop() {
>
<span class="volume-value">{{ volume }}%</span>
</div>
<div class="volume-boost-row">
<button
type="button"
class="btn-boost"
:class="{ active: volumeBoost }"
:title="volumeBoost ? `Wyłącz tryb ${volumeBoostPercent}% głośności` : `Włącz tryb ${volumeBoostPercent}% głośności`"
@click="toggleVolumeBoost"
>
<Zap :size="14" class="boost-icon" />
<span class="boost-label">Tryb {{ volumeBoostPercent }}% głośności</span>
<span class="boost-badge" :class="{ active: volumeBoost }">
{{ volumeBoost ? 'AKTYWNY' : 'WYŁ' }}
</span>
</button>
</div>
</div>
</template>
@@ -326,4 +356,68 @@ async function cycleLoop() {
cursor: not-allowed;
transform: none;
}
.volume-boost-row {
margin-top: 10px;
}
.btn-boost {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 8px 14px;
background: rgba(255, 255, 255, 0.04);
border: 1px solid var(--border-glass);
border-radius: 12px;
color: var(--text-muted);
font-size: 0.8rem;
font-weight: 600;
cursor: pointer;
transition: var(--transition-smooth);
}
.btn-boost:hover {
background: rgba(255, 255, 255, 0.08);
border-color: rgba(255, 255, 255, 0.2);
color: var(--text-main);
}
.btn-boost.active {
background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(239, 68, 68, 0.15) 100%);
border-color: rgba(245, 158, 11, 0.5);
color: #fbbf24;
box-shadow: 0 0 14px rgba(245, 158, 11, 0.2);
}
.btn-boost.active:hover {
background: linear-gradient(135deg, rgba(245, 158, 11, 0.22) 0%, rgba(239, 68, 68, 0.22) 100%);
border-color: rgba(245, 158, 11, 0.7);
}
.boost-icon {
transition: transform 0.2s ease;
}
.btn-boost.active .boost-icon {
transform: scale(1.15);
filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.6));
}
.boost-badge {
font-size: 0.65rem;
font-weight: 700;
padding: 2px 7px;
border-radius: 20px;
background: rgba(255, 255, 255, 0.08);
color: var(--text-muted);
letter-spacing: 0.5px;
}
.boost-badge.active {
background: #f59e0b;
color: #0f172a;
box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}
</style>
+2
View File
@@ -56,6 +56,8 @@ export interface BotStatus {
loop_single: boolean
loop_playlist: boolean
volume: number
volume_boost?: boolean
volume_boost_multiplier?: number
current: CurrentTrack | null
queue: QueueTrack[]
queue_index: number