surround sound checkbox added to settings

This commit is contained in:
unclekingpin 2023-11-25 08:40:24 -08:00
parent a8588d2c78
commit b9efa02727
3 changed files with 28 additions and 0 deletions

View file

@ -34,6 +34,7 @@ const Settings = () => {
subtitlesBackgroundColorInput, subtitlesBackgroundColorInput,
subtitlesOutlineColorInput, subtitlesOutlineColorInput,
audioLanguageSelect, audioLanguageSelect,
surroundSoundCheckbox,
seekTimeDurationSelect, seekTimeDurationSelect,
seekShortTimeDurationSelect, seekShortTimeDurationSelect,
escExitFullscreenCheckbox, escExitFullscreenCheckbox,
@ -405,6 +406,16 @@ const Settings = () => {
{...audioLanguageSelect} {...audioLanguageSelect}
/> />
</div> </div>
<div className={styles['option-container']}>
<div className={styles['option-name-container']}>
<div className={styles['label']}>{ t('SETTINGS_SURROUND_SOUND') }</div>
</div>
<Checkbox
className={classnames(styles['option-input-container'], styles['checkbox-container'])}
tabIndex={-1}
{...surroundSoundCheckbox}
/>
</div>
</div> </div>
<div className={styles['section-container']}> <div className={styles['section-container']}>
<div className={styles['section-category-container']}> <div className={styles['section-category-container']}>

View file

@ -135,6 +135,21 @@ const useProfileSettingsInputs = (profile) => {
}); });
} }
}), [profile.settings]); }), [profile.settings]);
const surroundSoundCheckbox = React.useMemo(() => ({
checked: profile.settings.surroundSound,
onClick: () => {
core.transport.dispatch({
action: 'Ctx',
args: {
action: 'UpdateSettings',
args: {
...profile.settings,
surroundSound: !profile.settings.surroundSound
}
}
});
}
}), [profile.settings]);
const escExitFullscreenCheckbox = React.useMemo(() => ({ const escExitFullscreenCheckbox = React.useMemo(() => ({
checked: profile.settings.escExitFullscreen, checked: profile.settings.escExitFullscreen,
onClick: () => { onClick: () => {
@ -307,6 +322,7 @@ const useProfileSettingsInputs = (profile) => {
subtitlesBackgroundColorInput, subtitlesBackgroundColorInput,
subtitlesOutlineColorInput, subtitlesOutlineColorInput,
audioLanguageSelect, audioLanguageSelect,
surroundSoundCheckbox,
escExitFullscreenCheckbox, escExitFullscreenCheckbox,
seekTimeDurationSelect, seekTimeDurationSelect,
seekShortTimeDurationSelect, seekShortTimeDurationSelect,

View file

@ -37,6 +37,7 @@ type Settings = {
subtitlesOutlineColor: string, subtitlesOutlineColor: string,
subtitlesSize: number, subtitlesSize: number,
subtitlesTextColor: string, subtitlesTextColor: string,
surroundSound: boolean,
}; };
type Profile = { type Profile = {