clone ports as unowned and pass outwards

This commit is contained in:
🪞👃🪞 2024-07-04 01:35:02 +03:00
parent 394355331d
commit ddaf870271
9 changed files with 123 additions and 112 deletions

View file

@ -64,7 +64,8 @@ impl<'a> ChainView<'a> {
//y2 = y2 + 1;
//}
let width = width.saturating_sub(x).saturating_sub(x2);
let frame = device.render(buf, Rect { x: x + x2, y, width, height })?;
let frame = device.state.lock().unwrap()
.render(buf, Rect { x: x + x2, y, width, height })?;
let style = if i == track.device {
Some(if self.focused {
Style::default().green().bold().not_dim()
@ -145,13 +146,13 @@ pub fn draw_as_column (
let mut w = 0u16;
let mut frames = vec![];
for device in state.devices.iter() {
let device = device.lock().unwrap();
let style_midi = Style::default().black().bold().on_green();
let style_audio = Style::default().black().bold().on_red();
let midi_ins = device.midi_ins()?;
let midi_outs = device.midi_outs()?;
let audio_ins = device.audio_ins()?;
let audio_outs = device.audio_outs()?;
let device = device.state.lock().unwrap();
let style_midi = Style::default().black().bold().on_green();
let style_audio = Style::default().black().bold().on_red();
y = y + midi_ins.len() as u16;
let frame = device.render(buf, Rect {
x, y, width, height: height.saturating_sub(y)

View file

@ -44,7 +44,7 @@ impl<'a> SceneGridView<'a> {
}
pub fn draw_horizontal (&mut self) -> Usually<Rect> {
let (w, h) = self.size_horizontal();
//let (w, h) = self.size_horizontal();
//self.area.x = self.area.x + self.area.width.saturating_sub(w) / 2;
self.area.height = self.tracks.len() as u16 + 2;
//self.area.width = w;