mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-10 04:30:25 +02:00
Add crossfade style setting
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
|||||||
PlaybackStyle,
|
PlaybackStyle,
|
||||||
PlaybackType,
|
PlaybackType,
|
||||||
PlayerStatus,
|
PlayerStatus,
|
||||||
|
CrossfadeStyle,
|
||||||
} from '@/renderer/types';
|
} from '@/renderer/types';
|
||||||
|
|
||||||
const getAudioDevice = async () => {
|
const getAudioDevice = async () => {
|
||||||
@@ -145,6 +146,44 @@ export const PlaybackTab = () => {
|
|||||||
status === PlayerStatus.PLAYING ? 'Player must be paused' : undefined,
|
status === PlayerStatus.PLAYING ? 'Player must be paused' : undefined,
|
||||||
title: 'Crossfade Duration',
|
title: 'Crossfade Duration',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
control: (
|
||||||
|
<Select
|
||||||
|
data={[
|
||||||
|
{ label: 'Linear', value: CrossfadeStyle.LINEAR },
|
||||||
|
{ label: 'Constant Power', value: CrossfadeStyle.CONSTANT_POWER },
|
||||||
|
{
|
||||||
|
label: 'Constant Power (Slow cut)',
|
||||||
|
value: CrossfadeStyle.CONSTANT_POWER_SLOW_CUT,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Constant Power (Slow fade)',
|
||||||
|
value: CrossfadeStyle.CONSTANT_POWER_SLOW_FADE,
|
||||||
|
},
|
||||||
|
{ label: 'Dipped', value: CrossfadeStyle.DIPPED },
|
||||||
|
{ label: 'Equal Power', value: CrossfadeStyle.EQUALPOWER },
|
||||||
|
]}
|
||||||
|
defaultValue={settings.crossfadeStyle}
|
||||||
|
disabled={
|
||||||
|
settings.type !== PlaybackType.WEB ||
|
||||||
|
settings.style !== PlaybackStyle.CROSSFADE ||
|
||||||
|
status === PlayerStatus.PLAYING
|
||||||
|
}
|
||||||
|
width={200}
|
||||||
|
onChange={(e) => {
|
||||||
|
if (!e) return;
|
||||||
|
update({
|
||||||
|
player: { ...settings, crossfadeStyle: e as CrossfadeStyle },
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
description: 'Change the crossfade algorithm (web player only)',
|
||||||
|
isHidden: false,
|
||||||
|
note:
|
||||||
|
status === PlayerStatus.PLAYING ? 'Player must be paused' : undefined,
|
||||||
|
title: 'Crossfade Style',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
control: (
|
control: (
|
||||||
<Switch
|
<Switch
|
||||||
|
|||||||
Reference in New Issue
Block a user