module/mpd: export module info through the new module_info struct type

This commit is contained in:
Daniel Eklöf 2019-01-12 12:52:16 +01:00
parent fb9f07dcad
commit a16e2f5a53
4 changed files with 37 additions and 34 deletions

View file

@ -377,20 +377,6 @@ module_xkb_from_config(const struct yml_node *node,
return module_xkb(conf_to_particle(c, parent_font));
}
static struct module *
module_mpd_from_config(const struct yml_node *node,
const struct font *parent_font)
{
const struct yml_node *host = yml_get_value(node, "host");
const struct yml_node *port = yml_get_value(node, "port");
const struct yml_node *c = yml_get_value(node, "content");
return module_mpd(
yml_value_as_string(host),
port != NULL ? yml_value_as_int(port) : 0,
conf_to_particle(c, parent_font));
}
static struct module *
module_network_from_config(const struct yml_node *node,
const struct font *parent_font)
@ -522,13 +508,14 @@ conf_to_bar(const struct yml_node *bar)
mods[idx] = module_i3.from_conf(m.value, font);
else if (strcmp(mod_name, "label") == 0)
mods[idx] = module_label.from_conf(m.value, font);
else if (strcmp(mod_name, "mpd") == 0)
mods[idx] = module_mpd.from_conf(m.value, font);
else if (strcmp(mod_name, "xwindow") == 0)
mods[idx] = module_xwindow_from_config(m.value, font);
else if (strcmp(mod_name, "xkb") == 0)
else if (strcmp(mod_name, "xkb") == 0)
mods[idx] = module_xkb_from_config(m.value, font);
else if (strcmp(mod_name, "mpd") == 0)
mods[idx] = module_mpd_from_config(m.value, font);
else if (strcmp(mod_name, "network") == 0)
mods[idx] = module_network_from_config(m.value, font);
else if (strcmp(mod_name, "removables") == 0)