Add audio node graph editing

This commit is contained in:
Skyler Lehmkuhl
2025-10-25 03:29:54 -04:00
parent 19e99fa8bf
commit 16f4a2a359
43 changed files with 7110 additions and 824 deletions
+11
View File
@@ -198,6 +198,17 @@ impl Project {
self.tracks.get_mut(&track_id)
}
/// 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>> {
if let Some(TrackNode::Midi(track)) = self.tracks.get(&track_id) {
if let Some(ref graph) = track.instrument_graph {
let node_idx = petgraph::stable_graph::NodeIndex::new(node_id as usize);
return graph.get_oscilloscope_data(node_idx, sample_count);
}
}
None
}
/// Get all root-level track IDs
pub fn root_tracks(&self) -> &[TrackId] {
&self.root_tracks