Use audio engine as source of truth for audio tracks

This commit is contained in:
Skyler Lehmkuhl
2026-03-11 12:37:31 -04:00
parent b8f847e167
commit 3bc980d08d
13 changed files with 379 additions and 230 deletions
+5
View File
@@ -211,6 +211,11 @@ impl Project {
self.tracks.get_mut(&track_id)
}
/// Iterate over all tracks in the project.
pub fn track_iter(&self) -> impl Iterator<Item = (TrackId, &TrackNode)> {
self.tracks.iter().map(|(&id, node)| (id, node))
}
/// Get oscilloscope data from a node in a track's graph
pub fn get_oscilloscope_data(&self, track_id: TrackId, node_id: u32, sample_count: usize) -> Option<(Vec<f32>, Vec<f32>)> {
if let Some(TrackNode::Midi(track)) = self.tracks.get(&track_id) {