mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
refactor: device abstraction, layout components
This commit is contained in:
parent
d330d31ce4
commit
788dc1ccde
21 changed files with 1144 additions and 1166 deletions
21
src/device/chain.rs
Normal file
21
src/device/chain.rs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
use crate::prelude::*;
|
||||
|
||||
pub struct Chain {
|
||||
name: String,
|
||||
devices: Vec<Box<dyn Device>>
|
||||
}
|
||||
|
||||
impl Chain {
|
||||
pub fn new (name: &str, devices: Vec<Box<dyn Device>>) -> Result<DynamicDevice<Self>, Box<dyn Error>> {
|
||||
Ok(DynamicDevice::new(render, handle, |_|{}, Self {
|
||||
name: name.into(),
|
||||
devices
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn render (state: &Chain, buf: &mut Buffer, area: Rect) {}
|
||||
|
||||
pub fn handle (state: &mut Chain, event: &EngineEvent) -> Result<(), Box<dyn Error>> {
|
||||
Ok(())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue