Feat: better engine output device switching
This commit is contained in:
@@ -224,16 +224,16 @@ pub(super) fn handle_engine_page(ctx: &mut InputContext, key: KeyEvent) -> Input
|
||||
DeviceKind::Output => {
|
||||
let cursor = ctx.app.audio.output_list.cursor;
|
||||
if cursor < ctx.app.audio.output_devices.len() {
|
||||
let name = ctx.app.audio.output_devices[cursor].name.clone();
|
||||
ctx.dispatch(AppCommand::SetOutputDevice(name));
|
||||
let index = ctx.app.audio.output_devices[cursor].index;
|
||||
ctx.dispatch(AppCommand::SetOutputDevice(index.to_string()));
|
||||
ctx.app.save_settings(ctx.link);
|
||||
}
|
||||
}
|
||||
DeviceKind::Input => {
|
||||
let cursor = ctx.app.audio.input_list.cursor;
|
||||
if cursor < ctx.app.audio.input_devices.len() {
|
||||
let name = ctx.app.audio.input_devices[cursor].name.clone();
|
||||
ctx.dispatch(AppCommand::SetInputDevice(name));
|
||||
let index = ctx.app.audio.input_devices[cursor].index;
|
||||
ctx.dispatch(AppCommand::SetInputDevice(index.to_string()));
|
||||
ctx.app.save_settings(ctx.link);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user