TIBHWLXVP65L7JIJNS6OZ44ETNIAKHOPWAAQWMB2VE5HAZNE2CKQC
} else if let Some(manager) = output.manager.as_mut() {
// TODO Expose TrackRoutes::parent and TrackRouters::with_routes
// Maybe to go ham and like use the whole kira
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);
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")
}
debug!("No manager, so tracks can't exist")