mirror of
https://github.com/zed-industries/zed.git
synced 2024-10-06 10:57:40 +03:00
add test actions for setting audio output
This commit is contained in:
parent
01a5110387
commit
6429dce6a5
@ -1060,6 +1060,11 @@ impl Room {
|
||||
self.live_kit.as_ref().map(|live_kit| live_kit.deafened)
|
||||
}
|
||||
|
||||
pub fn test_set_audio(&mut self, _cx: &mut ModelContext<Self>) {
|
||||
let output = live_kit_client::Room::audio_output_sources();
|
||||
dbg!(output.get(2).map(|device| device.set()));
|
||||
}
|
||||
|
||||
pub fn share_microphone(&mut self, cx: &mut ModelContext<Self>) -> Task<Result<()>> {
|
||||
if self.status.is_offline() {
|
||||
return Task::ready(Err(anyhow!("room is offline")));
|
||||
|
@ -23,7 +23,8 @@ actions!(
|
||||
ToggleMute,
|
||||
ToggleDeafen,
|
||||
LeaveCall,
|
||||
ShareMicrophone
|
||||
ShareMicrophone,
|
||||
SetThirdAudioOutput,
|
||||
]
|
||||
);
|
||||
|
||||
@ -40,6 +41,7 @@ pub fn init(app_state: &Arc<AppState>, cx: &mut AppContext) {
|
||||
cx.add_global_action(toggle_mute);
|
||||
cx.add_global_action(toggle_deafen);
|
||||
cx.add_global_action(share_microphone);
|
||||
cx.add_global_action(test);
|
||||
}
|
||||
|
||||
pub fn toggle_screen_sharing(_: &ToggleScreenSharing, cx: &mut AppContext) {
|
||||
@ -77,3 +79,9 @@ pub fn share_microphone(_: &ShareMicrophone, cx: &mut AppContext) {
|
||||
.detach_and_log_err(cx)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn test(_: &SetThirdAudioOutput, cx: &mut AppContext) {
|
||||
if let Some(room) = ActiveCall::global(cx).read(cx).room().cloned() {
|
||||
room.update(cx, Room::test_set_audio)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user