From c8680028c6fc9570f6b8324285fed925d19f053c Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Sun, 16 Feb 2020 10:33:20 -0800 Subject: Added UI for selecting configured model --- config.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'config.c') diff --git a/config.c b/config.c index bc56421..9874166 100644 --- a/config.c +++ b/config.c @@ -322,3 +322,18 @@ uint32_t get_lowpass_cutoff(tern_node *config) char * lowpass_cutoff_str = tern_find_path(config, "audio\0lowpass_cutoff\0", TVAL_PTR).ptrval; return lowpass_cutoff_str ? atoi(lowpass_cutoff_str) : DEFAULT_LOWPASS_CUTOFF; } + +tern_node *get_systems_config(void) +{ + static tern_node *systems; + if (!systems) { + systems = parse_bundled_config("systems.cfg"); + } + return systems; +} + +tern_node *get_model(tern_node *config, system_type stype) +{ + char *model = tern_find_path_default(config, "system\0model\0", (tern_val){.ptrval = "md1va3"}, TVAL_PTR); + return tern_find_node(get_systems_config(), model); +} -- cgit v1.2.3