Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/instant-reliability.yml
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,11 @@ jobs:
run: |
set -euo pipefail
sudo apt-get update -qq
# v4l2loopback needs videodev, which is in the extra kernel modules.
sudo apt-get install -y -qq "linux-modules-extra-$(uname -r)" v4l2loopback-dkms xvfb x11-utils xdotool \
if ! sudo modprobe videodev 2>/dev/null; then
sudo apt-get install -y -qq "linux-modules-extra-$(uname -r)"
sudo modprobe videodev
fi
sudo apt-get install -y -qq "linux-headers-$(uname -r)" v4l2loopback-dkms xvfb x11-utils xdotool \
dbus ffmpeg pulseaudio pulseaudio-utils libasound2-plugins >/dev/null
chmod +x "$RUNNER_TEMP/build/cap-gpui" "$RUNNER_TEMP/build/real-app-tests"
sudo modprobe v4l2loopback video_nr=42 card_label="Cap Test Camera" exclusive_caps=1
Expand Down
4 changes: 4 additions & 0 deletions apps/desktop-gpui/locales/de.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2445,16 +2445,20 @@ advanced_shadow = "Erweiterte Schatteneinstellungen"
background = "Hintergrund"
corner_style = "Eckenstil"
custom_position = "Eigene Position (auf der Leinwand verschoben)"
finding_silences = "Stille wird gesucht ..."
hide = "Kamera ausblenden"
hide_when_silent = "Bei Stille ausblenden"
keep_size_during_zoom = "Originalgröße beim Zoomen beibehalten"
mirror = "Kamera spiegeln"
no_silence_found = "Keine langen Stillen, in denen die Kamera ausgeblendet werden könnte."
position = "Position"
reset = "Zurücksetzen"
rounded_corners = "Abgerundete Ecken"
shadow = "Schatten"
shadow_blur = "Unschärfe"
shadow_opacity = "Deckkraft"
shape_label = "Form"
silence_delay = "Stille vor dem Ausblenden"
size_during_zoom = "Größe beim Zoomen"
size_label = "Größe"
title = "Kamera"
Expand Down
4 changes: 4 additions & 0 deletions apps/desktop-gpui/locales/en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2447,16 +2447,20 @@ advanced_shadow = "Advanced shadow settings"
background = "Background"
corner_style = "Corner Style"
custom_position = "Custom position (dragged on canvas)"
finding_silences = "Finding the silences..."
hide = "Hide Camera"
hide_when_silent = "Hide When Silent"
keep_size_during_zoom = "Keep original size during zoom"
mirror = "Mirror Camera"
no_silence_found = "No long silences to hide the camera for."
position = "Position"
reset = "Reset"
rounded_corners = "Rounded Corners"
shadow = "Shadow"
shadow_blur = "Blur"
shadow_opacity = "Opacity"
shape_label = "Shape"
silence_delay = "Silence Before Hiding"
size_during_zoom = "Size During Zoom"
size_label = "Size"
title = "Camera"
Expand Down
4 changes: 4 additions & 0 deletions apps/desktop-gpui/locales/es.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2445,16 +2445,20 @@ advanced_shadow = "Ajustes avanzados de sombra"
background = "Fondo"
corner_style = "Estilo de esquinas"
custom_position = "Posición personalizada (arrastrada en el lienzo)"
finding_silences = "Buscando los silencios..."
hide = "Ocultar cámara"
hide_when_silent = "Ocultar en silencio"
keep_size_during_zoom = "Mantener el tamaño original durante el zoom"
mirror = "Reflejar cámara"
no_silence_found = "No hay silencios largos en los que ocultar la cámara."
position = "Posición"
reset = "Restablecer"
rounded_corners = "Esquinas redondeadas"
shadow = "Sombra"
shadow_blur = "Desenfoque"
shadow_opacity = "Opacidad"
shape_label = "Forma"
silence_delay = "Silencio antes de ocultar"
size_during_zoom = "Tamaño durante el zoom"
size_label = "Tamaño"
title = "Cámara"
Expand Down
4 changes: 4 additions & 0 deletions apps/desktop-gpui/locales/fr.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2445,16 +2445,20 @@ advanced_shadow = "Réglages avancés de l'ombre"
background = "Arrière-plan"
corner_style = "Style des coins"
custom_position = "Position personnalisée (déplacée sur le canevas)"
finding_silences = "Recherche des silences..."
hide = "Masquer la caméra"
hide_when_silent = "Masquer en cas de silence"
keep_size_during_zoom = "Conserver la taille d'origine pendant le zoom"
mirror = "Effet miroir"
no_silence_found = "Aucun long silence pendant lequel masquer la caméra."
position = "Position"
reset = "Réinitialiser"
rounded_corners = "Coins arrondis"
shadow = "Ombre"
shadow_blur = "Flou"
shadow_opacity = "Opacité"
shape_label = "Forme"
silence_delay = "Silence avant masquage"
size_during_zoom = "Taille pendant le zoom"
size_label = "Taille"
title = "Caméra"
Expand Down
4 changes: 4 additions & 0 deletions apps/desktop-gpui/locales/hi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2445,16 +2445,20 @@ advanced_shadow = "छाया की एडवांस्ड सेटिं
background = "बैकग्राउंड"
corner_style = "कोने की स्टाइल"
custom_position = "कस्टम पोज़िशन (कैनवास पर ड्रैग की गई)"
finding_silences = "चुप्पी ढूँढी जा रही है..."
hide = "कैमरा छिपाएँ"
hide_when_silent = "चुप रहने पर छिपाएँ"
keep_size_during_zoom = "ज़ूम के दौरान मूल आकार बनाए रखें"
mirror = "कैमरा मिरर करें"
no_silence_found = "कैमरा छिपाने लायक कोई लंबी चुप्पी नहीं मिली।"
position = "पोज़िशन"
reset = "रीसेट करें"
rounded_corners = "गोल कोने"
shadow = "छाया"
shadow_blur = "ब्लर"
shadow_opacity = "अपारदर्शिता"
shape_label = "आकृति"
silence_delay = "छिपाने से पहले की चुप्पी"
size_during_zoom = "ज़ूम के दौरान आकार"
size_label = "आकार"
title = "कैमरा"
Expand Down
4 changes: 4 additions & 0 deletions apps/desktop-gpui/locales/ja.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2445,16 +2445,20 @@ advanced_shadow = "影の詳細設定"
background = "背景"
corner_style = "角のスタイル"
custom_position = "カスタム位置(キャンバス上でドラッグ)"
finding_silences = "無音部分を探しています..."
hide = "カメラを非表示"
hide_when_silent = "無音時に隠す"
keep_size_during_zoom = "ズーム中も元のサイズを保つ"
mirror = "カメラを反転"
no_silence_found = "カメラを隠せる長い無音部分はありません。"
position = "位置"
reset = "リセット"
rounded_corners = "角の丸み"
shadow = "影"
shadow_blur = "ぼかし"
shadow_opacity = "不透明度"
shape_label = "形"
silence_delay = "隠すまでの無音時間"
size_during_zoom = "ズーム中のサイズ"
size_label = "サイズ"
title = "カメラ"
Expand Down
4 changes: 4 additions & 0 deletions apps/desktop-gpui/locales/zh-CN.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2445,16 +2445,20 @@ advanced_shadow = "高级阴影设置"
background = "背景"
corner_style = "圆角样式"
custom_position = "自定义位置(在画布上拖动)"
finding_silences = "正在查找静音片段..."
hide = "隐藏摄像头"
hide_when_silent = "静音时隐藏"
keep_size_during_zoom = "缩放时保持原始大小"
mirror = "镜像摄像头"
no_silence_found = "没有可隐藏摄像头的长静音片段。"
position = "位置"
reset = "重置"
rounded_corners = "圆角"
shadow = "阴影"
shadow_blur = "模糊"
shadow_opacity = "不透明度"
shape_label = "形状"
silence_delay = "隐藏前的静音时长"
size_during_zoom = "缩放时的大小"
size_label = "大小"
title = "摄像头"
Expand Down
1 change: 1 addition & 0 deletions apps/desktop-gpui/src/editor_edits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1853,6 +1853,7 @@ pub fn default_scene_segment(start: f64, end: f64) -> SceneSegment {
split_layout: None,
transition_in: 0.3,
transition_out: 0.3,
from_silence: false,
}
}

