{
FluxDispatcher.dispatch({
type: "AUDIO_SET_INPUT_VOLUME",
volume
});
}} />
>
);
}
function OutputDeviceComponent() {
const [outputDevice, setOutputDevice] = useState(audioConfigModule.getOutputDeviceId());
useEffect(() => {
const listener = () => setOutputDevice(audioConfigModule.getOutputDeviceId());
FluxDispatcher.subscribe("AUDIO_SET_OUTPUT_DEVICE", listener);
});
return (
<>
{Settings.plugins.VCPanelSettings.showOutputDeviceHeader && Output device}
>
);
}
function InputDeviceComponent() {
const [inputDevice, setInputDevice] = useState(audioConfigModule.getInputDeviceId());
useEffect(() => {
const listener = () => setInputDevice(audioConfigModule.getInputDeviceId());
FluxDispatcher.subscribe("AUDIO_SET_INPUT_DEVICE", listener);
});
return (
{Settings.plugins.VCPanelSettings.showInputDeviceHeader && Input device}
);
}
function VoiceSettings() {
return
{Settings.plugins.VCPanelSettings.outputVolume && }
{Settings.plugins.VCPanelSettings.inputVolume && }
{Settings.plugins.VCPanelSettings.outputDevice && }
{Settings.plugins.VCPanelSettings.inputDevice && }
;
}
export default definePlugin({
name: "VCPanelSettings",
description: "Control voice settings right from the voice panel",
authors: [Devs.nin0dev],
settings: definePluginSettings({
showOutputVolumeHeader: {
type: OptionType.BOOLEAN,
default: true,
description: "Show header above output volume slider"
},
outputVolume: {
type: OptionType.BOOLEAN,
default: true,
description: "Show an output volume slider"
},
showInputVolumeHeader: {
type: OptionType.BOOLEAN,
default: true,
description: "Show header above input volume slider"
},
inputVolume: {
type: OptionType.BOOLEAN,
default: true,
description: "Show an input volume slider"
},
showOutputDeviceHeader: {
type: OptionType.BOOLEAN,
default: false,
description: "Show header above output device slider"
},
outputDevice: {
type: OptionType.BOOLEAN,
default: true,
description: "Show an output device selector"
},
showInputDeviceHeader: {
type: OptionType.BOOLEAN,
default: false,
description: "Show header above input device slider"
},
inputDevice: {
type: OptionType.BOOLEAN,
default: true,
description: "Show an input device selector"
}
}),
renderVoiceSettings() { return ; },
patches: [
{
find: "this.renderChannelButtons()",
replacement: {
match: /this.renderChannelButtons\(\)/,
replace: "this.renderChannelButtons(), $self.renderVoiceSettings()"
}
}
]
});