mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-15 12:35:54 +00:00
feat: add audio switch ui
This commit is contained in:
@@ -1106,6 +1106,30 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
|
||||
padding: padding,
|
||||
),
|
||||
MenuEntryDivider<String>(),
|
||||
MenuEntryRadios<String>(
|
||||
text: translate('Audio Transmission Mode'),
|
||||
optionsGetter: () => [
|
||||
MenuEntryRadioOption(
|
||||
text: translate('Guest to Host'),
|
||||
value: kRemoteAudioGuestToHost,
|
||||
dismissOnClicked: true,
|
||||
),
|
||||
MenuEntryRadioOption(
|
||||
text: translate('Two way'),
|
||||
value: kRemoteAudioTwoWay,
|
||||
dismissOnClicked: true,
|
||||
),
|
||||
],
|
||||
curOptionGetter: () async =>
|
||||
// null means peer id is not found, which there's no need to care about
|
||||
await bind.sessionGetAudioMode(id: widget.id) ?? '',
|
||||
optionSetter: (String oldValue, String newValue) async {
|
||||
if (oldValue != newValue) {
|
||||
await bind.sessionSetAudioMode(id: widget.id, value: newValue);
|
||||
}
|
||||
},
|
||||
padding: padding,
|
||||
),
|
||||
];
|
||||
|
||||
if (widget.state.viewStyle.value == kRemoteViewStyleOriginal) {
|
||||
@@ -1337,6 +1361,8 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
|
||||
if (perms['audio'] != false) {
|
||||
displayMenu
|
||||
.add(_createSwitchMenuEntry('Mute', 'disable-audio', padding, true));
|
||||
displayMenu
|
||||
.add(_createSwitchMenuEntry('Mute', 'disable-audio', padding, true));
|
||||
}
|
||||
|
||||
if (Platform.isWindows &&
|
||||
|
||||
Reference in New Issue
Block a user