lint; clean up; advanced audio settings switch
parent
d4759ba7fa
commit
f17deb2589
|
|
@ -53,6 +53,12 @@ export const toggleShowNotifications = () =>
|
|||
type : 'TOGGLE_SHOW_NOTIFICATIONS'
|
||||
});
|
||||
|
||||
export const setShowAdvancedAudio = (showAdvancedAudio) =>
|
||||
({
|
||||
type : 'SET_SHOW_ADVANCED_AUDIO',
|
||||
payload : { showAdvancedAudio }
|
||||
});
|
||||
|
||||
export const setEchoCancellation = (echoCancellation) =>
|
||||
({
|
||||
type : 'SET_ECHO_CANCELLATION',
|
||||
|
|
@ -89,21 +95,6 @@ export const setDefaultAudio = (audio) =>
|
|||
payload : { audio }
|
||||
});
|
||||
|
||||
export const toggleEchoCancellation = () =>
|
||||
({
|
||||
type : 'TOGGLE_ECHO_CANCELLATION'
|
||||
});
|
||||
|
||||
export const toggleAutoGainControl = () =>
|
||||
({
|
||||
type : 'TOGGLE_AUTO_GAIN_CONTROL'
|
||||
});
|
||||
|
||||
export const toggleNoiseSuppression = () =>
|
||||
({
|
||||
type : 'TOGGLE_NOISE_SUPPRESSION'
|
||||
});
|
||||
|
||||
export const toggleHiddenControls = () =>
|
||||
({
|
||||
type : 'TOGGLE_HIDDEN_CONTROLS'
|
||||
|
|
|
|||
|
|
@ -494,8 +494,10 @@ const Me = (props) =>
|
|||
>
|
||||
{ micState === 'on' ?
|
||||
<MicIcon
|
||||
color={me.isAutoMuted && settings.voiceActivatedUnmute ? 'secondary' : 'primary'}
|
||||
style={me.isAutoMuted && settings.voiceActivatedUnmute ? { opacity: noiseVolume }
|
||||
color={me.isAutoMuted && settings.voiceActivatedUnmute ?
|
||||
'secondary' : 'primary'}
|
||||
style={me.isAutoMuted && settings.voiceActivatedUnmute ?
|
||||
{ opacity: noiseVolume }
|
||||
: { opacity: 1 }}
|
||||
/>
|
||||
:
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ const styles = (theme) => ({
|
|||
});
|
||||
|
||||
const MediaSettings = ({
|
||||
setShowAdvancedAudio,
|
||||
setEchoCancellation,
|
||||
setAutoGainControl,
|
||||
setNoiseSuppression,
|
||||
|
|
@ -287,6 +288,23 @@ const MediaSettings = ({
|
|||
</FormControl>
|
||||
</form>
|
||||
}
|
||||
<form className={classes.setting} autoComplete='off'>
|
||||
<FormControlLabel
|
||||
className={classes.setting}
|
||||
control={
|
||||
<Checkbox checked={settings.showAdvancedAudio} onChange={
|
||||
(event) =>
|
||||
{
|
||||
setShowAdvancedAudio(event.target.checked);
|
||||
}}
|
||||
/>}
|
||||
label={intl.formatMessage({
|
||||
id : 'settings.showAdvancedAudio',
|
||||
defaultMessage : 'Show advanced audio settings'
|
||||
})}
|
||||
/>
|
||||
</form>
|
||||
{settings.showAdvancedAudio ?
|
||||
<form className={classes.setting} autoComplete='off'>
|
||||
<FormControlLabel
|
||||
className={classes.setting}
|
||||
|
|
@ -371,6 +389,8 @@ const MediaSettings = ({
|
|||
/>
|
||||
<div className={classes.margin} />
|
||||
</form>
|
||||
: null
|
||||
}
|
||||
</React.Fragment>
|
||||
);
|
||||
};
|
||||
|
|
@ -378,6 +398,7 @@ const MediaSettings = ({
|
|||
MediaSettings.propTypes =
|
||||
{
|
||||
roomClient : PropTypes.any.isRequired,
|
||||
setShowAdvancedAudio : PropTypes.func.isRequired,
|
||||
setEchoCancellation : PropTypes.func.isRequired,
|
||||
setAutoGainControl : PropTypes.func.isRequired,
|
||||
setNoiseSuppression : PropTypes.func.isRequired,
|
||||
|
|
@ -398,9 +419,10 @@ const mapStateToProps = (state) =>
|
|||
};
|
||||
|
||||
const mapDispatchToProps = {
|
||||
setShowAdvancedAudio : settingsActions.setShowAdvancedAudio,
|
||||
setEchoCancellation : settingsActions.setEchoCancellation,
|
||||
setAutoGainControl : settingsActions.toggleAutoGainControl,
|
||||
setNoiseSuppression : settingsActions.toggleNoiseSuppression,
|
||||
setAutoGainControl : settingsActions.setAutoGainControl,
|
||||
setNoiseSuppression : settingsActions.setNoiseSuppression,
|
||||
setVoiceActivatedUnmute : settingsActions.setVoiceActivatedUnmute
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ const initialState =
|
|||
sampleRate : 48000,
|
||||
channelCount : 1,
|
||||
volume : 1.0,
|
||||
showAdvancedAudio : false,
|
||||
autoGainControl : false,
|
||||
echoCancellation : true,
|
||||
noiseSuppression : true,
|
||||
|
|
@ -79,6 +80,12 @@ const settings = (state = initialState, action) =>
|
|||
|
||||
return { ...state, volume };
|
||||
}
|
||||
case 'SET_SHOW_ADVANCED_AUDIO':
|
||||
{
|
||||
const { showAdvancedAudio } = action.payload;
|
||||
|
||||
return { ...state, showAdvancedAudio };
|
||||
}
|
||||
|
||||
case 'SET_AUTO_GAIN_CONTROL':
|
||||
{
|
||||
|
|
@ -122,27 +129,6 @@ const settings = (state = initialState, action) =>
|
|||
return { ...state, audio };
|
||||
}
|
||||
|
||||
case 'TOGGLE_AUTO_GAIN_CONTROL':
|
||||
{
|
||||
const autoGainControl = !state.autoGainControl;
|
||||
|
||||
return { ...state, autoGainControl };
|
||||
}
|
||||
|
||||
case 'TOGGLE_ECHO_CANCELLATION':
|
||||
{
|
||||
const echoCancellation = !state.echoCancellation;
|
||||
|
||||
return { ...state, echoCancellation };
|
||||
}
|
||||
|
||||
case 'TOGGLE_NOISE_SUPPRESSION':
|
||||
{
|
||||
const noiseSuppression = !state.noiseSuppression;
|
||||
|
||||
return { ...state, noiseSuppression };
|
||||
}
|
||||
|
||||
case 'SET_SAMPLE_SIZE':
|
||||
{
|
||||
const { sampleSize } = action.payload;
|
||||
|
|
|
|||
Loading…
Reference in New Issue