B:BD[
3.1002] → [
3.1002:1047]
∅:D[
3.1047] → [
8.403:463]
B:BD[
8.403] → [
8.403:463]
B:BD[
8.463] → [
9.514:536]
self.insert_resource(Track::<T, N> {
sample_rate,
..default()
})
.add_systems(
if let Some(subtrack_id) = subchannel_id {
self.add_systems(
Startup,
move |mut commands: Commands, mut output: NonSendMut<FundspAudioOutput>| {
if let Some(handle) = output.sub_channels.get(&subtrack_id) {
commands.insert_resource(Track::<T, N> {
sample_rate,
output: kira::OutputDestination::Track(handle.into()),
..default()
});
} else {
// Our manager doesn't exist, so we *can't* create tracks
if let Some(manager) = output.manager.as_mut() {
let new_track = match manager.add_sub_track(TrackBuilder::default()) {
Ok(handle) => {
debug!("Created new subtrack for subtrack id {subtrack_id}");
let new_track = Track::<T, N> {
sample_rate,
output: kira::OutputDestination::Track(handle.id()),
..default()
};
output.sub_channels.insert(subtrack_id, handle);
new_track
}
Err(e) => {
warn!("Failed to create subtrack: {e}, routing to main");
Track::<T, N> {
sample_rate,
..default()
}
}
};
commands.insert_resource(new_track);
} else {
debug!("No manager, so tracks can't exist")
}
}
},
);
} else {
self.add_systems(Startup, move |mut commands: Commands| {
commands.insert_resource(Track::<T, N> {
sample_rate,
..default()
})
});
}
self.add_systems(