Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat: Add new audio volume slider in editor (#426)

Richie McIlroy40db5c7e31c4
diff --git a/Cargo.lock b/Cargo.lock
index 45b06e7ab..d9925458b 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2266,16 +2266,6 @@ dependencies = [
"dirs-sys",
]
-[[package]]
-name = "dirs-next"
-version = "2.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1"
-dependencies = [
- "cfg-if 1.0.0",
- "dirs-sys-next",
-]
-
[[package]]
name = "dirs-sys"
version = "0.5.0"
@@ -2284,21 +2274,10 @@ checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab"
dependencies = [
"libc",
"option-ext",
- "redox_users 0.5.0",
+ "redox_users",
"windows-sys 0.59.0",
]
-[[package]]
-name = "dirs-sys-next"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d"
-dependencies = [
- "libc",
- "redox_users 0.4.6",
- "winapi",
-]
-
[[package]]
name = "dispatch"
version = "0.2.0"
@@ -4176,14 +4155,13 @@ checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4"
[[package]]
name = "mac-notification-sys"
-version = "0.6.2"
+version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dce8f34f3717aa37177e723df6c1fc5fb02b2a1087374ea3fe0ea42316dc8f91"
+checksum = "0b95dfb34071d1592b45622bf93e315e3a72d414b6782aca9a015c12bec367ef"
dependencies = [
"cc",
- "dirs-next",
- "objc-foundation",
- "objc_id",
+ "objc2 0.6.0",
+ "objc2-foundation 0.3.0",
"time",
]
@@ -6052,17 +6030,6 @@ dependencies = [
"bitflags 2.9.0",
]
-[[package]]
-name = "redox_users"
-version = "0.4.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43"
-dependencies = [
- "getrandom 0.2.15",
- "libredox",
- "thiserror 1.0.69",
-]
-
[[package]]
name = "redox_users"
version = "0.5.0"
diff --git a/apps/desktop/src/routes/editor/ConfigSidebar.tsx b/apps/desktop/src/routes/editor/ConfigSidebar.tsx
index 905a5a945..8514138f3 100644
--- a/apps/desktop/src/routes/editor/ConfigSidebar.tsx
+++ b/apps/desktop/src/routes/editor/ConfigSidebar.tsx
@@ -1395,8 +1395,11 @@ export function ConfigSidebar() {
</Field>
</KTabs.Content>
<KTabs.Content value="audio" class="flex flex-col gap-6">
- <Field name="Audio" icon={<IconCapAudioOn />}>
- <div class="flex flex-col gap-3">
+ <Field
+ name="Audio Controls"
+ icon={<IconLucideVolume2 class="size-4" />}
+ >
+ <div class="space-y-2">
<Subfield name="Mute Audio">
<Toggle
checked={project.audio.mute}
@@ -1410,6 +1413,40 @@ export function ConfigSidebar() {
</ComingSoonTooltip> */}
</div>
</Field>
+ <Field
+ name="Microphone Volume"
+ icon={<IconCapMicrophone class="size-4" />}
+ >
+ <Slider
+ disabled={project.audio.mute}
+ value={[project.audio.micVolumeDb ?? 0]}
+ onChange={(v) => setProject("audio", "micVolumeDb", v[0])}
+ minValue={-30}
+ maxValue={10}
+ step={0.1}
+ formatTooltip={(v) =>
+ v <= -30 ? "Muted" : `${v > 0 ? "+" : ""}${v.toFixed(1)} dB`
+ }
+ />
+ </Field>
+ {editorInstance.meta.hasSystemAudio && (
+ <Field
+ name="System Audio Volume"
+ icon={<IconLucideMonitor class="size-4" />}
+ >
+ <Slider
+ disabled={project.audio.mute}
+ value={[project.audio.systemVolumeDb ?? 0]}
+ onChange={(v) => setProject("audio", "systemVolumeDb", v[0])}
+ minValue={-30}
+ maxValue={10}
+ step={0.1}
+ formatTooltip={(v) =>
+ v <= -30 ? "Muted" : `${v > 0 ? "+" : ""}${v.toFixed(1)} dB`
+ }
+ />
+ </Field>
+ )}
</KTabs.Content>
<KTabs.Content value="cursor" class="flex flex-col gap-6">
<Field name="Cursor" icon={<IconCapCursor />}>
diff --git a/apps/desktop/src/routes/editor/context.ts b/apps/desktop/src/routes/editor/context.ts
index d58dcf914..8b8b7b725 100644
--- a/apps/desktop/src/routes/editor/context.ts
+++ b/apps/desktop/src/routes/editor/context.ts
@@ -285,7 +285,22 @@ function transformMeta(instance: SerializedEditorInstance) {
} as unknown as SingleSegment & { type: "single" };
}
- return { ...meta, prettyName: instance.meta.pretty_name };
+ return {
+ ...meta,
+ prettyName: instance.meta.pretty_name,
+ hasCamera: (() => {
+ if (meta.type === "single") return !!meta.camera;
+ return !!meta.segments[0].camera;
+ })(),
+ hasSystemAudio: (() => {
+ if (meta.type === "single") return false;
+ return !!meta.segments[0].system_audio;
+ })(),
+ hasMicrophone: (() => {
+ if (meta.type === "single") return !!meta.audio;
+ return !!meta.segments[0].mic;
+ })(),
+ };
}
export type TransformedMeta = ReturnType<typeof transformMeta>;
diff --git a/apps/desktop/src/utils/tauri.ts b/apps/desktop/src/utils/tauri.ts
index e5c9ed19a..c596b1668 100644
--- a/apps/desktop/src/utils/tauri.ts
+++ b/apps/desktop/src/utils/tauri.ts
@@ -222,7 +222,7 @@ uploadProgress: "upload-progress"
export type AppTheme = "system" | "light" | "dark"
export type AspectRatio = "wide" | "vertical" | "square" | "classic" | "tall"
export type Audio = { duration: number; sample_rate: number; channels: number; start_time: number }
-export type AudioConfiguration = { mute: boolean; improve: boolean }
+export type AudioConfiguration = { mute: boolean; improve: boolean; micVolumeDb?: number; systemVolumeDb?: number }
export type AudioInputLevelChange = number
export type AudioMeta = { path: string;
/**
diff --git a/crates/audio/src/renderer.rs b/crates/audio/src/renderer.rs
index 9633e2704..4ea38c9db 100644
--- a/crates/audio/src/renderer.rs
+++ b/crates/audio/src/renderer.rs
@@ -2,7 +2,7 @@ use crate::AudioData;
// Renders a combination of audio tracks into a single stereo buffer
pub fn render_audio(
- tracks: &[&AudioData],
+ tracks: &[(&AudioData, f32)],
offset: usize,
samples: usize,
out_offset: usize,
@@ -10,7 +10,7 @@ pub fn render_audio(
) -> usize {
if tracks
.iter()
- .any(|t| (t.samples().len() / t.channels() as usize) < offset)
+ .any(|t| (t.0.samples().len() / t.0.channels() as usize) < offset)
{
return 0;
}
@@ -18,7 +18,7 @@ pub fn render_audio(
let samples = samples.min(
tracks
.iter()
- .map(|t| (t.samples().len() / t.channels() as usize) - offset)
+ .map(|t| (t.0.samples().len() / t.0.channels() as usize) - offset)
.min()
.unwrap_or(usize::MAX),
);
@@ -28,12 +28,18 @@ pub fn render_audio(
let mut right = 0.0;
for track in tracks {
- if track.channels() == 1 {
- left += track.samples()[offset + i] * 0.707;
- right += track.samples()[offset + i] * 0.707;
+ let gain = gain_for_db(track.1);
+
+ if gain == f32::NEG_INFINITY {
+ continue;
+ }
+
+ if track.0.channels() == 1 {
+ left += track.0.samples()[offset + i] * 0.707 * gain;
+ right += track.0.samples()[offset + i] * 0.707 * gain;
} else {
- left += track.samples()[offset * 2 + i * 2];
- right += track.samples()[offset * 2 + i * 2 + 1];
+ left += track.0.samples()[offset * 2 + i * 2] * gain;
+ right += track.0.samples()[offset * 2 + i * 2 + 1] * gain;
}
}
@@ -43,3 +49,14 @@ pub fn render_audio(
samples
}
+
+fn gain_for_db(db: f32) -> f32 {
+ match db {
+ // Fully mute when at minimum
+ v if v <= -30.0 => f32::NEG_INFINITY,
+ v => db_to_linear(v),
+ }
+}
+fn db_to_linear(db: f32) -> f32 {
+ 10.0_f32.powf(db / 20.0)
+}
diff --git a/crates/editor/src/playback.rs b/crates/editor/src/playback.rs
index 148d57406..2da135954 100644
--- a/crates/editor/src/playback.rs
+++ b/crates/editor/src/playback.rs
@@ -1,14 +1,16 @@
use std::{sync::Arc, time::Duration};
-use cap_media::data::{AudioInfo, AudioInfoError, FromSampleBytes};
-use cap_media::feeds::{AudioPlaybackBuffer, AudioTrack};
-use cap_project::{ProjectConfiguration, XY};
+use cap_media::data::{AudioInfo, FromSampleBytes};
+use cap_media::feeds::{AudioPlaybackBuffer, AudioSegment, AudioSegmentTrack};
+use cap_media::MediaError;
+use cap_project::{AudioConfiguration, ProjectConfiguration, XY};
use cap_rendering::{ProjectUniforms, RenderVideoConstants};
use cpal::{
traits::{DeviceTrait, HostTrait, StreamTrait},
BufferSize, SampleFormat,
};
use tokio::{sync::watch, time::Instant};
+use tracing::{error, info};
use crate::editor;
use crate::editor_instance::Segment;
@@ -60,11 +62,18 @@ impl Playback {
segments: self
.segments
.iter()
- .map(|s| {
- [s.audio.clone(), s.system_audio.clone()]
- .into_iter()
- .flatten()
- .collect::<Vec<_>>()
+ .map(|s| AudioSegment {
+ tracks: [
+ s.audio
+ .clone()
+ .map(|a| AudioSegmentTrack::new(a, |c| c.mic_volume_db)),
+ s.system_audio
+ .clone()
+ .map(|a| AudioSegmentTrack::new(a, |c| c.system_volume_db)),
+ ]
+ .into_iter()
+ .flatten()
+ .collect::<Vec<_>>(),
})
.collect::<Vec<_>>(),
stop_rx: stop_rx.clone(),
@@ -139,7 +148,7 @@ impl PlaybackHandle {
}
struct AudioPlayback {
- segments: Vec<AudioTrack>,
+ segments: Vec<AudioSegment>,
stop_rx: watch::Receiver<bool>,
start_frame_number: u32,
project: watch::Receiver<ProjectConfiguration>,
@@ -150,46 +159,79 @@ impl AudioPlayback {
fn spawn(self) {
let handle = tokio::runtime::Handle::current();
- if self.segments[0].is_empty() {
+ if self.segments.is_empty() || self.segments[0].tracks.is_empty() {
+ info!("No audio segments found, skipping audio playback thread.");
return;
}
std::thread::spawn(move || {
let host = cpal::default_host();
- let device = host.default_output_device().unwrap();
- println!("Output device: {}", device.name().unwrap());
- let supported_config = device
- .default_output_config()
- .expect("Failed to get default output format");
-
- let (mut stop_rx, stream) = match supported_config.sample_format() {
- // SampleFormat::I8 => create_stream::<i8>(shared_data),
+ let device = match host.default_output_device() {
+ Some(d) => d,
+ None => {
+ error!("No default output device found. Skipping audio playback.");
+ return;
+ }
+ };
+ let supported_config = match device.default_output_config() {
+ Ok(sc) => sc,
+ Err(e) => {
+ error!(
+ "Failed to get default output config: {}. Skipping audio playback.",
+ e
+ );
+ return;
+ }
+ };
+
+ let result = match supported_config.sample_format() {
SampleFormat::I16 => self.create_stream::<i16>(device, supported_config),
SampleFormat::I32 => self.create_stream::<i32>(device, supported_config),
+ SampleFormat::F32 => self.create_stream::<f32>(device, supported_config),
SampleFormat::I64 => self.create_stream::<i64>(device, supported_config),
SampleFormat::U8 => self.create_stream::<u8>(device, supported_config),
- // SampleFormat::U16 => create_stream::<u16>(shared_data),
- // SampleFormat::U32 => create_stream::<u32>(shared_data),
- // SampleFormat::U64 => create_stream::<u64>(shared_data),
- SampleFormat::F32 => self.create_stream::<f32>(device, supported_config),
SampleFormat::F64 => self.create_stream::<f64>(device, supported_config),
- _ => unimplemented!(),
- }
- .unwrap();
+ format => {
+ error!(
+ "Unsupported sample format {:?} for simplified volume adjustment, skipping audio playback.",
+ format
+ );
+ return;
+ }
+ };
- stream.play().unwrap();
+ let (mut stop_rx, stream) = match result {
+ Ok(s) => s,
+ Err(e) => {
+ error!(
+ "Failed to create audio stream: {}. Skipping audio playback.",
+ e
+ );
+ return;
+ }
+ };
- handle.block_on(stop_rx.changed()).ok();
+ if let Err(e) = stream.play() {
+ error!(
+ "Failed to play audio stream: {}. Skipping audio playback.",
+ e
+ );
+ return;
+ }
- stream.pause().ok();
+ let _ = handle.block_on(stop_rx.changed());
+ info!("Audio playback thread finished.");
});
}
- fn create_stream<T: FromSampleBytes>(
+ fn create_stream<T>(
self,
device: cpal::Device,
supported_config: cpal::SupportedStreamConfig,
- ) -> Result<(watch::Receiver<bool>, cpal::Stream), AudioInfoError> {
+ ) -> Result<(watch::Receiver<bool>, cpal::Stream), MediaError>
+ where
+ T: FromSampleBytes + cpal::Sample,
+ {
let AudioPlayback {
stop_rx,
start_frame_number,
@@ -202,41 +244,41 @@ impl AudioPlayback {
let mut output_info = AudioInfo::from_stream_config(&supported_config);
output_info.sample_format = output_info.sample_format.packed();
- // TODO: Get fps and duration from video (once we start supporting other frame rates)
- // Also, it's a bit weird that self.duration can ever be infinity to begin with, since
- // pre-recorded videos are obviously a fixed size
let mut audio_renderer = AudioPlaybackBuffer::new(segments, output_info);
let playhead = f64::from(start_frame_number) / f64::from(fps);
audio_renderer.set_playhead(playhead, &project.borrow());
- // Prerender enough for smooth playback
- // disabled bc it causes weirdness during playback atm
- // while !audio_renderer.buffer_reaching_limit() {
- // audio_renderer.render(project.borrow().timeline());
- // }
-
let mut config = supported_config.config();
- // Low-latency playback
config.buffer_size = BufferSize::Fixed(AudioPlaybackBuffer::<T>::PLAYBACK_SAMPLES_COUNT);
- let stream = device
- .build_output_stream(
- &config,
- move |buffer: &mut [T], _info| {
- let project = project.borrow();
- audio_renderer.render(&project);
- audio_renderer.fill(buffer);
-
- if project.audio.mute {
- for sample in buffer.iter_mut() {
- *sample = T::EQUILIBRIUM;
- }
- }
- },
- |_| {},
- None,
- )
- .unwrap();
+ let mut elapsed = 0;
+ let mut prev_audio_config = project.borrow().audio.clone();
+
+ let stream_result = device.build_output_stream(
+ &config,
+ move |buffer: &mut [T], _info| {
+ let project = project.borrow();
+
+ if prev_audio_config != project.audio {
+ audio_renderer.set_playhead(
+ playhead + elapsed as f64 / output_info.sample_rate as f64,
+ &project,
+ );
+ prev_audio_config = project.audio.clone();
+ }
+
+ audio_renderer.render(&project);
+ audio_renderer.fill(buffer);
+
+ elapsed += buffer.len() / output_info.channels;
+ },
+ |_err| eprintln!("Audio stream error: {}", _err),
+ None,
+ );
+
+ let stream = stream_result.map_err(|e| {
+ MediaError::TaskLaunch(format!("Failed to build audio output stream: {}", e))
+ })?;
Ok((stop_rx, stream))
}
diff --git a/crates/export/src/lib.rs b/crates/export/src/lib.rs
index d615707aa..b850dd58b 100644
--- a/crates/export/src/lib.rs
+++ b/crates/export/src/lib.rs
@@ -4,11 +4,12 @@ use cap_media::{
cast_bytes_to_f32_slice, cast_f32_slice_to_bytes, AudioInfo, RawVideoFormat, VideoInfo,
},
encoders::{H264Encoder, MP4Input, OpusEncoder},
- feeds::{AudioRenderer, AudioTrack},
+ feeds::{AudioRenderer, AudioSegment, AudioSegmentTrack},
MediaError,
};
use cap_project::{
- ProjectConfiguration, RecordingMeta, RecordingMetaInner, StudioRecordingMeta, XY,
+ AudioConfiguration, ProjectConfiguration, RecordingMeta, RecordingMetaInner,
+ StudioRecordingMeta, XY,
};
use cap_rendering::{
ProjectRecordings, ProjectUniforms, RecordingSegmentDecoders, RenderSegment,
@@ -45,7 +46,7 @@ pub enum ExportError {
pub struct Exporter<TOnProgress> {
render_segments: Vec<RenderSegment>,
- audio_segments: Vec<AudioTrack>,
+ audio_segments: Vec<AudioSegment>,
output_size: (u32, u32),
output_path: PathBuf,
project: ProjectConfiguration,
@@ -112,12 +113,19 @@ where
.await
.map_err(ExportError::Other)?,
});
- audio_segments.push(
- [s.audio.clone(), s.system_audio.clone()]
- .into_iter()
- .flatten()
- .collect::<Vec<_>>(),
- );
+ audio_segments.push(AudioSegment {
+ tracks: [
+ s.audio
+ .clone()
+ .map(|a| AudioSegmentTrack::new(a, |c| c.mic_volume_db)),
+ s.system_audio
+ .clone()
+ .map(|a| AudioSegmentTrack::new(a, |c| c.system_volume_db)),
+ ]
+ .into_iter()
+ .flatten()
+ .collect::<Vec<_>>(),
+ });
}
Ok(Self {
@@ -237,7 +245,6 @@ where
frame_count += 1;
}
- // Save the first frame as a screenshot and thumbnail
if let Some(frame) = first_frame {
let rgb_img = ImageBuffer::<image::Rgb<u8>, Vec<u8>>::from_raw(
frame.width,
diff --git a/crates/media/src/feeds/audio.rs b/crates/media/src/feeds/audio.rs
index f1606de94..ed2a48d1a 100644
--- a/crates/media/src/feeds/audio.rs
+++ b/crates/media/src/feeds/audio.rs
@@ -1,5 +1,5 @@
use cap_audio::AudioData;
-use cap_project::{ProjectConfiguration, TimelineConfiguration};
+use cap_project::{AudioConfiguration, ProjectConfiguration, TimelineConfiguration};
use ffmpeg::{
codec::decoder,
format::{
@@ -118,7 +118,7 @@ fn decode_audio_to_f32(
}
pub struct AudioRenderer {
- data: Vec<AudioTrack>,
+ data: Vec<AudioSegment>,
cursor: AudioRendererCursor,
// sum of `frame.samples()` that have elapsed
// this * channel count = cursor
@@ -132,7 +132,30 @@ pub struct AudioRendererCursor {
samples: usize,
}
-pub type AudioTrack = Vec<Arc<AudioData>>;
+#[derive(Clone)]
+pub struct AudioSegment {
+ pub tracks: Vec<AudioSegmentTrack>,
+}
+
+#[derive(Clone)]
+pub struct AudioSegmentTrack {
+ data: Arc<AudioData>,
+ get_gain: fn(&AudioConfiguration) -> f32,
+}
+
+impl AudioSegmentTrack {
+ pub fn new(data: Arc<AudioData>, get_gain: fn(&AudioConfiguration) -> f32) -> Self {
+ Self { data, get_gain }
+ }
+
+ pub fn data(&self) -> &Arc<AudioData> {
+ &self.data
+ }
+
+ pub fn gain(&self, config: &AudioConfiguration) -> f32 {
+ (self.get_gain)(config)
+ }
+}
impl AudioRenderer {
pub const SAMPLE_FORMAT: avformat::Sample = AudioData::SAMPLE_FORMAT;
@@ -143,7 +166,7 @@ impl AudioRenderer {
AudioInfo::new(Self::SAMPLE_FORMAT, Self::SAMPLE_RATE, Self::CHANNELS).unwrap()
}
- pub fn new(data: Vec<AudioTrack>) -> Self {
+ pub fn new(data: Vec<AudioSegment>) -> Self {
Self {
data,
cursor: AudioRendererCursor {
@@ -233,16 +256,17 @@ impl AudioRenderer {
}
let channels: usize = 2;
- let track_datas = self.data[self.cursor.segment_index as usize]
- .iter()
- .map(|t| t.as_ref())
- .collect::<Vec<_>>();
+ let tracks = &self.data[self.cursor.segment_index as usize].tracks;
- if track_datas.is_empty() {
+ if tracks.is_empty() {
return None;
}
- let max_samples = track_datas.iter().map(|t| t.sample_count()).min().unwrap();
+ let max_samples = tracks
+ .iter()
+ .map(|t| t.data().sample_count())
+ .min()
+ .unwrap();
if self.cursor.samples >= max_samples {
self.elapsed_samples += samples;
@@ -255,8 +279,22 @@ impl AudioRenderer {
let mut ret = vec![0.0; samples * 2];
+ let track_datas = tracks
+ .iter()
+ .map(|t| {
+ (
+ t.data().as_ref(),
+ if project.audio.mute {
+ f32::NEG_INFINITY
+ } else {
+ t.gain(&project.audio)
+ },
+ )
+ })
+ .collect::<Vec<_>>();
+
let actual_sample_count =
- cap_audio::render_audio(track_datas.as_slice(), start.samples, samples, 0, &mut ret);
+ cap_audio::render_audio(&track_datas, start.samples, samples, 0, &mut ret);
self.elapsed_samples += actual_sample_count;
self.cursor.samples += actual_sample_count;
@@ -279,7 +317,7 @@ impl<T: FromSampleBytes> AudioPlaybackBuffer<T> {
pub const PLAYBACK_SAMPLES_COUNT: u32 = 256;
const PROCESSING_SAMPLES_COUNT: u32 = 1024;
- pub fn new(data: Vec<AudioTrack>, output_info: AudioInfo) -> Self {
+ pub fn new(data: Vec<AudioSegment>, output_info: AudioInfo) -> Self {
// println!("Input info: {:?}", data[0][0].info);
println!("Output info: {:?}", output_info);
@@ -304,8 +342,6 @@ impl<T: FromSampleBytes> AudioPlaybackBuffer<T> {
self.resampler.reset();
self.resampled_buffer.clear();
self.frame_buffer.set_playhead(playhead, project);
-
- println!("Successful seek to sample {:?}", self.frame_buffer.cursor);
}
pub fn buffer_reaching_limit(&self) -> bool {
diff --git a/crates/project/src/configuration.rs b/crates/project/src/configuration.rs
index a4aa93d87..8f26c11f2 100644
--- a/crates/project/src/configuration.rs
+++ b/crates/project/src/configuration.rs
@@ -276,11 +276,26 @@ impl Default for ShadowConfiguration {
}
}
-#[derive(Type, Serialize, Deserialize, Clone, Debug, Default)]
+#[derive(Type, Serialize, Deserialize, Clone, Debug, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct AudioConfiguration {
pub mute: bool,
pub improve: bool,
+ #[serde(default)]
+ pub mic_volume_db: f32,
+ #[serde(default)]
+ pub system_volume_db: f32,
+}
+
+impl Default for AudioConfiguration {
+ fn default() -> Self {
+ Self {
+ mute: false,
+ improve: false,
+ mic_volume_db: 0.0,
+ system_volume_db: 0.0,
+ }
+ }
}
#[derive(Type, Serialize, Deserialize, Clone, Debug, Default)]
diff --git a/crates/rendering/src/lib.rs b/crates/rendering/src/lib.rs
index af4b9b83a..2c9248226 100644
--- a/crates/rendering/src/lib.rs
+++ b/crates/rendering/src/lib.rs
@@ -426,16 +426,8 @@ impl RenderVideoConstants {
recording_meta: &RecordingMeta,
meta: &StudioRecordingMeta,
) -> HashMap<String, CursorTexture> {
- println!("Starting to load cursor textures");
- println!("Project path: {:?}", recording_meta.project_path);
- // println!("Cursor images to load: {:?}", cursor.cursor_images);
-
let mut textures = HashMap::new();
- // Create the full path to the cursors directory
- let cursors_dir = recording_meta.project_path.join("content").join("cursors");
- println!("Cursors directory: {:?}", cursors_dir);
-
let cursor_images = match &meta {
StudioRecordingMeta::SingleSegment { .. } => Default::default(),
StudioRecordingMeta::MultipleSegments { inner, .. } => {
@@ -444,26 +436,13 @@ impl RenderVideoConstants {
};
for (cursor_id, cursor) in &cursor_images.0 {
- println!(
- "Loading cursor image: {} -> {}",
- cursor_id,
- cursor.path.display()
- );
-
- println!("Full cursor path: {:?}", cursor);
-
if !cursor.path.exists() {
- println!("Cursor image file does not exist: {:?}", cursor);
continue;
}
match image::open(&cursor.path) {
Ok(img) => {
let dimensions = img.dimensions();
- println!(
- "Loaded cursor image dimensions: {}x{}",
- dimensions.0, dimensions.1
- );
let rgba = img.into_rgba8();
diff --git a/packages/ui-solid/src/auto-imports.d.ts b/packages/ui-solid/src/auto-imports.d.ts
index ba1ba12f6..c43fa1bbb 100644
--- a/packages/ui-solid/src/auto-imports.d.ts
+++ b/packages/ui-solid/src/auto-imports.d.ts
@@ -88,7 +88,7 @@ declare global {
const IconLucideMessageSquare: typeof import("~icons/lucide/message-square.jsx")["default"]
const IconLucideMessageSquarePlus: typeof import('~icons/lucide/message-square-plus.jsx')['default']
const IconLucideMicOff: typeof import('~icons/lucide/mic-off.jsx')['default']
- const IconLucideMonitor: typeof import("~icons/lucide/monitor.jsx")["default"]
+ const IconLucideMonitor: typeof import('~icons/lucide/monitor.jsx')['default']
const IconLucideRabbit: typeof import("~icons/lucide/rabbit.jsx")["default"]
const IconLucideRotateCcw: typeof import('~icons/lucide/rotate-ccw.jsx')['default']
const IconLucideSearch: typeof import('~icons/lucide/search.jsx')['default']