Clean up build warnings
This commit is contained in:
@@ -15,6 +15,7 @@ use uuid::Uuid;
|
||||
pub enum NodeGraphAction {
|
||||
AddNode(AddNodeAction),
|
||||
RemoveNode(RemoveNodeAction),
|
||||
#[allow(dead_code)]
|
||||
MoveNode(MoveNodeAction),
|
||||
Connect(ConnectAction),
|
||||
Disconnect(DisconnectAction),
|
||||
@@ -240,6 +241,7 @@ impl RemoveNodeAction {
|
||||
// MoveNodeAction
|
||||
// ============================================================================
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub struct MoveNodeAction {
|
||||
layer_id: Uuid,
|
||||
backend_node_id: BackendNodeId,
|
||||
@@ -248,6 +250,7 @@ pub struct MoveNodeAction {
|
||||
}
|
||||
|
||||
impl MoveNodeAction {
|
||||
#[allow(dead_code)]
|
||||
pub fn new(layer_id: Uuid, backend_node_id: BackendNodeId, new_position: (f32, f32)) -> Self {
|
||||
Self {
|
||||
layer_id,
|
||||
|
||||
@@ -17,8 +17,8 @@ pub struct AudioGraphBackend {
|
||||
audio_controller: Arc<Mutex<EngineController>>,
|
||||
|
||||
/// Maps backend NodeIndex to stable IDs for round-trip serialization
|
||||
node_index_to_stable: HashMap<NodeIndex, u32>,
|
||||
next_stable_id: u32,
|
||||
_node_index_to_stable: HashMap<NodeIndex, u32>,
|
||||
_next_stable_id: u32,
|
||||
}
|
||||
|
||||
impl AudioGraphBackend {
|
||||
@@ -26,8 +26,8 @@ impl AudioGraphBackend {
|
||||
Self {
|
||||
track_id,
|
||||
audio_controller,
|
||||
node_index_to_stable: HashMap::new(),
|
||||
next_stable_id: 0,
|
||||
_node_index_to_stable: HashMap::new(),
|
||||
_next_stable_id: 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,25 +41,23 @@ impl GraphBackend for AudioGraphBackend {
|
||||
|
||||
// Generate placeholder node ID
|
||||
// This will be replaced with actual backend NodeIndex from sync query
|
||||
let stable_id = self.next_stable_id;
|
||||
self.next_stable_id += 1;
|
||||
let stable_id = self._next_stable_id;
|
||||
self._next_stable_id += 1;
|
||||
|
||||
// Placeholder: use stable_id as backend index (will be wrong, but compiles)
|
||||
let node_idx = NodeIndex::new(stable_id as usize);
|
||||
self.node_index_to_stable.insert(node_idx, stable_id);
|
||||
self._node_index_to_stable.insert(node_idx, stable_id);
|
||||
|
||||
Ok(BackendNodeId::Audio(node_idx))
|
||||
}
|
||||
|
||||
fn remove_node(&mut self, backend_id: BackendNodeId) -> Result<(), String> {
|
||||
let BackendNodeId::Audio(node_idx) = backend_id else {
|
||||
return Err("Invalid backend node type".to_string());
|
||||
};
|
||||
let BackendNodeId::Audio(node_idx) = backend_id;
|
||||
|
||||
let mut controller = self.audio_controller.lock().unwrap();
|
||||
controller.graph_remove_node(self.track_id, node_idx.index() as u32);
|
||||
|
||||
self.node_index_to_stable.remove(&node_idx);
|
||||
self._node_index_to_stable.remove(&node_idx);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -71,12 +69,8 @@ impl GraphBackend for AudioGraphBackend {
|
||||
input_node: BackendNodeId,
|
||||
input_port: usize,
|
||||
) -> Result<(), String> {
|
||||
let BackendNodeId::Audio(from_idx) = output_node else {
|
||||
return Err("Invalid output node type".to_string());
|
||||
};
|
||||
let BackendNodeId::Audio(to_idx) = input_node else {
|
||||
return Err("Invalid input node type".to_string());
|
||||
};
|
||||
let BackendNodeId::Audio(from_idx) = output_node;
|
||||
let BackendNodeId::Audio(to_idx) = input_node;
|
||||
|
||||
let mut controller = self.audio_controller.lock().unwrap();
|
||||
controller.graph_connect(
|
||||
@@ -97,12 +91,8 @@ impl GraphBackend for AudioGraphBackend {
|
||||
input_node: BackendNodeId,
|
||||
input_port: usize,
|
||||
) -> Result<(), String> {
|
||||
let BackendNodeId::Audio(from_idx) = output_node else {
|
||||
return Err("Invalid output node type".to_string());
|
||||
};
|
||||
let BackendNodeId::Audio(to_idx) = input_node else {
|
||||
return Err("Invalid input node type".to_string());
|
||||
};
|
||||
let BackendNodeId::Audio(from_idx) = output_node;
|
||||
let BackendNodeId::Audio(to_idx) = input_node;
|
||||
|
||||
let mut controller = self.audio_controller.lock().unwrap();
|
||||
controller.graph_disconnect(
|
||||
@@ -122,9 +112,7 @@ impl GraphBackend for AudioGraphBackend {
|
||||
param_id: u32,
|
||||
value: f64,
|
||||
) -> Result<(), String> {
|
||||
let BackendNodeId::Audio(node_idx) = backend_id else {
|
||||
return Err("Invalid backend node type".to_string());
|
||||
};
|
||||
let BackendNodeId::Audio(node_idx) = backend_id;
|
||||
|
||||
let mut controller = self.audio_controller.lock().unwrap();
|
||||
controller.graph_set_parameter(
|
||||
@@ -180,9 +168,7 @@ impl GraphBackend for AudioGraphBackend {
|
||||
x: f32,
|
||||
y: f32,
|
||||
) -> Result<BackendNodeId, String> {
|
||||
let BackendNodeId::Audio(allocator_idx) = voice_allocator_id else {
|
||||
return Err("Invalid voice allocator node type".to_string());
|
||||
};
|
||||
let BackendNodeId::Audio(allocator_idx) = voice_allocator_id;
|
||||
|
||||
let mut controller = self.audio_controller.lock().unwrap();
|
||||
controller.graph_add_node_to_template(
|
||||
@@ -194,8 +180,8 @@ impl GraphBackend for AudioGraphBackend {
|
||||
);
|
||||
|
||||
// Placeholder return
|
||||
let stable_id = self.next_stable_id;
|
||||
self.next_stable_id += 1;
|
||||
let stable_id = self._next_stable_id;
|
||||
self._next_stable_id += 1;
|
||||
let node_idx = NodeIndex::new(stable_id as usize);
|
||||
|
||||
Ok(BackendNodeId::Audio(node_idx))
|
||||
@@ -209,15 +195,9 @@ impl GraphBackend for AudioGraphBackend {
|
||||
input_node: BackendNodeId,
|
||||
input_port: usize,
|
||||
) -> Result<(), String> {
|
||||
let BackendNodeId::Audio(allocator_idx) = voice_allocator_id else {
|
||||
return Err("Invalid voice allocator node type".to_string());
|
||||
};
|
||||
let BackendNodeId::Audio(from_idx) = output_node else {
|
||||
return Err("Invalid output node type".to_string());
|
||||
};
|
||||
let BackendNodeId::Audio(to_idx) = input_node else {
|
||||
return Err("Invalid input node type".to_string());
|
||||
};
|
||||
let BackendNodeId::Audio(allocator_idx) = voice_allocator_id;
|
||||
let BackendNodeId::Audio(from_idx) = output_node;
|
||||
let BackendNodeId::Audio(to_idx) = input_node;
|
||||
|
||||
let mut controller = self.audio_controller.lock().unwrap();
|
||||
controller.graph_connect_in_template(
|
||||
|
||||
@@ -18,6 +18,7 @@ pub enum BackendNodeId {
|
||||
/// Implementations:
|
||||
/// - AudioGraphBackend: Wraps daw_backend::AudioGraph via EngineController
|
||||
/// - VfxGraphBackend (future): GPU-based shader graph
|
||||
#[allow(dead_code)]
|
||||
pub trait GraphBackend: Send {
|
||||
/// Add a node to the backend graph
|
||||
fn add_node(&mut self, node_type: &str, x: f32, y: f32) -> Result<BackendNodeId, String>;
|
||||
|
||||
@@ -67,6 +67,7 @@ impl NodeGraphPane {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn with_track_id(
|
||||
track_id: Uuid,
|
||||
audio_controller: std::sync::Arc<std::sync::Mutex<daw_backend::EngineController>>,
|
||||
@@ -207,7 +208,7 @@ impl NodeGraphPane {
|
||||
// Set parameter values
|
||||
for (¶m_id, &value) in &node.parameters {
|
||||
// Find the input param in the graph and set its value
|
||||
if let Some(node_data) = self.state.graph.nodes.get_mut(frontend_id) {
|
||||
if let Some(_node_data) = self.state.graph.nodes.get_mut(frontend_id) {
|
||||
// TODO: Set parameter values on the node's input params
|
||||
// This requires matching param_id to the input param by index
|
||||
let _ = (param_id, value); // Silence unused warning for now
|
||||
@@ -428,25 +429,25 @@ impl NodeGraphPane {
|
||||
|
||||
fn check_parameter_changes(&mut self) {
|
||||
// Check all input parameters for value changes
|
||||
let mut checked_count = 0;
|
||||
let mut connection_only_count = 0;
|
||||
let mut non_float_count = 0;
|
||||
let mut _checked_count = 0;
|
||||
let mut _connection_only_count = 0;
|
||||
let mut _non_float_count = 0;
|
||||
|
||||
for (input_id, input_param) in &self.state.graph.inputs {
|
||||
// Only check parameters that can have constant values (not ConnectionOnly)
|
||||
if matches!(input_param.kind, InputParamKind::ConnectionOnly) {
|
||||
connection_only_count += 1;
|
||||
_connection_only_count += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Get current value
|
||||
let current_value = match &input_param.value {
|
||||
ValueType::Float { value } => {
|
||||
checked_count += 1;
|
||||
_checked_count += 1;
|
||||
*value
|
||||
},
|
||||
other => {
|
||||
non_float_count += 1;
|
||||
_non_float_count += 1;
|
||||
eprintln!("[DEBUG] Non-float parameter type: {:?}", std::mem::discriminant(other));
|
||||
continue;
|
||||
}
|
||||
@@ -572,7 +573,7 @@ impl crate::panes::PaneRenderer for NodeGraphPane {
|
||||
// Check if track is MIDI or Audio
|
||||
if let Some(audio_controller) = &shared.audio_controller {
|
||||
let is_valid_track = {
|
||||
let controller = audio_controller.lock().unwrap();
|
||||
let _controller = audio_controller.lock().unwrap();
|
||||
// TODO: Query track type from backend
|
||||
// For now, assume it's valid if we have a track ID mapping
|
||||
true
|
||||
@@ -624,7 +625,7 @@ impl crate::panes::PaneRenderer for NodeGraphPane {
|
||||
let grid_color = grid_style.background_color.unwrap_or(egui::Color32::from_gray(55));
|
||||
|
||||
// Allocate the rect and render the graph editor within it
|
||||
ui.allocate_ui_at_rect(rect, |ui| {
|
||||
ui.scope_builder(egui::UiBuilder::new().max_rect(rect), |ui| {
|
||||
// Check for scroll input to override library's default zoom behavior
|
||||
// Only handle scroll when mouse is over the node graph area
|
||||
let pointer_over_graph = ui.rect_contains_pointer(rect);
|
||||
@@ -705,8 +706,8 @@ impl crate::panes::PaneRenderer for NodeGraphPane {
|
||||
|
||||
// Draw menu button in top-left corner
|
||||
let button_pos = rect.min + egui::vec2(8.0, 8.0);
|
||||
ui.allocate_ui_at_rect(
|
||||
egui::Rect::from_min_size(button_pos, egui::vec2(100.0, 24.0)),
|
||||
ui.scope_builder(
|
||||
egui::UiBuilder::new().max_rect(egui::Rect::from_min_size(button_pos, egui::vec2(100.0, 24.0))),
|
||||
|ui| {
|
||||
if ui.button("➕ Add Node").clicked() {
|
||||
// Open node finder at button's top-left position
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#![allow(dead_code)]
|
||||
//! Node Type Registry
|
||||
//!
|
||||
//! Defines metadata for all available node types
|
||||
|
||||
@@ -38,7 +38,7 @@ impl NodePalette {
|
||||
.rect_filled(rect, 0.0, egui::Color32::from_rgb(30, 30, 30));
|
||||
|
||||
// Create UI within the palette rect
|
||||
ui.allocate_ui_at_rect(rect, |ui| {
|
||||
ui.scope_builder(egui::UiBuilder::new().max_rect(rect), |ui| {
|
||||
ui.vertical(|ui| {
|
||||
ui.add_space(8.0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user