fix bindings load

This commit is contained in:
🪞👃🪞 2025-08-07 22:34:08 +03:00
parent efdc25fded
commit 43c71e874d

View file

@ -158,6 +158,9 @@ impl App {
pub fn view <'a> (&'a self) -> impl Content<TuiOut> + 'a { pub fn view <'a> (&'a self) -> impl Content<TuiOut> + 'a {
Fill::xy(Bsp::a(self.view_overlay(), self.view_content())) Fill::xy(Bsp::a(self.view_overlay(), self.view_content()))
} }
pub fn update_clock (&self) {
ViewCache::update_clock(&self.project.clock.view_cache, self.clock(), self.size.w() > 80)
}
} }
macro_rules!dsl_view(($Struct:ident { $($fn:ident = |$self:ident $(, $arg:ident:$ty:ty)*|$body:expr);* $(;)? })=>{ macro_rules!dsl_view(($Struct:ident { $($fn:ident = |$self:ident $(, $arg:ident:$ty:ty)*|$body:expr);* $(;)? })=>{
content!(TuiOut: |self: $Struct| { content!(TuiOut: |self: $Struct| {
@ -351,7 +354,7 @@ impl Config {
} }
fn init_file (&mut self, path: &str, val: &str) -> Usually<()> { fn init_file (&mut self, path: &str, val: &str) -> Usually<()> {
if self.dirs.find_config_file(path).is_none() { if self.dirs.find_config_file(path).is_none() {
std::fs::write(self.dirs.place_config_file("profiles.edn")?, Self::DEFAULT_PROFILES); std::fs::write(self.dirs.place_config_file(path)?, val);
} }
Ok(()) Ok(())
} }
@ -610,16 +613,10 @@ audio!(
); );
impl App { impl App {
pub fn update_clock (&self) {
ViewCache::update_clock(&self.project.clock.view_cache, self.clock(), self.size.w() > 80)
}
pub fn toggle_dialog (&mut self, mut dialog: Option<Dialog>) -> Option<Dialog> { pub fn toggle_dialog (&mut self, mut dialog: Option<Dialog>) -> Option<Dialog> {
std::mem::swap(&mut self.dialog, &mut dialog); std::mem::swap(&mut self.dialog, &mut dialog);
dialog dialog
} }
pub fn toggle_editor (&mut self, value: Option<bool>) { pub fn toggle_editor (&mut self, value: Option<bool>) {
//FIXME: self.editing.store(value.unwrap_or_else(||!self.is_editing()), Relaxed); //FIXME: self.editing.store(value.unwrap_or_else(||!self.is_editing()), Relaxed);
let value = value.unwrap_or_else(||!self.editor().is_some()); let value = value.unwrap_or_else(||!self.editor().is_some());
@ -658,18 +655,15 @@ impl App {
} }
} }
} }
pub fn browser (&self) -> Option<&Browser> { pub fn browser (&self) -> Option<&Browser> {
self.dialog.as_ref().and_then(|dialog|match dialog { self.dialog.as_ref().and_then(|dialog|match dialog {
Dialog::Browser(_, b) => Some(b), Dialog::Browser(_, b) => Some(b),
_ => None _ => None
}) })
} }
pub fn device_pick (&mut self, index: usize) { pub fn device_pick (&mut self, index: usize) {
self.dialog = Some(Dialog::Device(index)); self.dialog = Some(Dialog::Device(index));
} }
pub fn device_add (&mut self, index: usize) -> Usually<()> { pub fn device_add (&mut self, index: usize) -> Usually<()> {
match index { match index {
0 => { 0 => {
@ -698,7 +692,6 @@ impl App {
_ => unreachable!(), _ => unreachable!(),
} }
} }
} }
/////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////