mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +02:00
add sidebar visualizer / lyrics toggle in player config
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
|||||||
usePlayerStatus,
|
usePlayerStatus,
|
||||||
} from '/@/renderer/store';
|
} from '/@/renderer/store';
|
||||||
import {
|
import {
|
||||||
|
useGeneralSettings,
|
||||||
usePlaybackSettings,
|
usePlaybackSettings,
|
||||||
useSettingsStore,
|
useSettingsStore,
|
||||||
useSettingsStoreActions,
|
useSettingsStoreActions,
|
||||||
@@ -48,6 +49,7 @@ export const PlayerConfig = () => {
|
|||||||
const { setCrossfadeDuration, setCrossfadeStyle, setQueueType, setSpeed, setTransitionType } =
|
const { setCrossfadeDuration, setCrossfadeStyle, setQueueType, setSpeed, setTransitionType } =
|
||||||
usePlayerActions();
|
usePlayerActions();
|
||||||
const preservePitch = useSettingsStore((state) => state.playback.preservePitch);
|
const preservePitch = useSettingsStore((state) => state.playback.preservePitch);
|
||||||
|
const generalSettings = useGeneralSettings();
|
||||||
|
|
||||||
const playbackSettings = usePlaybackSettings();
|
const playbackSettings = usePlaybackSettings();
|
||||||
const { setSettings } = useSettingsStoreActions();
|
const { setSettings } = useSettingsStoreActions();
|
||||||
@@ -314,6 +316,46 @@ export const PlayerConfig = () => {
|
|||||||
id: 'preservePitch',
|
id: 'preservePitch',
|
||||||
label: t('setting.preservePitch', { postProcess: 'titleCase' }),
|
label: t('setting.preservePitch', { postProcess: 'titleCase' }),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
component: null,
|
||||||
|
id: 'divider-3',
|
||||||
|
isDivider: true,
|
||||||
|
label: '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: (
|
||||||
|
<Switch
|
||||||
|
defaultChecked={generalSettings.showLyricsInSidebar}
|
||||||
|
onChange={(e) => {
|
||||||
|
setSettings({
|
||||||
|
general: {
|
||||||
|
...generalSettings,
|
||||||
|
showLyricsInSidebar: e.currentTarget.checked,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
id: 'showLyricsInSidebar',
|
||||||
|
label: t('setting.showLyricsInSidebar', { postProcess: 'titleCase' }),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: (
|
||||||
|
<Switch
|
||||||
|
defaultChecked={generalSettings.showVisualizerInSidebar}
|
||||||
|
onChange={(e) => {
|
||||||
|
setSettings({
|
||||||
|
general: {
|
||||||
|
...generalSettings,
|
||||||
|
showVisualizerInSidebar: e.currentTarget.checked,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
id: 'showVisualizerInSidebar',
|
||||||
|
label: t('setting.showVisualizerInSidebar', { postProcess: 'titleCase' }),
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
return allOptions;
|
return allOptions;
|
||||||
@@ -336,6 +378,7 @@ export const PlayerConfig = () => {
|
|||||||
setTransitionType,
|
setTransitionType,
|
||||||
setCrossfadeStyle,
|
setCrossfadeStyle,
|
||||||
setPreservePitch,
|
setPreservePitch,
|
||||||
|
generalSettings,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user