Expand Down
1 change: 1 addition & 0 deletions apps/desktop-gpui/src/editor_panels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6626,6 +6626,7 @@ impl EditorWindow {
let mode = *mode;
self.edit_scene_segment("scene-mode", index, window, cx, move |segment| {
segment.mode = mode;
segment.from_silence = false;
// Seed identity overrides so a new split segment renders and the
// fine-tune controls have values to bind to (`:6361-6371`).
if matches!(mode, SceneMode::SplitScreen | SceneMode::Floating)
Expand Down
3 changes: 3 additions & 0 deletions apps/desktop-gpui/src/editor_sidebar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1301,6 +1301,9 @@ impl EditorWindow {
// Every grade slider is `Math.round(value * 100)` in the UI and
// `v / 100` back into the config (`ColorCorrectionSection.tsx:181`).
SliderKey::Grade(target, slider) => (slider.read(self.grade(target)) * 100.).round(),
SliderKey::Camera(CameraSlider::SilenceDelay) => self
.pending_silence_delay()
.unwrap_or_else(|| CameraSlider::SilenceDelay.read(&project)),
SliderKey::Camera(slider) => slider.read(&project),
SliderKey::Audio(slider) => slider.read(&project),
SliderKey::ClipVolume(index) => self
Expand Down
58 changes: 58 additions & 0 deletions apps/desktop-gpui/src/editor_tabs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ pub enum CameraSlider {
ShadowSize,
ShadowOpacity,
ShadowBlur,
SilenceDelay,
}

impl CameraSlider {
Expand All @@ -409,6 +410,7 @@ impl CameraSlider {
| Self::ShadowSize
| Self::ShadowOpacity
| Self::ShadowBlur => false,
Self::SilenceDelay => true,
}
}

Expand All @@ -417,6 +419,10 @@ impl CameraSlider {
// `minValue={20} maxValue={80} step={0.1}` (`:3204-3206`).
Self::Size => (20., 80., 0.1),
Self::ZoomSize => (10., 100., 0.1),
Self::SilenceDelay => {
let (min, max) = ProjectConfiguration::CAMERA_SILENCE_DELAY_RANGE;
(min, max, 0.1)
}
_ => (0., 100., 0.1),
}
}
Expand All @@ -432,6 +438,9 @@ impl CameraSlider {
Self::ShadowSize => shadow.map_or(UI_SHADOW_FALLBACK.size, |s| s.size),
Self::ShadowOpacity => shadow.map_or(UI_SHADOW_FALLBACK.opacity, |s| s.opacity),
Self::ShadowBlur => shadow.map_or(UI_SHADOW_FALLBACK.blur, |s| s.blur),
Self::SilenceDelay => project
.camera_silence_delay
.unwrap_or(ProjectConfiguration::CAMERA_SILENCE_DELAY_DEFAULT),
}
}
}
Expand Down Expand Up @@ -1200,6 +1209,10 @@ impl EditorWindow {
window: &mut Window,
cx: &mut Context<Self>,
) {
if slider == CameraSlider::SilenceDelay {
self.set_camera_silence_delay(value, window, cx);
return;
}
self.edit_project_with_rebuild(
slider.changes_timeline_model(),
"camera-slider",
Expand All @@ -1226,6 +1239,7 @@ impl EditorWindow {
}
camera.advanced_shadow = Some(shadow);
}
CameraSlider::SilenceDelay => {}
}
true
},
Expand Down Expand Up @@ -1516,6 +1530,11 @@ impl EditorWindow {
),
),
)
.children(
self.summary()
.is_some_and(|summary| summary.has_microphone)
.then(|| self.render_camera_silence(cx)),
)
// `<div class="w-full border-t border-dashed border-gray-5" />`
.child(dashed_divider(Hsla::from(theme.editor.line)))
.child(self.slider_field(
Expand Down Expand Up @@ -1618,6 +1637,45 @@ impl EditorWindow {
.into_any_element()
}

fn render_camera_silence(&self, cx: &mut Context<Self>) -> AnyElement {
let theme = self.theme;
let enabled = self.project.camera_silence_delay.is_some();
let enabling = self.enabling_camera_silence();
let toggle = ui::Subfield::plain(&theme, tr::editor::tabs::camera::hide_when_silent())
.child(
ui::Toggle::plain(
&theme,
"camera-hide-when-silent",
enabled || enabling,
)
.on_click(cx.listener(|this, _, window, cx| {
this.toggle_camera_silence(window, cx);
})),
);
div()
.flex()
.flex_col()
.gap(px(14.))
.child(toggle)
.when(enabling || self.pending_silence_delay().is_some(), |column| {
column.child(
div()
.text_size(px(12.))
.text_color(Hsla::from(theme.gray_10))
.child(tr::editor::tabs::camera::finding_silences()),
)
})
.when(enabled, |column| {
column.child(self.slider_field(
tr::editor::tabs::camera::silence_delay(),
SliderKey::Camera(CameraSlider::SilenceDelay),
"s",
cx,
))
})
.into_any_element()
}

/// `CornerStyleSelect` (`:3331-3396`), now an inline row.
fn corner_style_select(
&self,
Expand Down
23 changes: 21 additions & 2 deletions apps/desktop-gpui/src/editor_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ use crate::{
mod frame;
mod loading;
mod scenes;
mod silence;
mod snap;

// ---------------------------------------------------------------------------
Expand Down Expand Up @@ -1456,6 +1457,9 @@ pub struct EditorWindow {
timeline_locale: crate::i18n::Locale,
zoom_prompt_dismissed: bool,
hovering_generate_zoom: bool,
analyzing_speech: bool,
speech_request: Option<silence::SpeechRequest>,
clip_speech: Option<Arc<Vec<Option<cap_rendering::ClipSpeech>>>>,
pub(crate) generating_keyboard: bool,
pub(crate) keyboard_generation_message: Option<String>,
clip_speed: Option<ClipSpeedMenu>,
Expand Down Expand Up @@ -2115,6 +2119,9 @@ impl EditorWindow {
timeline_locale: crate::i18n::current(),
zoom_prompt_dismissed: false,
hovering_generate_zoom: false,
analyzing_speech: false,
speech_request: None,
clip_speech: None,
generating_keyboard: false,
keyboard_generation_message: None,
clip_speed: None,
Expand Down Expand Up @@ -2635,6 +2642,7 @@ impl EditorWindow {
window: &mut Window,
cx: &mut Context<Self>,
) {
self.speech_request = None;
self.sidebar.style_target = None;
self.sidebar.menu = None;
self.text_menu = None;
Expand Down Expand Up @@ -6332,8 +6340,18 @@ impl EditorWindow {
{
self.set_selection(None, cx);
}
let cleared = self.edit(
|timeline| match kind {
if kind == TrackKind::Scene {
self.speech_request = None;
}
let cleared = self.edit_timeline_project(
|project| {
if kind == TrackKind::Scene {
project.camera_silence_delay = None;
}
let Some(timeline) = project.timeline.as_mut() else {
return false;
};
match kind {
TrackKind::Zoom => {
let had = !timeline.zoom_segments.is_empty();
timeline.zoom_segments.clear();
Expand All @@ -6350,6 +6368,7 @@ impl EditorWindow {
had
}
_ => false,
}
},
window,
cx,
Expand Down
Loading
Loading