diff options
author | csett86 <csett86@web.de> | 2021-05-11 17:08:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-11 17:08:47 +0200 |
commit | 22b34066132f7dd39920e7f3a2f3d3eb26695374 (patch) | |
tree | a28e18a05517d828e250ed9ea97d8ff0d0e1ec34 /app | |
parent | 4b4148388d95012db7a52db7f98398276308d2a2 (diff) |
feat(agc): Add setting to disable automatic gain control (#582)
In some OS/Chromium combinations the automatic gain control goes slightly
crazy, but normally its fine. Thus keep the default as is, but add an option
for the users to disable it if required.
Closes: #564
Diffstat (limited to 'app')
-rw-r--r-- | app/features/conference/components/Conference.js | 7 | ||||
-rw-r--r-- | app/features/settings/actionTypes.js | 10 | ||||
-rw-r--r-- | app/features/settings/actions.js | 16 | ||||
-rw-r--r-- | app/features/settings/components/SettingsDrawer.js | 6 | ||||
-rw-r--r-- | app/features/settings/reducer.js | 9 | ||||
-rw-r--r-- | app/i18n/lang/de.json | 3 | ||||
-rw-r--r-- | app/i18n/lang/en.json | 3 |
7 files changed, 51 insertions, 3 deletions
diff --git a/app/features/conference/components/Conference.js b/app/features/conference/components/Conference.js index 9bd6a16..bd0fc22 100644 --- a/app/features/conference/components/Conference.js +++ b/app/features/conference/components/Conference.js @@ -35,6 +35,11 @@ type Props = { _alwaysOnTopWindowEnabled: boolean; /** + * Disable automatic gain control. + */ + _disableAGC: boolean; + + /** * Email of user. */ _email: string; @@ -211,6 +216,7 @@ class Conference extends Component<Props, State> { }; const configOverwrite = { + disableAGC: this.props._disableAGC, startWithAudioMuted: this.props._startWithAudioMuted, startWithVideoMuted: this.props._startWithVideoMuted }; @@ -403,6 +409,7 @@ class Conference extends Component<Props, State> { function _mapStateToProps(state: Object) { return { _alwaysOnTopWindowEnabled: getSetting(state, 'alwaysOnTopWindowEnabled', true), + _disableAGC: state.settings.disableAGC, _email: state.settings.email, _name: state.settings.name, _serverURL: state.settings.serverURL, diff --git a/app/features/settings/actionTypes.js b/app/features/settings/actionTypes.js index fd73c63..4fc7ac5 100644 --- a/app/features/settings/actionTypes.js +++ b/app/features/settings/actionTypes.js @@ -20,6 +20,16 @@ export const SET_ALWAYS_ON_TOP_WINDOW_ENABLED export const SET_AUDIO_MUTED = Symbol('SET_AUDIO_MUTED'); /** + * The type of (redux) action that sets disable AGC. + * + * @type { + * type: SET_DISABLE_AGC, + * disableAGC: boolean + * } + */ +export const SET_DISABLE_AGC = Symbol('SET_DISABLE_AGC'); + +/** * The type of (redux) action that sets the email of the user. * * @type { diff --git a/app/features/settings/actions.js b/app/features/settings/actions.js index 054c890..8b94cf7 100644 --- a/app/features/settings/actions.js +++ b/app/features/settings/actions.js @@ -3,6 +3,7 @@ import { SET_ALWAYS_ON_TOP_WINDOW_ENABLED, SET_AUDIO_MUTED, + SET_DISABLE_AGC, SET_EMAIL, SET_NAME, SET_SERVER_URL, @@ -108,6 +109,21 @@ export function setStartWithVideoMuted(startWithVideoMuted: boolean) { }; } +/** + * Set disable AGC. + * + * @param {boolean} disableAGC - Whether to disable AGC. + * @returns {{ + * type: SET_DISABLE_AGC, + * disableAGC: boolean + * }} + */ +export function setDisableAGC(disableAGC: boolean) { + return { + type: SET_DISABLE_AGC, + disableAGC + }; +} /** * Set window always on top. diff --git a/app/features/settings/components/SettingsDrawer.js b/app/features/settings/components/SettingsDrawer.js index 985123d..79ed1da 100644 --- a/app/features/settings/components/SettingsDrawer.js +++ b/app/features/settings/components/SettingsDrawer.js @@ -17,7 +17,7 @@ import { Onboarding, advenaceSettingsSteps, startOnboarding } from '../../onboar import { Form, SettingsContainer, TogglesContainer } from '../styled'; import { setEmail, setName, setWindowAlwaysOnTop, - setStartWithAudioMuted, setStartWithVideoMuted + setStartWithAudioMuted, setStartWithVideoMuted, setDisableAGC } from '../actions'; import SettingToggle from './SettingToggle'; @@ -163,6 +163,10 @@ class SettingsDrawer extends Component<Props, *> { settingChangeEvent = { setWindowAlwaysOnTop } settingName = 'alwaysOnTopWindowEnabled' /> </SpotlightTarget> + <SettingToggle + label = { t('settings.disableAGC') } + settingChangeEvent = { setDisableAGC } + settingName = 'disableAGC' /> </TogglesContainer> </Panel> <Onboarding section = 'settings-drawer' /> diff --git a/app/features/settings/reducer.js b/app/features/settings/reducer.js index 5f09b7c..cb9afec 100644 --- a/app/features/settings/reducer.js +++ b/app/features/settings/reducer.js @@ -3,6 +3,7 @@ import { SET_ALWAYS_ON_TOP_WINDOW_ENABLED, SET_AUDIO_MUTED, + SET_DISABLE_AGC, SET_EMAIL, SET_NAME, SET_SERVER_URL, @@ -12,6 +13,7 @@ import { type State = { alwaysOnTopWindowEnabled: boolean, + disableAGC: boolean, email: string, name: string, serverURL: ?string, @@ -24,6 +26,7 @@ const username = window.jitsiNodeAPI.osUserInfo().username; const DEFAULT_STATE = { alwaysOnTopWindowEnabled: true, + disableAGC: false, email: '', name: username, serverURL: undefined, @@ -53,6 +56,12 @@ export default (state: State = DEFAULT_STATE, action: Object) => { startWithAudioMuted: action.startWithAudioMuted }; + case SET_DISABLE_AGC: + return { + ...state, + disableAGC: action.disableAGC + }; + case SET_EMAIL: return { ...state, diff --git a/app/i18n/lang/de.json b/app/i18n/lang/de.json index 0a46e18..d53a02b 100644 --- a/app/i18n/lang/de.json +++ b/app/i18n/lang/de.json @@ -34,6 +34,7 @@ "invalidServer": "Falsche Server-Adresse", "invalidServerTimeout": "Ungültiger Wert für die Server-Wartezeit", "serverUrl": "Server-Adresse", - "serverTimeout": "Server-Wartezeit (in Sekunden)" + "serverTimeout": "Server-Wartezeit (in Sekunden)", + "disableAGC": "Automatische Mikrofonlautstärkeregelung deaktivieren" } } diff --git a/app/i18n/lang/en.json b/app/i18n/lang/en.json index df26637..b667cf3 100644 --- a/app/i18n/lang/en.json +++ b/app/i18n/lang/en.json @@ -34,6 +34,7 @@ "invalidServer": "Invalid Server URL", "invalidServerTimeout": "Invalid value for Server Timeout", "serverUrl": "Server URL", - "serverTimeout": "Server Timeout (in seconds)" + "serverTimeout": "Server Timeout (in seconds)", + "disableAGC": "Disable automatic gain control" } } |