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

+7
View File
@@ -11,6 +11,13 @@ use crate::ipc::Client;
/// Set this to point the app and the daemon at a scratch directory, as scripts do.
pub const HOME_ENV: &str = "RECORD_DAEMON_HOME";
/// Where the review screen keeps one audio file per track of a clip.
pub fn audio_cache_dir() -> PathBuf {
data_dir()
.map(|p| p.join("audio-cache"))
.unwrap_or_else(|| PathBuf::from("./audio-cache"))
}
/// The daemon's data directory, shared with the daemon itself.
pub fn data_dir() -> Option<PathBuf> {
if let Some(home) = std::env::var_os(HOME_ENV).filter(|value| !value.is_empty()) {