2022-01-13 12:15:53 +00:00
|
|
|
import type { Dispatch } from 'redux';
|
|
|
|
|
2022-06-20 14:53:19 +00:00
|
|
|
import { openSheet } from '../../../base/dialog';
|
2022-01-13 12:15:53 +00:00
|
|
|
import { translate } from '../../../base/i18n';
|
2022-11-08 10:24:32 +00:00
|
|
|
import { IconVolumeUp } from '../../../base/icons';
|
2022-01-13 12:15:53 +00:00
|
|
|
import { connect } from '../../../base/redux';
|
|
|
|
import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox/components';
|
|
|
|
|
|
|
|
import AudioRoutePickerDialog from './AudioRoutePickerDialog';
|
|
|
|
|
|
|
|
type Props = AbstractButtonProps & {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The Redux dispatch function.
|
|
|
|
*/
|
|
|
|
dispatch: Dispatch<any>
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements an {@link AbstractButton} to open the audio device list.
|
|
|
|
*/
|
|
|
|
class AudioDeviceToggleButton extends AbstractButton<Props, *> {
|
|
|
|
accessibilityLabel = 'toolbar.accessibilityLabel.audioRoute';
|
2022-11-08 10:24:32 +00:00
|
|
|
icon = IconVolumeUp;
|
2022-01-13 12:15:53 +00:00
|
|
|
label = 'toolbar.accessibilityLabel.audioRoute';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handles clicking / pressing the button, and opens the appropriate dialog.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_handleClick() {
|
2022-06-20 14:53:19 +00:00
|
|
|
this.props.dispatch(openSheet(AudioRoutePickerDialog));
|
2022-01-13 12:15:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export default translate(connect()(AudioDeviceToggleButton));
|