mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
fix bindings load
This commit is contained in:
parent
efdc25fded
commit
43c71e874d
1 changed files with 4 additions and 11 deletions
|
|
@ -158,6 +158,9 @@ impl App {
|
|||
pub fn view <'a> (&'a self) -> impl Content<TuiOut> + 'a {
|
||||
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);* $(;)? })=>{
|
||||
content!(TuiOut: |self: $Struct| {
|
||||
|
|
@ -351,7 +354,7 @@ impl Config {
|
|||
}
|
||||
fn init_file (&mut self, path: &str, val: &str) -> Usually<()> {
|
||||
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(())
|
||||
}
|
||||
|
|
@ -610,16 +613,10 @@ audio!(
|
|||
);
|
||||
|
||||
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> {
|
||||
std::mem::swap(&mut self.dialog, &mut dialog);
|
||||
dialog
|
||||
}
|
||||
|
||||
pub fn toggle_editor (&mut self, value: Option<bool>) {
|
||||
//FIXME: self.editing.store(value.unwrap_or_else(||!self.is_editing()), Relaxed);
|
||||
let value = value.unwrap_or_else(||!self.editor().is_some());
|
||||
|
|
@ -658,18 +655,15 @@ impl App {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn browser (&self) -> Option<&Browser> {
|
||||
self.dialog.as_ref().and_then(|dialog|match dialog {
|
||||
Dialog::Browser(_, b) => Some(b),
|
||||
_ => None
|
||||
})
|
||||
}
|
||||
|
||||
pub fn device_pick (&mut self, index: usize) {
|
||||
self.dialog = Some(Dialog::Device(index));
|
||||
}
|
||||
|
||||
pub fn device_add (&mut self, index: usize) -> Usually<()> {
|
||||
match index {
|
||||
0 => {
|
||||
|
|
@ -698,7 +692,6 @@ impl App {
|
|||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue