mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-22 06:25:41 +00:00
remove(seekbar): drop realtime_waveform style
Downloaded and fully decoded the entire audio file on every track change — too CPU/bandwidth intensive to keep. Removes SeekbarStyle variant, Rust command, waveform_decode function, all frontend canvas code, seekbarRealtime_waveform i18n keys across all 8 locales, and unused urlencoding dependency from Cargo.toml. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3109,6 +3109,7 @@ pub fn audio_set_gapless(enabled: bool, state: State<'_, AudioEngine>) {
|
|||||||
// Linux: case 2 is disabled — ALSA/cpal often omit the active sink from
|
// Linux: case 2 is disabled — ALSA/cpal often omit the active sink from
|
||||||
// enumeration while streaming, which caused false resets to system default.
|
// enumeration while streaming, which caused false resets to system default.
|
||||||
|
|
||||||
|
|
||||||
pub fn start_device_watcher(engine: &AudioEngine, app: tauri::AppHandle) {
|
pub fn start_device_watcher(engine: &AudioEngine, app: tauri::AppHandle) {
|
||||||
let reopen_tx = engine.stream_reopen_tx.clone();
|
let reopen_tx = engine.stream_reopen_tx.clone();
|
||||||
let stream_handle = engine.stream_handle.clone();
|
let stream_handle = engine.stream_handle.clone();
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import React, { useEffect, useRef, useState } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
import { usePlayerStore } from '../store/playerStore';
|
import { usePlayerStore } from '../store/playerStore';
|
||||||
import { useAuthStore, type SeekbarStyle } from '../store/authStore';
|
import { useAuthStore, type SeekbarStyle } from '../store/authStore';
|
||||||
|
|
||||||
function fmt(s: number): string {
|
function fmt(s: number): string {
|
||||||
if (!s || isNaN(s)) return '0:00';
|
if (!s || isNaN(s)) return '0:00';
|
||||||
return `${Math.floor(s / 60)}:${Math.floor(s % 60).toString().padStart(2, '0')}`;
|
return `${Math.floor(s / 60)}:${Math.floor(s % 60).toString().padStart(2, '0')}`;
|
||||||
@@ -733,7 +732,10 @@ export function SeekbarPreview({
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const canvas = canvasRef.current;
|
const canvas = canvasRef.current;
|
||||||
if (!canvas) return;
|
if (!canvas) return;
|
||||||
const heights = style === 'waveform' ? makeHeights('seekbar-preview-demo') : null;
|
let heights: Float32Array | null = null;
|
||||||
|
if (style === 'waveform') {
|
||||||
|
heights = makeHeights('seekbar-preview-demo');
|
||||||
|
}
|
||||||
const animState = makeAnimState();
|
const animState = makeAnimState();
|
||||||
let t = 0;
|
let t = 0;
|
||||||
const tick = () => {
|
const tick = () => {
|
||||||
@@ -818,7 +820,11 @@ export default function WaveformSeek({ trackId }: Props) {
|
|||||||
styleRef.current = seekbarStyle;
|
styleRef.current = seekbarStyle;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
heightsRef.current = trackId ? makeHeights(trackId) : null;
|
if (!trackId) {
|
||||||
|
heightsRef.current = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
heightsRef.current = makeHeights(trackId);
|
||||||
}, [trackId]);
|
}, [trackId]);
|
||||||
|
|
||||||
// Imperative subscription — no React re-renders from progress changes.
|
// Imperative subscription — no React re-renders from progress changes.
|
||||||
|
|||||||
Reference in New Issue
Block a user