display{d},
controller{},
outputs(),
+ config(),
layouts(),
layers() {
assert(g_app == nullptr);
g_app = this;
- {
- auto l = load_layer_map("../ids.json");
- if (l.is_ok()) {
- this->layers = l.unwrap();
- } else {
- logerror("%s", l.err().value());
+ try {
+ {
+ auto l = load_layer_map(
+ this->config.get_string("layers.json").value().c_str());
+ if (l.is_ok()) {
+ this->layers = l.unwrap();
+ } else {
+ logerror("%s", l.err().value());
+ }
}
- }
- {
- auto l = load_layout("../layout.json");
- if (l.is_ok()) {
- this->layouts = l.unwrap();
- } else {
- logerror("%s", l.err().value());
+ {
+ auto l = load_layout(
+ this->config.get_string("layout.json").value().c_str());
+ if (l.is_ok()) {
+ this->layouts = l.unwrap();
+ } else {
+ logerror("%s", l.err().value());
+ }
}
+ } catch (std::exception &e) {
+ logerror("Loading of configuration failed: %s", e.what());
}
}