diff --git a/src/lib/components/DACSetupWizard.svelte b/src/lib/components/DACSetupWizard.svelte new file mode 100644 index 000000000..d39f6bc61 --- /dev/null +++ b/src/lib/components/DACSetupWizard.svelte @@ -0,0 +1,790 @@ + + + + +{#if isOpen} + +{/if} + + diff --git a/src/lib/components/views/SettingsView.svelte b/src/lib/components/views/SettingsView.svelte index 6f1e051d7..682a73fba 100644 --- a/src/lib/components/views/SettingsView.svelte +++ b/src/lib/components/views/SettingsView.svelte @@ -4,11 +4,12 @@ import ViewTransition from '../ViewTransition.svelte'; import { getCurrentWebview } from '@tauri-apps/api/webview'; import { writeText as copyToClipboard } from '@tauri-apps/plugin-clipboard-manager'; - import { ArrowLeft, ChevronRight, ChevronDown, ChevronUp, Loader2, Sun, Moon, SunMoon, HelpCircle, Ban } from 'lucide-svelte'; + import { ArrowLeft, ChevronRight, ChevronDown, ChevronUp, Loader2, Sun, Moon, SunMoon, HelpCircle, Ban, Wand2 } from 'lucide-svelte'; import Toggle from '../Toggle.svelte'; import Dropdown from '../Dropdown.svelte'; import DeviceDropdown from '../DeviceDropdown.svelte'; import AlsaUtilsHelpModal from '../AlsaUtilsHelpModal.svelte'; + import DACSetupWizard from '../DACSetupWizard.svelte'; import VolumeSlider from '../VolumeSlider.svelte'; import UpdateCheckResultModal from '../updates/UpdateCheckResultModal.svelte'; import WhatsNewModal from '../updates/WhatsNewModal.svelte'; @@ -152,6 +153,9 @@ // ALSA Utils help modal let showAlsaUtilsHelpModal = $state(false); + // DAC Setup Wizard modal + let showDACWizardModal = $state(false); + // Offline mode state let offlineStatus = $state(getOfflineStatus()); let offlineSettings = $state(getOfflineSettings()); @@ -2003,14 +2007,25 @@ {$t('settings.audio.audioBackend')} {$t('settings.audio.audioBackendDesc')} - +
+ + {#if selectedBackend === 'PipeWire'} + + {/if} +
@@ -2962,6 +2977,32 @@ flatpak override --user --filesystem=/home/USUARIO/Música com.blitzfc.qbz color: var(--accent); } + .backend-selector-row { + display: flex; + align-items: center; + gap: 8px; + } + + .dac-setup-btn { + display: flex; + align-items: center; + justify-content: center; + width: 32px; + height: 32px; + background: var(--accent-primary); + border: none; + border-radius: 6px; + color: white; + cursor: pointer; + transition: all 150ms ease; + flex-shrink: 0; + } + + .dac-setup-btn:hover { + opacity: 0.9; + transform: scale(1.05); + } + .loading-overlay { position: fixed; top: 0; @@ -3796,3 +3837,8 @@ flatpak override --user --filesystem=/home/USUARIO/Música com.blitzfc.qbz isOpen={showAlsaUtilsHelpModal} onClose={() => showAlsaUtilsHelpModal = false} /> + + showDACWizardModal = false} +/> diff --git a/src/lib/components/wizard/BitPerfectAppSelector.svelte b/src/lib/components/wizard/BitPerfectAppSelector.svelte new file mode 100644 index 000000000..0d836c0cf --- /dev/null +++ b/src/lib/components/wizard/BitPerfectAppSelector.svelte @@ -0,0 +1,255 @@ + + +
+
+ {#each predefinedApps as app} + + {/each} + + + +
+ + {#if showCustomInput} +
+ + +
+ {/if} + + {#if selectedApps.filter(a => !predefinedApps.some(p => p.binary === a)).length > 0} +
+ Custom apps: + {#each selectedApps.filter(a => !predefinedApps.some(p => p.binary === a)) as app} + + {app} + + + {/each} +
+ {/if} +
+ + diff --git a/src/lib/components/wizard/CommandBlock.svelte b/src/lib/components/wizard/CommandBlock.svelte new file mode 100644 index 000000000..23cfd7e03 --- /dev/null +++ b/src/lib/components/wizard/CommandBlock.svelte @@ -0,0 +1,121 @@ + + +
+ {#if label} +
{label}
+ {/if} + +
+
{commandText}
+ +
+
+ + diff --git a/src/lib/components/wizard/DistroSelector.svelte b/src/lib/components/wizard/DistroSelector.svelte new file mode 100644 index 000000000..cb3ace1a4 --- /dev/null +++ b/src/lib/components/wizard/DistroSelector.svelte @@ -0,0 +1,119 @@ + + +
+
+ {#each distros as distro} + + {/each} +
+ + {#if selected && selected !== 'other' && commands[selected]} + + {:else if selected === 'other'} +
+ {$t('dacWizard.precheck.otherHint')} +
+ {/if} +
+ + diff --git a/src/lib/components/wizard/WarningBanner.svelte b/src/lib/components/wizard/WarningBanner.svelte new file mode 100644 index 000000000..4b299fba7 --- /dev/null +++ b/src/lib/components/wizard/WarningBanner.svelte @@ -0,0 +1,133 @@ + + + + + diff --git a/src/lib/components/wizard/WizardStepper.svelte b/src/lib/components/wizard/WizardStepper.svelte new file mode 100644 index 000000000..1a6a5e38e --- /dev/null +++ b/src/lib/components/wizard/WizardStepper.svelte @@ -0,0 +1,152 @@ + + + + + diff --git a/src/lib/i18n/locales/en.json b/src/lib/i18n/locales/en.json index 222ea9212..b130ef58c 100644 --- a/src/lib/i18n/locales/en.json +++ b/src/lib/i18n/locales/en.json @@ -1019,5 +1019,117 @@ "focusSeekForwardLong": "Seek forward 10 seconds", "focusSeekBackLong": "Seek back 10 seconds" } + }, + "dacWizard": { + "triggerTooltip": "DAC Setup Guide", + "welcome": { + "title": "Guided DAC Setup", + "subtitle": "Step-by-step instructions. Nothing runs automatically.", + "body": "You will copy and run commands in a terminal. QBZ will guide you and explain each step. A backup will be created before any changes.", + "start": "Start" + }, + "precheck": { + "title": "Check Audio Stack", + "subtitle": "Confirm PipeWire and WirePlumber are running.", + "hint": "Look for 'active (running)' for all services", + "checkbox": "I ran this command and services are active", + "installTitle": "Install Required Packages", + "installSubtitle": "Select your distribution to see the install command.", + "distros": { + "debian": "Ubuntu / Debian / Mint / Pop!_OS", + "fedora": "Fedora / RHEL", + "arch": "Arch / Manjaro / EndeavourOS", + "opensuse": "openSUSE", + "other": "Other" + }, + "otherHint": "Please install: pipewire, pipewire-pulse, wireplumber, alsa-utils" + }, + "detectDac": { + "title": "Identify Default DAC", + "subtitle": "We need the exact PipeWire node name.", + "step1": "Find your DAC under 'Audio > Sinks'. Note the number (e.g., 46).", + "step2": "Then run with that number:", + "inputLabel": "Enter node.name", + "inputPlaceholder": "alsa_output.usb-..." + }, + "backup": { + "title": "Create Backup", + "subtitle": "Required before any changes.", + "hint": "You can restore this backup later if needed." + }, + "pipewireConfig": { + "title": "Allow Multiple Sample Rates", + "subtitle": "Enables automatic switching without forcing 48kHz.", + "explanation": "By default, PipeWire locks to 48kHz. This config allows your DAC to switch to the track's native sample rate." + }, + "pulseConfig": { + "title": "Choose Apps for Bit-Perfect", + "subtitle": "Add QBZ and any players you want without resampling.", + "apps": { + "qbz": "QBZ", + "vlc": "VLC", + "deadbeef": "DeaDBeeF", + "strawberry": "Strawberry", + "clementine": "Clementine", + "custom": "Custom..." + }, + "customPlaceholder": "Binary name (e.g., my-player)", + "warning": "Best results: use app-scoped bit-perfect only. Global Pulse bit-perfect can break browsers that output fixed 48kHz." + }, + "wireplumberConfig": { + "title": "Target Your DAC Only", + "subtitle": "Apply rules only to the detected sink.", + "targeting": "This targets:" + }, + "restart": { + "title": "Restart Audio Services", + "subtitle": "Required to apply changes.", + "hint": "Audio may briefly stop. This is normal.", + "checkbox": "I restarted services" + }, + "verify": { + "title": "Verify Sample-Rate Switching", + "subtitle": "Play different sample rates and confirm RATE changes.", + "instructions": "1. Open a terminal and run: pw-top\n2. In QBZ, play a 44.1kHz track\n3. Check that RATE shows 44100\n4. Play a 96kHz track\n5. Check that RATE shows 96000", + "success": "RATE should change to match each track's sample rate.", + "passed": "Passed", + "failed": "Failed", + "skip": "Skip", + "rollbackTitle": "Restore Backup", + "rollbackHint": "Run these commands to restore your previous configuration:" + }, + "done": { + "title": "Setup Complete", + "subtitle": "Your DAC is configured for bit-perfect playback.", + "summary": "Created configs:", + "close": "Close" + }, + "error": { + "title": "Need Help?", + "body": "If something went wrong, check these resources:", + "pipewireDocs": "PipeWire Official Documentation", + "archWiki": "Arch Wiki - PipeWire", + "pipewireUrl": "https://docs.pipewire.org/", + "archWikiUrl": "https://wiki.archlinux.org/title/PipeWire" + }, + "buttons": { + "next": "Next", + "back": "Back", + "close": "Close", + "copy": "Copy", + "copied": "Copied!" + }, + "steps": { + "welcome": "Welcome", + "precheck": "Pre-check", + "detectDac": "Detect DAC", + "backup": "Backup", + "pipewireConfig": "PipeWire", + "pulseConfig": "Pulse", + "wireplumberConfig": "WirePlumber", + "restart": "Restart", + "verify": "Verify", + "done": "Done" + } } } diff --git a/src/lib/i18n/locales/es.json b/src/lib/i18n/locales/es.json index e09d3d9a8..bf5f7d8bc 100644 --- a/src/lib/i18n/locales/es.json +++ b/src/lib/i18n/locales/es.json @@ -1019,5 +1019,117 @@ "focusSeekForwardLong": "Avanzar 10 segundos", "focusSeekBackLong": "Retroceder 10 segundos" } + }, + "dacWizard": { + "triggerTooltip": "Guía de Configuración de DAC", + "welcome": { + "title": "Configuración Guiada de DAC", + "subtitle": "Instrucciones paso a paso. Nada se ejecuta automáticamente.", + "body": "Copiarás y ejecutarás comandos en una terminal. QBZ te guiará y explicará cada paso. Se creará un backup antes de cualquier cambio.", + "start": "Comenzar" + }, + "precheck": { + "title": "Verificar Stack de Audio", + "subtitle": "Confirma que PipeWire y WirePlumber están activos.", + "hint": "Busca 'active (running)' en todos los servicios", + "checkbox": "Ejecuté el comando y los servicios están activos", + "installTitle": "Instalar Paquetes Requeridos", + "installSubtitle": "Selecciona tu distribución para ver el comando de instalación.", + "distros": { + "debian": "Ubuntu / Debian / Mint / Pop!_OS", + "fedora": "Fedora / RHEL", + "arch": "Arch / Manjaro / EndeavourOS", + "opensuse": "openSUSE", + "other": "Otra" + }, + "otherHint": "Instala: pipewire, pipewire-pulse, wireplumber, alsa-utils" + }, + "detectDac": { + "title": "Identificar DAC por Defecto", + "subtitle": "Necesitamos el node.name exacto de PipeWire.", + "step1": "Busca tu DAC en 'Audio > Sinks'. Anota el número (ej. 46).", + "step2": "Luego ejecuta con ese número:", + "inputLabel": "Ingresa node.name", + "inputPlaceholder": "alsa_output.usb-..." + }, + "backup": { + "title": "Crear Backup", + "subtitle": "Requerido antes de cualquier cambio.", + "hint": "Puedes restaurar este backup después si es necesario." + }, + "pipewireConfig": { + "title": "Permitir Múltiples Sample Rates", + "subtitle": "Habilita cambio automático sin forzar 48kHz.", + "explanation": "Por defecto, PipeWire fija 48kHz. Esta config permite que tu DAC cambie al sample rate nativo de cada pista." + }, + "pulseConfig": { + "title": "Elegir Apps para Bit-Perfect", + "subtitle": "Agrega QBZ y players que quieras sin resampling.", + "apps": { + "qbz": "QBZ", + "vlc": "VLC", + "deadbeef": "DeaDBeeF", + "strawberry": "Strawberry", + "clementine": "Clementine", + "custom": "Personalizado..." + }, + "customPlaceholder": "Nombre del binario (ej. mi-player)", + "warning": "Mejor resultado: usa bit-perfect por app. El bit-perfect global en Pulse puede romper navegadores que usan 48kHz fijo." + }, + "wireplumberConfig": { + "title": "Apuntar Solo a tu DAC", + "subtitle": "Aplica reglas solo al sink detectado.", + "targeting": "Esto apunta a:" + }, + "restart": { + "title": "Reiniciar Servicios de Audio", + "subtitle": "Necesario para aplicar cambios.", + "hint": "El audio puede detenerse brevemente. Es normal.", + "checkbox": "Ya reinicié servicios" + }, + "verify": { + "title": "Verificar Cambio de Sample Rate", + "subtitle": "Reproduce diferentes sample rates y confirma que RATE cambia.", + "instructions": "1. Abre una terminal y ejecuta: pw-top\n2. En QBZ, reproduce una pista de 44.1kHz\n3. Verifica que RATE muestre 44100\n4. Reproduce una pista de 96kHz\n5. Verifica que RATE muestre 96000", + "success": "RATE debe cambiar para coincidir con el sample rate de cada pista.", + "passed": "Exitoso", + "failed": "Falló", + "skip": "Omitir", + "rollbackTitle": "Restaurar Backup", + "rollbackHint": "Ejecuta estos comandos para restaurar tu configuración anterior:" + }, + "done": { + "title": "Configuración Completa", + "subtitle": "Tu DAC está configurado para reproducción bit-perfect.", + "summary": "Configs creados:", + "close": "Cerrar" + }, + "error": { + "title": "¿Necesitas Ayuda?", + "body": "Si algo salió mal, consulta estos recursos:", + "pipewireDocs": "Documentación Oficial de PipeWire", + "archWiki": "Arch Wiki - PipeWire", + "pipewireUrl": "https://docs.pipewire.org/", + "archWikiUrl": "https://wiki.archlinux.org/title/PipeWire" + }, + "buttons": { + "next": "Siguiente", + "back": "Atrás", + "close": "Cerrar", + "copy": "Copiar", + "copied": "¡Copiado!" + }, + "steps": { + "welcome": "Bienvenida", + "precheck": "Pre-check", + "detectDac": "Detectar DAC", + "backup": "Backup", + "pipewireConfig": "PipeWire", + "pulseConfig": "Pulse", + "wireplumberConfig": "WirePlumber", + "restart": "Reiniciar", + "verify": "Verificar", + "done": "Completado" + } } }