record: keep a track per audio source and let the review mute them

The recorder put every source on one mixer track, so the file had one audio
stream and the review screen could not tell the game's sound from the
microphone or from Discord.

The daemon now gives each source a track: 1 for the game, 2 for the
microphone, then one per application in the settings, up to OBS's six. Every
track above the first gets an audio encoder and the output is told which
tracks to write, which is what libobs's muxer reads to lay the streams out in
track order. The timeline's new `audio_tracks` names what each stream holds,
with empty names for the tracks no source fed.

The app opens one player per stream, copied out of the clip into the audio
cache, and the transport carries a toggle per channel. A channel that is off
is neither heard nor kept: clip and highlight exports mix only the tracks
left on. Recordings made before this change have one stream and play as they
did.
This commit is contained in:
vhaudiquet committed 2026-11-19 18:37:20 +01:00
1 parent 4f2ee4256a
commit eabc3780c9
13 files changed
+545 -46

No files matched your search

+11 -1
View File
@@ -1028,11 +1028,21 @@ pub fn demo_review(app: &mut App) {
}
screens::review::show(app, sample.remove(0));
app.review.error = Some("Sample recording: no clip on disk.".to_string());
// Snapshot hook: draw a real clip when one is handed in.
// Snapshot hook: draw a real clip when one is handed in, with as many audio tracks as
// `LR_DEMO_TRACKS` names.
if let Ok(path) = std::env::var("LR_DEMO_VIDEO") {
let player = rune::Player::file(&path);
player.set_looping(false);
app.review.player = Some(player);
app.review.error = None;
if let Ok(tracks) = std::env::var("LR_DEMO_TRACKS") {
if let Some(game) = app.review.game.as_mut() {
game.audio_tracks = tracks
.split(',')
.map(|name| name.trim().to_string())
.collect();
}
app.review.open_sound(&path);
}
}
}