2015-11-19 20:27:56 +11:00
|
|
|
struct Settings : Markup::Node {
|
2015-08-21 21:29:53 +10:00
|
|
|
Settings();
|
|
|
|
~Settings();
|
|
|
|
};
|
|
|
|
|
|
|
|
Settings::Settings() {
|
2016-01-30 17:40:35 +11:00
|
|
|
Markup::Node::operator=(BML::unserialize(string::read(locate("settings.bml"))));
|
2015-11-19 20:27:56 +11:00
|
|
|
|
|
|
|
auto set = [&](const string& name, const string& value) {
|
|
|
|
//create node and set to default value only if it does not already exist
|
|
|
|
if(!operator[](name)) operator()(name).setValue(value);
|
|
|
|
};
|
2015-08-21 21:29:53 +10:00
|
|
|
|
2015-11-19 20:27:56 +11:00
|
|
|
set("Library/Location", {userpath(), "Emulation/"});
|
2015-08-21 21:29:53 +10:00
|
|
|
|
2015-11-19 20:27:56 +11:00
|
|
|
set("icarus/Path", userpath());
|
|
|
|
set("icarus/CreateManifests", false);
|
|
|
|
set("icarus/UseDatabase", true);
|
|
|
|
set("icarus/UseHeuristics", true);
|
2015-08-21 21:29:53 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
Settings::~Settings() {
|
2016-01-30 17:40:35 +11:00
|
|
|
file::write(locate("settings.bml"), BML::serialize(*this));
|
2015-08-21 21:29:53 +10:00
|
|
|
}
|