mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 07:15:47 +00:00
refactor(equalizer): co-locate equalizer UI into features/equalizer (eqStore/eqCurve stay audio-core)
This commit is contained in:
@@ -12,7 +12,7 @@ import { usePlayerStore } from '@/features/playback/store/playerStore';
|
||||
import { useShallow } from 'zustand/react/shallow';
|
||||
import { useAuthStore } from '../store/authStore';
|
||||
import { useThemeStore } from '../store/themeStore';
|
||||
import Equalizer from './Equalizer';
|
||||
import { Equalizer } from '@/features/equalizer';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { usePlaybackLibraryNavigate } from '../hooks/usePlaybackLibraryNavigate';
|
||||
import { useRadioMetadata } from '@/features/radio';
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Search, X, ChevronDown, ChevronUp } from 'lucide-react';
|
||||
import { useAutoEq } from '../../hooks/useAutoEq';
|
||||
import { useAutoEq } from '@/features/equalizer/hooks/useAutoEq';
|
||||
|
||||
/** Collapsible AutoEQ search panel inside the Equalizer. Owns its own search
|
||||
* state via {@link useAutoEq}. */
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
||||
import { cleanup, screen } from '@testing-library/react';
|
||||
import { renderWithProviders } from '../test/helpers/renderWithProviders';
|
||||
import Equalizer from './Equalizer';
|
||||
import { useEqStore } from '../store/eqStore';
|
||||
import { renderWithProviders } from '@/test/helpers/renderWithProviders';
|
||||
import Equalizer from '@/features/equalizer/components/Equalizer';
|
||||
import { useEqStore } from '@/store/eqStore';
|
||||
|
||||
const FLAT = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||||
|
||||
@@ -2,11 +2,11 @@ import { useState, useRef, useEffect, useCallback } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Save, Trash2, RotateCcw } from 'lucide-react';
|
||||
import CustomSelect from '@/ui/CustomSelect';
|
||||
import { useEqStore, EQ_BANDS, BUILTIN_PRESETS } from '../store/eqStore';
|
||||
import { useThemeStore } from '../store/themeStore';
|
||||
import { useEqStore, EQ_BANDS, BUILTIN_PRESETS } from '@/store/eqStore';
|
||||
import { useThemeStore } from '@/store/themeStore';
|
||||
import { drawCurve } from '@/features/playback/utils/audio/eqCurve';
|
||||
import VerticalFader from './equalizer/VerticalFader';
|
||||
import AutoEqSection from './equalizer/AutoEqSection';
|
||||
import VerticalFader from '@/features/equalizer/components/VerticalFader';
|
||||
import AutoEqSection from '@/features/equalizer/components/AutoEqSection';
|
||||
|
||||
export default function Equalizer() {
|
||||
const { t } = useTranslation();
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useState, useRef, useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { invoke } from '@tauri-apps/api/core';
|
||||
import { useEqStore } from '../store/eqStore';
|
||||
import { useEqStore } from '@/store/eqStore';
|
||||
import { parseFixedBandEqString, type AutoEqVariant, type AutoEqResult } from '@/features/playback/utils/audio/autoEqParse';
|
||||
|
||||
/** AutoEQ search/apply state for the Equalizer. Loads the entries index lazily
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Equalizer feature — the graphic EQ panel (band faders, preset picker, EQ
|
||||
* curve canvas) plus the auto-EQ section and its hook. Mounted from the
|
||||
* settings audio tab and the player bar.
|
||||
*
|
||||
* Stays OUT (audio-core global state, consumed by the playback engine, not
|
||||
* owned): `store/eqStore` (drives the audio graph; read by `eqDeviceSync` /
|
||||
* `eqCurve` in the playback core) and the `eqCurve` renderer.
|
||||
*/
|
||||
export { default as Equalizer } from './components/Equalizer';
|
||||
@@ -2,7 +2,7 @@ import { useMemo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Blend, Gauge, Sliders, Volume2, Waves } from 'lucide-react';
|
||||
import { useAuthStore } from '@/store/authStore';
|
||||
import Equalizer from '@/components/Equalizer';
|
||||
import { Equalizer } from '@/features/equalizer';
|
||||
import SettingsSubSection from '@/features/settings/components/SettingsSubSection';
|
||||
import { SettingsGroup } from '@/features/settings/components/SettingsGroup';
|
||||
import { SettingsToggle } from '@/features/settings/components/SettingsToggle';
|
||||
|
||||
Reference in New Issue
Block a user