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,
subtitlesOutlineColorInput,
audioLanguageSelect,
surroundSoundCheckbox,
seekTimeDurationSelect,
seekShortTimeDurationSelect,
escExitFullscreenCheckbox,
@ -405,6 +406,16 @@ const Settings = () => {
{...audioLanguageSelect}
/>
</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 className={styles['section-container']}>
<div className={styles['section-category-container']}>

View file

@ -135,6 +135,21 @@ const useProfileSettingsInputs = (profile) => {
});
}
}), [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(() => ({
checked: profile.settings.escExitFullscreen,
onClick: () => {
@ -307,6 +322,7 @@ const useProfileSettingsInputs = (profile) => {
subtitlesBackgroundColorInput,
subtitlesOutlineColorInput,
audioLanguageSelect,
surroundSoundCheckbox,
escExitFullscreenCheckbox,
seekTimeDurationSelect,
seekShortTimeDurationSelect,

View file

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