mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-02 10:53:33 +00:00
Compare commits
3 commits
8bc45cda3b
...
21e5a4dfd2
| Author | SHA1 | Date | |
|---|---|---|---|
| 21e5a4dfd2 | |||
| 4193dd36a1 | |||
| 59e94318bb |
3 changed files with 14 additions and 20 deletions
|
|
@ -224,22 +224,16 @@ export const RightControls = () => {
|
|||
icon={
|
||||
playbackSettings.mpvProperties.audioChannels === 'mono'
|
||||
? 'volumeNormal'
|
||||
: playbackSettings.mpvProperties.audioChannels === 'stereo'
|
||||
? 'volumeMax'
|
||||
: 'volumeMute'
|
||||
: 'volumeMax'
|
||||
}
|
||||
iconProps={{
|
||||
size: 'lg',
|
||||
}}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
const current = playbackSettings.mpvProperties.audioChannels || 'auto';
|
||||
const next =
|
||||
current === 'auto'
|
||||
? 'mono'
|
||||
: current === 'mono'
|
||||
? 'stereo'
|
||||
: 'auto';
|
||||
const current =
|
||||
playbackSettings.mpvProperties.audioChannels || 'stereo';
|
||||
const next = current === 'mono' ? 'stereo' : 'mono';
|
||||
setSettings({
|
||||
playback: {
|
||||
...playbackSettings,
|
||||
|
|
@ -251,15 +245,15 @@ export const RightControls = () => {
|
|||
});
|
||||
// Apply to MPV immediately
|
||||
mpvPlayer?.setProperties({
|
||||
'audio-channels': next === 'auto' ? undefined : next,
|
||||
'audio-channels': next,
|
||||
});
|
||||
}}
|
||||
size="sm"
|
||||
tooltip={{
|
||||
label:
|
||||
playbackType === PlaybackType.WEB
|
||||
? `Audio: ${playbackSettings.mpvProperties.audioChannels || 'auto'} (MPV only)`
|
||||
: `Audio: ${playbackSettings.mpvProperties.audioChannels || 'auto'}`,
|
||||
? `Audio: ${playbackSettings.mpvProperties.audioChannels || 'stereo'} (MPV only)`
|
||||
: `Audio: ${playbackSettings.mpvProperties.audioChannels || 'stereo'}`,
|
||||
openDelay: 0,
|
||||
}}
|
||||
variant="subtle"
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ export const getMpvSetting = (
|
|||
) => {
|
||||
switch (key) {
|
||||
case 'audioChannels':
|
||||
return { 'audio-channels': value === 'auto' ? undefined : value };
|
||||
return { 'audio-channels': value };
|
||||
case 'audioExclusiveMode':
|
||||
return { 'audio-exclusive': value || 'no' };
|
||||
case 'audioSampleRateHz':
|
||||
|
|
@ -55,7 +55,7 @@ export const getMpvSetting = (
|
|||
|
||||
export const getMpvProperties = (settings: SettingsState['playback']['mpvProperties']) => {
|
||||
const properties: Record<string, any> = {
|
||||
'audio-channels': settings.audioChannels === 'auto' ? undefined : settings.audioChannels,
|
||||
'audio-channels': settings.audioChannels || 'stereo',
|
||||
'audio-exclusive': settings.audioExclusiveMode || 'no',
|
||||
'audio-samplerate':
|
||||
settings.audioSampleRateHz === 0 ? undefined : settings.audioSampleRateHz,
|
||||
|
|
@ -278,15 +278,15 @@ export const MpvSettings = () => {
|
|||
control: (
|
||||
<Select
|
||||
data={[
|
||||
{ label: 'Auto', value: 'auto' },
|
||||
{ label: 'Mono', value: 'mono' },
|
||||
{ label: 'Stereo', value: 'stereo' },
|
||||
]}
|
||||
defaultValue={settings.mpvProperties.audioChannels || 'auto'}
|
||||
defaultValue={settings.mpvProperties.audioChannels || 'stereo'}
|
||||
onChange={(e) => handleSetMpvProperty('audioChannels', e)}
|
||||
/>
|
||||
),
|
||||
description: 'Select the audio channel mode. Auto lets MPV decide based on the source.',
|
||||
description:
|
||||
'Select the audio channel mode. Stereo is the default, mono downmixes to a single channel.',
|
||||
isHidden: settings.type !== PlaybackType.LOCAL,
|
||||
title: 'Audio Channels',
|
||||
},
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ const TranscodingConfigSchema = z.object({
|
|||
});
|
||||
|
||||
const MpvSettingsSchema = z.object({
|
||||
audioChannels: z.enum(['auto', 'mono', 'stereo']).optional(),
|
||||
audioChannels: z.enum(['mono', 'stereo']).optional(),
|
||||
audioExclusiveMode: z.enum(['no', 'yes']),
|
||||
audioFormat: z.enum(['float', 's16', 's32']).optional(),
|
||||
audioSampleRateHz: z.number().optional(),
|
||||
|
|
@ -658,7 +658,7 @@ const initialState: SettingsState = {
|
|||
mediaSession: false,
|
||||
mpvExtraParameters: [],
|
||||
mpvProperties: {
|
||||
audioChannels: 'auto',
|
||||
audioChannels: 'stereo',
|
||||
audioExclusiveMode: 'no',
|
||||
audioFormat: undefined,
|
||||
audioSampleRateHz: 48000,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue