main menu-ish

This commit is contained in:
i do not exist 2026-08-06 09:15:58 +03:00
parent 8e97d52a2f
commit 7d4998601b
2 changed files with 17 additions and 24 deletions

View file

@ -1,6 +1,7 @@
(view :logo (bsp/s (exact/y 1 (text ~~ ~~~~~~~~~~~~)) (view :logo (bsp/s (text ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~)
(bsp/s (exact/y 1 (text ~~~~ ~ ~< ~~ v0.3.0 ~~)) (bsp/s (text ~~~~ ~ ~< ~~ heatwave is the new darkwave ~~)
(bsp/s (exact/y 1 (text ~~~~ ~ ~~~~~~~~~~~~)) (text dig?))))) (bsp/s (text ~~~~ ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~)
(text powered by tengri & dizzle\n)))))
(view :browse (bsp/s (view :browse (bsp/s
(padding 3 1 :browse-title) (padding 3 1 :browse-title)
@ -13,15 +14,7 @@
:transport) :transport)
(mode :menu (name Menu) (info Mode selector.) (keys :axis/y :confirm) (mode :menu (name Menu) (info Mode selector.) (keys :axis/y :confirm)
(view (bg (g 16) (bsp/n (view (bg (g 16) (bsp/s (bsp/w (bg (g 32) :logo) (bsp/e :ports/out (bsp/e :transport :ports/in))) :dialog/menu))))
(bg (g 32) (max/xy 80 2 :transport))
(bsp/s
(max/y 3 (bg (g 80) :ports/out))
(bsp/n
(max/y 3 (bg (g 80) :ports/in))
(bg (g 30) (bsp/s
(max/y 6 :logo)
:dialog/menu))))))))
(view :ports/out (view :ports/out
(bsp/s (align/w (text L-AUDIO-OUT)) (bsp/s (align/w (text L-AUDIO-OUT))
@ -78,9 +71,9 @@
(mode :track (keys :track)) (mode :track (keys :track))
(mode :scene (keys :scene)) (mode :scene (keys :scene))
(mode :mix (keys :mix)) (mode :mix (keys :mix))
(bsp/n :status (bsp/w :meters/output (bsp/e :meters/input (bsp/n :tracks/inputs (view (bsp/n :status (bsp/w :meters/output (bsp/e :meters/input (bsp/n :tracks/inputs
(bsp/s :tracks/outputs (bsp/s :tracks/names (bsp/s :tracks/devices (bsp/s :tracks/outputs (bsp/s :tracks/names (bsp/s :tracks/devices
(fill (either :mode/editor (bsp/e :scenes/names :editor) :scenes)))))))))) (fill (either :mode/editor (bsp/e :scenes/names :editor) :scenes)))))))))))
(keys :back (@escape back)) (keys :back (@escape back))
(keys :confirm (@enter confirm)) (keys :confirm (@enter confirm))

View file

@ -391,7 +391,7 @@ mod config {
*config.error.write().unwrap() = Some(format!("{e:?}").into()); *config.error.write().unwrap() = Some(format!("{e:?}").into());
panic!("{e:?}"); panic!("{e:?}");
} else { } else {
println!("config updated"); //println!("config updated");
}, },
Err(errors) => { Err(errors) => {
panic!("{errors:?}"); panic!("{errors:?}");
@ -403,7 +403,7 @@ mod config {
NotifyConfig::default().with_poll_interval(Duration::from_millis(250)) NotifyConfig::default().with_poll_interval(Duration::from_millis(250))
)?; )?;
if let Some(mut path) = config.get_file() { if let Some(mut path) = config.get_file() {
println!("watching: {path:?}"); //println!("watching: {path:?}");
watcher.watch(&path, RecursiveMode::NonRecursive)?; watcher.watch(&path, RecursiveMode::NonRecursive)?;
*config.watch.write().unwrap() = Some(watcher); *config.watch.write().unwrap() = Some(watcher);
Ok(()) Ok(())
@ -426,7 +426,7 @@ mod config {
/// Write initial contents of configuration. /// Write initial contents of configuration.
pub fn init (&self) -> Usually<()> { pub fn init (&self) -> Usually<()> {
println!("\r\ninit {}", quanta::Clock::new().raw()); //println!("\r\ninit {}", quanta::Clock::new().raw());
self.clear(); self.clear();
self.load(Self::CONFIG, Self::DEFAULTS, |cfgs, dsl|{ self.load(Self::CONFIG, Self::DEFAULTS, |cfgs, dsl|{
cfgs.add(&dsl)?; cfgs.add(&dsl)?;
@ -1501,13 +1501,13 @@ mod draw {
.and_then(|m|self.config.get_mode(m)) .and_then(|m|self.config.get_mode(m))
.map(|mode|{ .map(|mode|{
south!( //south!(
format!("Mode: {:?}", self.mode.as_ref()), //format!("Mode: {:?}", self.mode.as_ref()),
format!("Time: {}", self.config.stamp.load(Relaxed)), //format!("Time: {}", self.config.stamp.load(Relaxed)),
iter_south(||mode.view.iter().enumerate().map(|(index, line)|{ //iter_south(||mode.view.iter().enumerate().map(|(index, line)|{
format!("View #{index} {line}") //format!("View #{index} {line}")
})) //}))
).align_nw().draw(to)?; //).align_nw().draw(to)?;
for (index, dsl) in mode.view.iter().enumerate() { for (index, dsl) in mode.view.iter().enumerate() {
if let Err(e) = self.interpret(to, dsl) { if let Err(e) = self.interpret(to, dsl) {