wip: preparing to run groovebox from edn

This commit is contained in:
🪞👃🪞 2025-01-05 17:10:57 +01:00
parent ce4574ed78
commit a6efde40f8
5 changed files with 43 additions and 28 deletions

View file

@ -61,11 +61,11 @@ impl Groovebox {
has_clock!(|self: Groovebox|self.player.clock());
impl EdnViewData<Tui> for Groovebox {
fn get_bool (&self, item: &str) -> bool { todo!() }
fn get_unit (&self, item: &str) -> u16 {
impl EdnViewData<Tui> for &Groovebox {
fn get_bool (&self, item: EdnItem<&str>) -> bool { todo!() }
fn get_unit (&self, item: EdnItem<&str>) -> u16 {
use EdnItem::*;
match item {
match item.to_str() {
":sample-h" => if self.compact { 0 } else { 5 },
":samples-w" => if self.compact { 4 } else { 11 },
":samples-y" => if self.compact { 1 } else { 0 },
@ -76,9 +76,9 @@ impl EdnViewData<Tui> for Groovebox {
_ => 0
}
}
fn get_content <'a> (&'a self, item: &str) -> RenderBox<'a, Tui> {
fn get_content <'a> (&'a self, item: EdnItem<&str>) -> RenderBox<'a, Tui> {
use EdnItem::*;
match item {
match item.to_str() {
":input-meter-l" => Box::new(Meter("L/", self.sampler.input_meter[0])),
":input-meter-r" => Box::new(Meter("R/", self.sampler.input_meter[1])),