Skip to content

Commit

Permalink
surround sound checkbox added to settings
Browse files Browse the repository at this point in the history
  • Loading branch information
unclekingpin committed Nov 25, 2023
1 parent a8588d2 commit b9efa02
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/routes/Settings/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const Settings = () => {
subtitlesBackgroundColorInput,
subtitlesOutlineColorInput,
audioLanguageSelect,
surroundSoundCheckbox,
seekTimeDurationSelect,
seekShortTimeDurationSelect,
escExitFullscreenCheckbox,
Expand Down Expand Up @@ -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']}>
Expand Down
16 changes: 16 additions & 0 deletions src/routes/Settings/useProfileSettingsInputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: () => {
Expand Down Expand Up @@ -307,6 +322,7 @@ const useProfileSettingsInputs = (profile) => {
subtitlesBackgroundColorInput,
subtitlesOutlineColorInput,
audioLanguageSelect,
surroundSoundCheckbox,
escExitFullscreenCheckbox,
seekTimeDurationSelect,
seekShortTimeDurationSelect,
Expand Down
1 change: 1 addition & 0 deletions src/types/models/Ctx.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ type Settings = {
subtitlesOutlineColor: string,
subtitlesSize: number,
subtitlesTextColor: string,
surroundSound: boolean,
};

type Profile = {
Expand Down

0 comments on commit b9efa02

Please sign in to comment.