History

Make Linux audio public (#23191)

Release Notes: - Added a way to use audio in rooms with Linux builds

Kirill Bulatov committed 1 year ago

Commit 2e959cb1 parent e215ca16 files · +12 −15Browse files

Unified · Split

6 files
  1. Cargo.lock +0 −1
  2. crates/call/Cargo.toml +0 −1
  3. crates/call/src/cross_platform/room.rs +3 −4
  4. crates/call/src/macos/room.rs +2 −2
  5. crates/collab/src/tests/channel_guest_tests.rs +6 −6
  6. crates/title_bar/src/collab.rs +1 −1
Cargo.lock+0−1
@@ -2039,7 +2039,6 @@ dependencies = [ · 2038 unmodified lines
20392039 "audio",
20402040 "client",
20412041 "collections",
2042− "feature_flags",
20432042 "fs",
20442043 "futures 0.3.31",
20452044 "gpui",
crates/call/Cargo.toml+0−1
@@ -28,7 +28,6 @@ anyhow.workspace = true · 27 unmodified lines
2828 audio.workspace = true
2929 client.workspace = true
3030 collections.workspace = true
31−feature_flags.workspace = true
3231 fs.workspace = true
3332 futures.workspace = true
3433 gpui.workspace = true
crates/call/src/cross_platform/room.rs+3−4
@@ -1304,13 +1304,12 @@ impl Room { · 1303 unmodified lines
13041304 self.live_kit.as_ref().map(|live_kit| live_kit.deafened)
13051305 }
13061306
1307− pub fn can_use_microphone(&self, _cx: &AppContext) -> bool {
1307+ pub fn can_use_microphone(&self) -> bool {
13081308 use proto::ChannelRole::*;
13091309
13101310 #[cfg(not(any(test, feature = "test-support")))]
13111311 {
1312− use feature_flags::FeatureFlagAppExt as _;
1313− if cfg!(target_os = "windows") || (cfg!(target_os = "linux") && !_cx.is_staff()) {
1312+ if cfg!(target_os = "windows") {
13141313 return false;
13151314 }
13161315 }
@@ -1684,7 +1683,7 @@ fn spawn_room_connection( · 367 unmodified lines
16841683 _handle_updates,
16851684 });
16861685
1687− if !muted_by_user && this.can_use_microphone(cx) {
1686+ if !muted_by_user && this.can_use_microphone() {
16881687 this.share_microphone(cx)
16891688 } else {
16901689 Task::ready(Ok(()))
crates/call/src/macos/room.rs+2−2
@@ -156,7 +156,7 @@ impl Room { · 155 unmodified lines
156156 cx.spawn(|this, mut cx| async move {
157157 connect.await?;
158158 this.update(&mut cx, |this, cx| {
159− if this.can_use_microphone(cx) {
159+ if this.can_use_microphone() {
160160 if let Some(live_kit) = &this.live_kit {
161161 if !live_kit.muted_by_user && !live_kit.deafened {
162162 return this.share_microphone(cx);
@@ -1323,7 +1323,7 @@ impl Room { · 1160 unmodified lines
13231323 self.live_kit.as_ref().map(|live_kit| live_kit.deafened)
13241324 }
13251325
1326− pub fn can_use_microphone(&self, _cx: &AppContext) -> bool {
1326+ pub fn can_use_microphone(&self) -> bool {
13271327 use proto::ChannelRole::*;
13281328 match self.local_participant.role {
13291329 Admin | Member | Talker => true,
crates/collab/src/tests/channel_guest_tests.rs+6−6
@@ -108,7 +108,7 @@ async fn test_channel_guest_promotion(cx_a: &mut TestAppContext, cx_b: &mut Test · 107 unmodified lines
108108 assert!(project_b.read_with(cx_b, |project, cx| project.is_read_only(cx)));
109109 assert!(editor_b.update(cx_b, |e, cx| e.read_only(cx)));
110110 cx_b.update(|cx_b| {
111− assert!(room_b.read_with(cx_b, |room, cx| !room.can_use_microphone(cx)));
111+ assert!(room_b.read_with(cx_b, |room, _| !room.can_use_microphone()));
112112 });
113113 assert!(room_b
114114 .update(cx_b, |room, cx| room.share_microphone(cx))
@@ -136,7 +136,7 @@ async fn test_channel_guest_promotion(cx_a: &mut TestAppContext, cx_b: &mut Test · 21 unmodified lines
136136
137137 // B sees themselves as muted, and can unmute.
138138 cx_b.update(|cx_b| {
139− assert!(room_b.read_with(cx_b, |room, cx| room.can_use_microphone(cx)));
139+ assert!(room_b.read_with(cx_b, |room, _| room.can_use_microphone()));
140140 });
141141 room_b.read_with(cx_b, |room, _| assert!(room.is_muted()));
142142 room_b.update(cx_b, |room, cx| room.toggle_mute(cx));
@@ -231,7 +231,7 @@ async fn test_channel_requires_zed_cla(cx_a: &mut TestAppContext, cx_b: &mut Tes · 88 unmodified lines
231231 .read(ActiveCall::global)
232232 .update(cx_b, |call, _| call.room().unwrap().clone());
233233 cx_b.update(|cx_b| {
234− assert!(room_b.read_with(cx_b, |room, cx| !room.can_use_microphone(cx)));
234+ assert!(room_b.read_with(cx_b, |room, _| !room.can_use_microphone()));
235235 });
236236
237237 // A tries to grant write access to B, but cannot because B has not
@@ -251,7 +251,7 @@ async fn test_channel_requires_zed_cla(cx_a: &mut TestAppContext, cx_b: &mut Tes · 13 unmodified lines
251251 cx_a.run_until_parked();
252252 assert!(room_b.read_with(cx_b, |room, _| !room.can_share_projects()));
253253 cx_b.update(|cx_b| {
254− assert!(room_b.read_with(cx_b, |room, cx| !room.can_use_microphone(cx)));
254+ assert!(room_b.read_with(cx_b, |room, _| !room.can_use_microphone()));
255255 });
256256
257257 // A tries to grant write access to B, but cannot because B has not
@@ -271,7 +271,7 @@ async fn test_channel_requires_zed_cla(cx_a: &mut TestAppContext, cx_b: &mut Tes · 13 unmodified lines
271271 cx_a.run_until_parked();
272272 assert!(room_b.read_with(cx_b, |room, _| !room.can_share_projects()));
273273 cx_b.update(|cx_b| {
274− assert!(room_b.read_with(cx_b, |room, cx| room.can_use_microphone(cx)));
274+ assert!(room_b.read_with(cx_b, |room, _| room.can_use_microphone()));
275275 });
276276
277277 // User B signs the zed CLA.
@@ -298,6 +298,6 @@ async fn test_channel_requires_zed_cla(cx_a: &mut TestAppContext, cx_b: &mut Tes · 20 unmodified lines
298298 cx_a.run_until_parked();
299299 assert!(room_b.read_with(cx_b, |room, _| room.can_share_projects()));
300300 cx_b.update(|cx_b| {
301− assert!(room_b.read_with(cx_b, |room, cx| room.can_use_microphone(cx)));
301+ assert!(room_b.read_with(cx_b, |room, _| room.can_use_microphone()));
302302 });
303303 }
crates/title_bar/src/collab.rs+1−1
@@ -295,7 +295,7 @@ impl TitleBar { · 294 unmodified lines
295295 let muted_by_user = room.muted_by_user();
296296 let is_deafened = room.is_deafened().unwrap_or(false);
297297 let is_screen_sharing = room.is_screen_sharing();
298− let can_use_microphone = room.can_use_microphone(cx);
298+ let can_use_microphone = room.can_use_microphone();
299299 let can_share_projects = room.can_share_projects();
300300 let screen_sharing_supported = match self.platform_style {
301301 PlatformStyle::Mac => true,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t