mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-15 13:00:25 +02:00
add player autodj (#7)
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import {
|
||||
SettingOption,
|
||||
SettingsSection,
|
||||
} from '/@/renderer/features/settings/components/settings-section';
|
||||
import { useAutoDJSettings, useSettingsStoreActions } from '/@/renderer/store/settings.store';
|
||||
import { NumberInput } from '/@/shared/components/number-input/number-input';
|
||||
|
||||
export const AutoDJSettings = () => {
|
||||
const { t } = useTranslation();
|
||||
const settings = useAutoDJSettings();
|
||||
const { setSettings } = useSettingsStoreActions();
|
||||
|
||||
const autoDJOptions: SettingOption[] = [
|
||||
{
|
||||
control: (
|
||||
<NumberInput
|
||||
aria-label="Auto DJ item count"
|
||||
hideControls={false}
|
||||
max={50}
|
||||
min={1}
|
||||
onChange={(e) => {
|
||||
setSettings({
|
||||
autoDJ: {
|
||||
...settings,
|
||||
itemCount: Number(e),
|
||||
},
|
||||
});
|
||||
}}
|
||||
value={Number(settings.itemCount)}
|
||||
/>
|
||||
),
|
||||
description: t('setting.autoDJ_itemCount', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.autoDJ_itemCount', { postProcess: 'sentenceCase' }),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<NumberInput
|
||||
aria-label="Auto DJ timing"
|
||||
hideControls={false}
|
||||
max={5}
|
||||
min={1}
|
||||
onChange={(e) => {
|
||||
setSettings({
|
||||
autoDJ: {
|
||||
...settings,
|
||||
timing: Number(e),
|
||||
},
|
||||
});
|
||||
}}
|
||||
value={Number(settings.timing)}
|
||||
/>
|
||||
),
|
||||
description: t('setting.autoDJ_timing', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.autoDJ_timing', { postProcess: 'sentenceCase' }),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<SettingsSection
|
||||
options={autoDJOptions}
|
||||
title={t('setting.autoDJ', { postProcess: 'upperCase' })}
|
||||
/>
|
||||
);
|
||||
};
|
||||
@@ -2,6 +2,7 @@ import isElectron from 'is-electron';
|
||||
import { lazy, Suspense, useMemo } from 'react';
|
||||
|
||||
import { AudioSettings } from '/@/renderer/features/settings/components/playback/audio-settings';
|
||||
import { AutoDJSettings } from '/@/renderer/features/settings/components/playback/auto-dj-settings';
|
||||
import { PlayerFilterSettings } from '/@/renderer/features/settings/components/playback/player-filter-settings';
|
||||
import { TranscodeSettings } from '/@/renderer/features/settings/components/playback/transcode-settings';
|
||||
import { useSettingsStore } from '/@/renderer/store';
|
||||
@@ -34,6 +35,8 @@ export const PlaybackTab = () => {
|
||||
<TranscodeSettings />
|
||||
<Divider />
|
||||
<PlayerFilterSettings />
|
||||
<Divider />
|
||||
<AutoDJSettings />
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user