Initial commit
This commit is contained in:
commit
d327311719
5 changed files with 4030 additions and 0 deletions
30
src/node.rs
Normal file
30
src/node.rs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
use iced::{Element, Point};
|
||||
|
||||
use crate::Message;
|
||||
|
||||
pub struct Node {
|
||||
pub name: String,
|
||||
pub inputs: Vec<Socket>,
|
||||
pub outputs: Vec<Socket>,
|
||||
pub position: Point,
|
||||
pub function: Box<dyn Fn([&Socket]) -> Vec<Socket>>
|
||||
}
|
||||
|
||||
pub struct Socket {
|
||||
name: Option<String>,
|
||||
kind: SocketType,
|
||||
data: SocketData
|
||||
}
|
||||
|
||||
pub enum SocketType {
|
||||
Input,
|
||||
Output,
|
||||
}
|
||||
|
||||
pub enum SocketData {
|
||||
F32(f32)
|
||||
}
|
||||
|
||||
pub fn node(from: &Node, node_index: usize) -> Element<'_,Message> {
|
||||
todo!();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue